wcz-test 4.0.1 → 4.1.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/index.d.ts +24 -24
- package/dist/index.js +786 -488
- package/dist/index.js.map +1 -1
- package/package.json +70 -83
- package/dist/index.cjs +0 -3654
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -426
package/dist/index.js
CHANGED
|
@@ -1,82 +1,3 @@
|
|
|
1
|
-
import { Button, IconButton, Link, Tab, ListItemButton, FormControl, FormLabel, Slider, FormHelperText, RadioGroup, FormControlLabel, Radio, Switch, Checkbox, Autocomplete, TextField, Stack, Typography, CardHeader, Box, useTheme, Paper, Chip, Divider, List, Dialog, Fab, InitColorSchemeScript, CssBaseline, AppBar, Toolbar, LinearProgress, ListItemIcon, ListItemText, ImageListItem, ImageListItemBar, Tooltip, createTheme, darken, lighten, useColorScheme, ListSubheader, Avatar, Menu, ListItem, useMediaQuery, Collapse } from '@mui/material';
|
|
2
|
-
import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
3
|
-
import * as React11 from 'react';
|
|
4
|
-
import React11__default, { createContext, useRef, useState, useEffect, useContext, useMemo, useId, useCallback, Fragment } from 'react';
|
|
5
|
-
import CloudUpload from '@mui/icons-material/CloudUpload';
|
|
6
|
-
import { useDropzone } from 'react-dropzone';
|
|
7
|
-
import { initReactI18next, useTranslation, I18nextProvider } from 'react-i18next';
|
|
8
|
-
export { useTranslation } from 'react-i18next';
|
|
9
|
-
import { useQuery, useMutation, useQueryClient, useIsFetching, useIsMutating } from '@tanstack/react-query';
|
|
10
|
-
import saveAs from 'file-saver';
|
|
11
|
-
import { Upload } from 'tus-js-client';
|
|
12
|
-
import { uuidv7 } from 'uuidv7';
|
|
13
|
-
export { uuidv7 } from 'uuidv7';
|
|
14
|
-
import { createLink, useRouterState, useNavigate, useRouter } from '@tanstack/react-router';
|
|
15
|
-
import axios from 'axios';
|
|
16
|
-
import MoreVert from '@mui/icons-material/MoreVert';
|
|
17
|
-
import { grey } from '@mui/material/colors';
|
|
18
|
-
import Delete from '@mui/icons-material/Delete';
|
|
19
|
-
import FileDownload from '@mui/icons-material/FileDownload';
|
|
20
|
-
import Button$1 from '@mui/material/Button';
|
|
21
|
-
import Dialog$1 from '@mui/material/Dialog';
|
|
22
|
-
import DialogActions from '@mui/material/DialogActions';
|
|
23
|
-
import DialogContent from '@mui/material/DialogContent';
|
|
24
|
-
import DialogTitle from '@mui/material/DialogTitle';
|
|
25
|
-
import AttachFile from '@mui/icons-material/AttachFile';
|
|
26
|
-
import Image from '@mui/icons-material/Image';
|
|
27
|
-
import SmartDisplay from '@mui/icons-material/SmartDisplay';
|
|
28
|
-
import Close from '@mui/icons-material/Close';
|
|
29
|
-
import Edit from '@mui/icons-material/Edit';
|
|
30
|
-
import { GridActionsCellItem } from '@mui/x-data-grid-premium';
|
|
31
|
-
import { styled, useThemeProps, ThemeProvider, useTheme as useTheme$1 } from '@mui/material/styles';
|
|
32
|
-
import dayjs from 'dayjs';
|
|
33
|
-
import weekOfYearPlugin from 'dayjs/plugin/weekOfYear.js';
|
|
34
|
-
import customParseFormatPlugin from 'dayjs/plugin/customParseFormat.js';
|
|
35
|
-
import localizedFormatPlugin from 'dayjs/plugin/localizedFormat.js';
|
|
36
|
-
import isBetweenPlugin from 'dayjs/plugin/isBetween.js';
|
|
37
|
-
import advancedFormatPlugin from 'dayjs/plugin/advancedFormat.js';
|
|
38
|
-
import * as z from 'zod';
|
|
39
|
-
import { cs, en } from 'zod/locales';
|
|
40
|
-
import Menu3 from '@mui/icons-material/Menu';
|
|
41
|
-
import MenuOpen from '@mui/icons-material/MenuOpen';
|
|
42
|
-
import useLocalStorageState from 'use-local-storage-state';
|
|
43
|
-
export { default as useLocalStorageState } from 'use-local-storage-state';
|
|
44
|
-
import { csCZ as csCZ$2, enUS as enUS$2 } from '@mui/material/locale';
|
|
45
|
-
import { csCZ as csCZ$1, enUS as enUS$1 } from '@mui/x-data-grid-premium/locales';
|
|
46
|
-
import { csCZ, enUS } from '@mui/x-date-pickers-pro/locales';
|
|
47
|
-
import Box6 from '@mui/material/Box';
|
|
48
|
-
import Drawer from '@mui/material/Drawer';
|
|
49
|
-
import Divider3 from '@mui/material/Divider';
|
|
50
|
-
import List3 from '@mui/material/List';
|
|
51
|
-
import ListSubheader$1 from '@mui/material/ListSubheader';
|
|
52
|
-
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
|
53
|
-
import Avatar$1 from '@mui/material/Avatar';
|
|
54
|
-
import Popper from '@mui/material/Popper';
|
|
55
|
-
import ListItem$1 from '@mui/material/ListItem';
|
|
56
|
-
import ListItemButton4 from '@mui/material/ListItemButton';
|
|
57
|
-
import ListItemIcon3 from '@mui/material/ListItemIcon';
|
|
58
|
-
import ListItemText3 from '@mui/material/ListItemText';
|
|
59
|
-
import Paper2 from '@mui/material/Paper';
|
|
60
|
-
import Typography7 from '@mui/material/Typography';
|
|
61
|
-
import AccountCircle from '@mui/icons-material/AccountCircle';
|
|
62
|
-
import ArrowBack from '@mui/icons-material/ArrowBack';
|
|
63
|
-
import Brightness4 from '@mui/icons-material/Brightness4';
|
|
64
|
-
import ChevronRight from '@mui/icons-material/ChevronRight';
|
|
65
|
-
import DarkMode from '@mui/icons-material/DarkMode';
|
|
66
|
-
import LightMode from '@mui/icons-material/LightMode';
|
|
67
|
-
import Login from '@mui/icons-material/Login';
|
|
68
|
-
import Logout from '@mui/icons-material/Logout';
|
|
69
|
-
import SettingsBrightness from '@mui/icons-material/SettingsBrightness';
|
|
70
|
-
import Translate from '@mui/icons-material/Translate';
|
|
71
|
-
import 'keycloak-js';
|
|
72
|
-
import default2 from 'i18next';
|
|
73
|
-
export { t } from 'i18next';
|
|
74
|
-
import LanguageDetector from 'i18next-browser-languagedetector';
|
|
75
|
-
import HttpBackend from 'i18next-http-backend';
|
|
76
|
-
import { createFormHookContexts, createFormHook } from '@tanstack/react-form';
|
|
77
|
-
import { DateTimePicker, DatePicker } from '@mui/x-date-pickers-pro';
|
|
78
|
-
import { NumericFormat } from 'react-number-format';
|
|
79
|
-
|
|
80
1
|
var __create = Object.create;
|
|
81
2
|
var __defProp = Object.defineProperty;
|
|
82
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -99,13 +20,14 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
99
20
|
// file that has been converted to a CommonJS file using a Babel-
|
|
100
21
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
101
22
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
102
|
-
__defProp(target, "default", { value: mod, enumerable: true }) ,
|
|
23
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
103
24
|
mod
|
|
104
25
|
));
|
|
105
26
|
|
|
106
27
|
// node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js
|
|
107
28
|
var require_react_is_production_min = __commonJS({
|
|
108
29
|
"node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js"(exports) {
|
|
30
|
+
"use strict";
|
|
109
31
|
var b = "function" === typeof Symbol && Symbol.for;
|
|
110
32
|
var c = b ? Symbol.for("react.element") : 60103;
|
|
111
33
|
var d = b ? Symbol.for("react.portal") : 60106;
|
|
@@ -218,8 +140,10 @@ var require_react_is_production_min = __commonJS({
|
|
|
218
140
|
// node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js
|
|
219
141
|
var require_react_is_development = __commonJS({
|
|
220
142
|
"node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js"(exports) {
|
|
143
|
+
"use strict";
|
|
221
144
|
if (process.env.NODE_ENV !== "production") {
|
|
222
145
|
(function() {
|
|
146
|
+
"use strict";
|
|
223
147
|
var hasSymbol = typeof Symbol === "function" && Symbol.for;
|
|
224
148
|
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103;
|
|
225
149
|
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106;
|
|
@@ -371,6 +295,7 @@ var require_react_is_development = __commonJS({
|
|
|
371
295
|
// node_modules/prop-types/node_modules/react-is/index.js
|
|
372
296
|
var require_react_is = __commonJS({
|
|
373
297
|
"node_modules/prop-types/node_modules/react-is/index.js"(exports, module) {
|
|
298
|
+
"use strict";
|
|
374
299
|
if (process.env.NODE_ENV === "production") {
|
|
375
300
|
module.exports = require_react_is_production_min();
|
|
376
301
|
} else {
|
|
@@ -382,6 +307,7 @@ var require_react_is = __commonJS({
|
|
|
382
307
|
// node_modules/object-assign/index.js
|
|
383
308
|
var require_object_assign = __commonJS({
|
|
384
309
|
"node_modules/object-assign/index.js"(exports, module) {
|
|
310
|
+
"use strict";
|
|
385
311
|
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
386
312
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
387
313
|
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
@@ -451,6 +377,7 @@ var require_object_assign = __commonJS({
|
|
|
451
377
|
// node_modules/prop-types/lib/ReactPropTypesSecret.js
|
|
452
378
|
var require_ReactPropTypesSecret = __commonJS({
|
|
453
379
|
"node_modules/prop-types/lib/ReactPropTypesSecret.js"(exports, module) {
|
|
380
|
+
"use strict";
|
|
454
381
|
var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
455
382
|
module.exports = ReactPropTypesSecret;
|
|
456
383
|
}
|
|
@@ -459,6 +386,7 @@ var require_ReactPropTypesSecret = __commonJS({
|
|
|
459
386
|
// node_modules/prop-types/lib/has.js
|
|
460
387
|
var require_has = __commonJS({
|
|
461
388
|
"node_modules/prop-types/lib/has.js"(exports, module) {
|
|
389
|
+
"use strict";
|
|
462
390
|
module.exports = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
463
391
|
}
|
|
464
392
|
});
|
|
@@ -466,6 +394,7 @@ var require_has = __commonJS({
|
|
|
466
394
|
// node_modules/prop-types/checkPropTypes.js
|
|
467
395
|
var require_checkPropTypes = __commonJS({
|
|
468
396
|
"node_modules/prop-types/checkPropTypes.js"(exports, module) {
|
|
397
|
+
"use strict";
|
|
469
398
|
var printWarning = function() {
|
|
470
399
|
};
|
|
471
400
|
if (process.env.NODE_ENV !== "production") {
|
|
@@ -531,6 +460,7 @@ var require_checkPropTypes = __commonJS({
|
|
|
531
460
|
// node_modules/prop-types/factoryWithTypeCheckers.js
|
|
532
461
|
var require_factoryWithTypeCheckers = __commonJS({
|
|
533
462
|
"node_modules/prop-types/factoryWithTypeCheckers.js"(exports, module) {
|
|
463
|
+
"use strict";
|
|
534
464
|
var ReactIs = require_react_is();
|
|
535
465
|
var assign = require_object_assign();
|
|
536
466
|
var ReactPropTypesSecret = require_ReactPropTypesSecret();
|
|
@@ -973,6 +903,7 @@ var require_factoryWithTypeCheckers = __commonJS({
|
|
|
973
903
|
// node_modules/prop-types/factoryWithThrowingShims.js
|
|
974
904
|
var require_factoryWithThrowingShims = __commonJS({
|
|
975
905
|
"node_modules/prop-types/factoryWithThrowingShims.js"(exports, module) {
|
|
906
|
+
"use strict";
|
|
976
907
|
var ReactPropTypesSecret = require_ReactPropTypesSecret();
|
|
977
908
|
function emptyFunction() {
|
|
978
909
|
}
|
|
@@ -990,10 +921,12 @@ var require_factoryWithThrowingShims = __commonJS({
|
|
|
990
921
|
err.name = "Invariant Violation";
|
|
991
922
|
throw err;
|
|
992
923
|
}
|
|
924
|
+
;
|
|
993
925
|
shim.isRequired = shim;
|
|
994
926
|
function getShim() {
|
|
995
927
|
return shim;
|
|
996
928
|
}
|
|
929
|
+
;
|
|
997
930
|
var ReactPropTypes = {
|
|
998
931
|
array: shim,
|
|
999
932
|
bigint: shim,
|
|
@@ -1026,6 +959,7 @@ var require_factoryWithThrowingShims = __commonJS({
|
|
|
1026
959
|
// node_modules/prop-types/index.js
|
|
1027
960
|
var require_prop_types = __commonJS({
|
|
1028
961
|
"node_modules/prop-types/index.js"(exports, module) {
|
|
962
|
+
"use strict";
|
|
1029
963
|
if (process.env.NODE_ENV !== "production") {
|
|
1030
964
|
ReactIs = require_react_is();
|
|
1031
965
|
throwOnDirectAccess = true;
|
|
@@ -1037,6 +971,10 @@ var require_prop_types = __commonJS({
|
|
|
1037
971
|
var throwOnDirectAccess;
|
|
1038
972
|
}
|
|
1039
973
|
});
|
|
974
|
+
|
|
975
|
+
// src/components/core/TypographyWithIcon.tsx
|
|
976
|
+
import { Stack, Typography } from "@mui/material";
|
|
977
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
1040
978
|
var stackSxProps = [
|
|
1041
979
|
"margin",
|
|
1042
980
|
"marginTop",
|
|
@@ -1101,9 +1039,18 @@ var TypographyWithIcon = ({ startIcon, endIcon, children, sx, gutterBottom, ...p
|
|
|
1101
1039
|
endIcon
|
|
1102
1040
|
] });
|
|
1103
1041
|
};
|
|
1042
|
+
|
|
1043
|
+
// src/components/core/PageHeader.tsx
|
|
1044
|
+
import { CardHeader, Typography as Typography2 } from "@mui/material";
|
|
1045
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
1104
1046
|
var PageHeader = ({ title, action, sx }) => {
|
|
1105
|
-
return /* @__PURE__ */
|
|
1047
|
+
return /* @__PURE__ */ jsx2(CardHeader, { title: /* @__PURE__ */ jsx2(Typography2, { variant: "h4", fontWeight: 600, children: title }), action, sx: { px: 0, ...sx } });
|
|
1106
1048
|
};
|
|
1049
|
+
|
|
1050
|
+
// src/components/core/TableContainer.tsx
|
|
1051
|
+
import { Box } from "@mui/material";
|
|
1052
|
+
import { useEffect, useRef, useState } from "react";
|
|
1053
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
1107
1054
|
var TableContainer = ({ children, sx, ...props }) => {
|
|
1108
1055
|
const reference = useRef(null);
|
|
1109
1056
|
const [height, setHeight] = useState();
|
|
@@ -1127,7 +1074,7 @@ var TableContainer = ({ children, sx, ...props }) => {
|
|
|
1127
1074
|
ro.disconnect();
|
|
1128
1075
|
};
|
|
1129
1076
|
}, []);
|
|
1130
|
-
return /* @__PURE__ */
|
|
1077
|
+
return /* @__PURE__ */ jsx3(
|
|
1131
1078
|
Box,
|
|
1132
1079
|
{
|
|
1133
1080
|
ref: reference,
|
|
@@ -1140,7 +1087,7 @@ var TableContainer = ({ children, sx, ...props }) => {
|
|
|
1140
1087
|
},
|
|
1141
1088
|
height,
|
|
1142
1089
|
...props,
|
|
1143
|
-
children: /* @__PURE__ */
|
|
1090
|
+
children: /* @__PURE__ */ jsx3(Box, { sx: (theme) => ({
|
|
1144
1091
|
flex: 1,
|
|
1145
1092
|
minHeight: 0,
|
|
1146
1093
|
height: "100%",
|
|
@@ -1166,6 +1113,13 @@ var TableContainer = ({ children, sx, ...props }) => {
|
|
|
1166
1113
|
}
|
|
1167
1114
|
);
|
|
1168
1115
|
};
|
|
1116
|
+
|
|
1117
|
+
// src/components/file/Dropzone.tsx
|
|
1118
|
+
import CloudUpload from "@mui/icons-material/CloudUpload";
|
|
1119
|
+
import { Paper, Typography as Typography3, useTheme } from "@mui/material";
|
|
1120
|
+
import { useDropzone } from "react-dropzone";
|
|
1121
|
+
import { useTranslation } from "react-i18next";
|
|
1122
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1169
1123
|
var baseStyle = {
|
|
1170
1124
|
flex: 1,
|
|
1171
1125
|
display: "flex",
|
|
@@ -1189,12 +1143,30 @@ var Dropzone = ({ sx, ...props }) => {
|
|
|
1189
1143
|
...isDragAccept ? { borderColor: theme.palette.success.main } : {},
|
|
1190
1144
|
...isDragReject ? { borderColor: theme.palette.error.main } : {}
|
|
1191
1145
|
};
|
|
1192
|
-
return /* @__PURE__ */
|
|
1193
|
-
/* @__PURE__ */
|
|
1194
|
-
/* @__PURE__ */
|
|
1195
|
-
/* @__PURE__ */
|
|
1146
|
+
return /* @__PURE__ */ jsxs2(Paper, { variant: "outlined", ...getRootProps({ style }), sx, children: [
|
|
1147
|
+
/* @__PURE__ */ jsx4("input", { ...getInputProps(), style: { display: "none" } }),
|
|
1148
|
+
/* @__PURE__ */ jsx4(CloudUpload, {}),
|
|
1149
|
+
/* @__PURE__ */ jsx4(Typography3, { children: t2("Layout.File.DragSomeFilesHereOrClickToSelectThem") })
|
|
1196
1150
|
] });
|
|
1197
1151
|
};
|
|
1152
|
+
|
|
1153
|
+
// src/components/file/FileViewer.tsx
|
|
1154
|
+
import { useState as useState5 } from "react";
|
|
1155
|
+
|
|
1156
|
+
// src/components/file/fileViewer/FileViewerGrid.tsx
|
|
1157
|
+
import MoreVert from "@mui/icons-material/MoreVert";
|
|
1158
|
+
import { Box as Box2, IconButton, ImageListItem, ImageListItemBar, Stack as Stack3, Tooltip } from "@mui/material";
|
|
1159
|
+
import { grey } from "@mui/material/colors";
|
|
1160
|
+
import { Fragment, useEffect as useEffect3, useState as useState3 } from "react";
|
|
1161
|
+
|
|
1162
|
+
// src/components/file/fileViewer/common/ActionsMenu.tsx
|
|
1163
|
+
import Delete from "@mui/icons-material/Delete";
|
|
1164
|
+
import FileDownload from "@mui/icons-material/FileDownload";
|
|
1165
|
+
import { List, ListItemButton, ListItemIcon, ListItemText, Menu } from "@mui/material";
|
|
1166
|
+
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
1167
|
+
|
|
1168
|
+
// src/contexts/FileContext.ts
|
|
1169
|
+
import { createContext, useContext } from "react";
|
|
1198
1170
|
var FileContext = createContext(null);
|
|
1199
1171
|
var useFile = () => {
|
|
1200
1172
|
const context = useContext(FileContext);
|
|
@@ -1203,18 +1175,101 @@ var useFile = () => {
|
|
|
1203
1175
|
}
|
|
1204
1176
|
return context;
|
|
1205
1177
|
};
|
|
1178
|
+
|
|
1179
|
+
// src/hooks/DialogsHooks.tsx
|
|
1180
|
+
import Button from "@mui/material/Button";
|
|
1181
|
+
import Dialog from "@mui/material/Dialog";
|
|
1182
|
+
import DialogActions from "@mui/material/DialogActions";
|
|
1183
|
+
import DialogContent from "@mui/material/DialogContent";
|
|
1184
|
+
import DialogTitle from "@mui/material/DialogTitle";
|
|
1185
|
+
|
|
1186
|
+
// node_modules/@mui/utils/esm/useEventCallback/useEventCallback.js
|
|
1187
|
+
import * as React2 from "react";
|
|
1188
|
+
|
|
1189
|
+
// node_modules/@mui/utils/esm/useEnhancedEffect/useEnhancedEffect.js
|
|
1190
|
+
import * as React from "react";
|
|
1191
|
+
var useEnhancedEffect = typeof window !== "undefined" ? React.useLayoutEffect : React.useEffect;
|
|
1192
|
+
var useEnhancedEffect_default = useEnhancedEffect;
|
|
1193
|
+
|
|
1194
|
+
// node_modules/@mui/utils/esm/useEventCallback/useEventCallback.js
|
|
1195
|
+
function useEventCallback(fn) {
|
|
1196
|
+
const ref = React2.useRef(fn);
|
|
1197
|
+
useEnhancedEffect_default(() => {
|
|
1198
|
+
ref.current = fn;
|
|
1199
|
+
});
|
|
1200
|
+
return React2.useRef((...args) => (
|
|
1201
|
+
// @ts-expect-error hide `this`
|
|
1202
|
+
(0, ref.current)(...args)
|
|
1203
|
+
)).current;
|
|
1204
|
+
}
|
|
1205
|
+
var useEventCallback_default = useEventCallback;
|
|
1206
|
+
|
|
1207
|
+
// src/hooks/DialogsHooks.tsx
|
|
1208
|
+
import { useContext as useContext2, useMemo } from "react";
|
|
1209
|
+
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
1210
|
+
|
|
1211
|
+
// src/contexts/DialogsContext.ts
|
|
1212
|
+
import { createContext as createContext2 } from "react";
|
|
1213
|
+
var DialogsContext = createContext2({});
|
|
1214
|
+
|
|
1215
|
+
// src/hooks/DialogsHooks.tsx
|
|
1216
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1217
|
+
function AlertDialog({ open, payload, onClose }) {
|
|
1218
|
+
const { t: t2 } = useTranslation2();
|
|
1219
|
+
return /* @__PURE__ */ jsxs3(Dialog, { maxWidth: "xs", fullWidth: true, open, onClose: () => onClose(), children: [
|
|
1220
|
+
/* @__PURE__ */ jsx5(DialogTitle, { children: payload.title ?? t2("Layout.Dialog.Alert") }),
|
|
1221
|
+
/* @__PURE__ */ jsx5(DialogContent, { children: payload.message }),
|
|
1222
|
+
/* @__PURE__ */ jsx5(DialogActions, { children: /* @__PURE__ */ jsx5(Button, { disabled: !open, onClick: () => onClose(), children: t2("Layout.Dialog.Confirm") }) })
|
|
1223
|
+
] });
|
|
1224
|
+
}
|
|
1225
|
+
function ConfirmDialog({ open, payload, onClose }) {
|
|
1226
|
+
const { t: t2 } = useTranslation2();
|
|
1227
|
+
return /* @__PURE__ */ jsxs3(Dialog, { maxWidth: "xs", fullWidth: true, open, onClose: () => onClose(false), children: [
|
|
1228
|
+
/* @__PURE__ */ jsx5(DialogTitle, { children: payload.title ?? t2("Layout.Dialog.Confirm") }),
|
|
1229
|
+
/* @__PURE__ */ jsx5(DialogContent, { children: payload.message }),
|
|
1230
|
+
/* @__PURE__ */ jsxs3(DialogActions, { children: [
|
|
1231
|
+
/* @__PURE__ */ jsx5(Button, { autoFocus: true, disabled: !open, onClick: () => onClose(false), children: payload.cancelText ?? t2("Layout.Dialog.Cancel") }),
|
|
1232
|
+
/* @__PURE__ */ jsx5(Button, { disabled: !open, onClick: () => onClose(true), children: t2("Layout.Dialog.Confirm") })
|
|
1233
|
+
] })
|
|
1234
|
+
] });
|
|
1235
|
+
}
|
|
1236
|
+
function useDialogs() {
|
|
1237
|
+
const { open, close } = useContext2(DialogsContext);
|
|
1238
|
+
const alert = useEventCallback_default(
|
|
1239
|
+
(message, { ...options } = {}) => open(AlertDialog, { ...options, message })
|
|
1240
|
+
);
|
|
1241
|
+
const confirm = useEventCallback_default(
|
|
1242
|
+
(message, { ...options } = {}) => open(ConfirmDialog, { ...options, message })
|
|
1243
|
+
);
|
|
1244
|
+
return useMemo(() => ({ alert, confirm, open, close }), [alert, close, confirm, open]);
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1247
|
+
// src/hooks/FileHooks.ts
|
|
1248
|
+
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
1249
|
+
import saveAs from "file-saver";
|
|
1250
|
+
import { useState as useState2 } from "react";
|
|
1251
|
+
import { Upload as TusUpload } from "tus-js-client";
|
|
1252
|
+
import { uuidv7 } from "uuidv7";
|
|
1253
|
+
|
|
1254
|
+
// src/components/core/AppTitle.tsx
|
|
1255
|
+
import { Chip, Stack as Stack2, Typography as Typography4 } from "@mui/material";
|
|
1256
|
+
import { useRouterState } from "@tanstack/react-router";
|
|
1257
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1206
1258
|
var AppTitle = () => {
|
|
1207
1259
|
const title = useAppTitle();
|
|
1208
|
-
return /* @__PURE__ */
|
|
1209
|
-
/* @__PURE__ */
|
|
1210
|
-
/* @__PURE__ */
|
|
1211
|
-
import.meta.env.DEV && /* @__PURE__ */
|
|
1260
|
+
return /* @__PURE__ */ jsxs4(Stack2, { direction: "row", alignItems: "center", spacing: 2, flexGrow: 1, children: [
|
|
1261
|
+
/* @__PURE__ */ jsx6("img", { src: "/favicon-32x32.png", alt: "app-logo", loading: "lazy" }),
|
|
1262
|
+
/* @__PURE__ */ jsx6(Typography4, { variant: "h6", children: title }),
|
|
1263
|
+
import.meta.env.DEV && /* @__PURE__ */ jsx6(Chip, { size: "small", label: "TEST", color: "info" })
|
|
1212
1264
|
] });
|
|
1213
1265
|
};
|
|
1214
1266
|
var useAppTitle = () => {
|
|
1215
1267
|
const rootRouterState = useRouterState({ select: (s) => s.matches[0] });
|
|
1216
1268
|
return rootRouterState.meta?.find((meta) => meta?.title)?.title;
|
|
1217
1269
|
};
|
|
1270
|
+
|
|
1271
|
+
// src/utils/ClientUtils.ts
|
|
1272
|
+
import axios from "axios";
|
|
1218
1273
|
var Platform = class {
|
|
1219
1274
|
static get isAndroid() {
|
|
1220
1275
|
return /android/i.test(this.userAgent);
|
|
@@ -1371,7 +1426,7 @@ var useDeleteFiles = (options) => {
|
|
|
1371
1426
|
};
|
|
1372
1427
|
var useUploadFile = ({ subId, onSuccess, onError }) => {
|
|
1373
1428
|
const appTitle = useAppTitle();
|
|
1374
|
-
const [progress, setProgress] =
|
|
1429
|
+
const [progress, setProgress] = useState2(0);
|
|
1375
1430
|
const queryClient = useQueryClient();
|
|
1376
1431
|
const mutate = async (file) => {
|
|
1377
1432
|
if (!subId) throw new Error("subId is required for file upload");
|
|
@@ -1382,7 +1437,7 @@ var useUploadFile = ({ subId, onSuccess, onError }) => {
|
|
|
1382
1437
|
subId,
|
|
1383
1438
|
fileName: file.name
|
|
1384
1439
|
};
|
|
1385
|
-
const upload = new
|
|
1440
|
+
const upload = new TusUpload(file, {
|
|
1386
1441
|
endpoint: `${BASE_URL}/v1/upload`,
|
|
1387
1442
|
chunkSize: 1048576,
|
|
1388
1443
|
// 1 MB
|
|
@@ -1393,7 +1448,7 @@ var useUploadFile = ({ subId, onSuccess, onError }) => {
|
|
|
1393
1448
|
fileName: metadata.fileName,
|
|
1394
1449
|
fileExtension: file.type
|
|
1395
1450
|
},
|
|
1396
|
-
//headers: { "Authorization": `Bearer ${await getToken()}` }, //TODO: implement token retrieval
|
|
1451
|
+
// headers: { "Authorization": `Bearer ${await getToken()}` }, //TODO: implement token retrieval
|
|
1397
1452
|
onError: (error) => {
|
|
1398
1453
|
setProgress(0);
|
|
1399
1454
|
onError?.(error);
|
|
@@ -1415,53 +1470,11 @@ var useUploadFile = ({ subId, onSuccess, onError }) => {
|
|
|
1415
1470
|
};
|
|
1416
1471
|
return { mutate, progress };
|
|
1417
1472
|
};
|
|
1418
|
-
var useEnhancedEffect = typeof window !== "undefined" ? React11.useLayoutEffect : React11.useEffect;
|
|
1419
|
-
var useEnhancedEffect_default = useEnhancedEffect;
|
|
1420
1473
|
|
|
1421
|
-
//
|
|
1422
|
-
|
|
1423
|
-
const ref = React11.useRef(fn);
|
|
1424
|
-
useEnhancedEffect_default(() => {
|
|
1425
|
-
ref.current = fn;
|
|
1426
|
-
});
|
|
1427
|
-
return React11.useRef((...args) => (
|
|
1428
|
-
// @ts-expect-error hide `this`
|
|
1429
|
-
(0, ref.current)(...args)
|
|
1430
|
-
)).current;
|
|
1431
|
-
}
|
|
1432
|
-
var useEventCallback_default = useEventCallback;
|
|
1433
|
-
var DialogsContext = createContext({});
|
|
1434
|
-
function AlertDialog({ open, payload, onClose }) {
|
|
1435
|
-
const { t: t2 } = useTranslation();
|
|
1436
|
-
return /* @__PURE__ */ jsxs(Dialog$1, { maxWidth: "xs", fullWidth: true, open, onClose: () => onClose(), children: [
|
|
1437
|
-
/* @__PURE__ */ jsx(DialogTitle, { children: payload.title ?? t2("Layout.Dialog.Alert") }),
|
|
1438
|
-
/* @__PURE__ */ jsx(DialogContent, { children: payload.message }),
|
|
1439
|
-
/* @__PURE__ */ jsx(DialogActions, { children: /* @__PURE__ */ jsx(Button$1, { disabled: !open, onClick: () => onClose(), children: t2("Layout.Dialog.Confirm") }) })
|
|
1440
|
-
] });
|
|
1441
|
-
}
|
|
1442
|
-
function ConfirmDialog({ open, payload, onClose }) {
|
|
1443
|
-
const { t: t2 } = useTranslation();
|
|
1444
|
-
return /* @__PURE__ */ jsxs(Dialog$1, { maxWidth: "xs", fullWidth: true, open, onClose: () => onClose(false), children: [
|
|
1445
|
-
/* @__PURE__ */ jsx(DialogTitle, { children: payload.title ?? t2("Layout.Dialog.Confirm") }),
|
|
1446
|
-
/* @__PURE__ */ jsx(DialogContent, { children: payload.message }),
|
|
1447
|
-
/* @__PURE__ */ jsxs(DialogActions, { children: [
|
|
1448
|
-
/* @__PURE__ */ jsx(Button$1, { autoFocus: true, disabled: !open, onClick: () => onClose(false), children: payload.cancelText ?? t2("Layout.Dialog.Cancel") }),
|
|
1449
|
-
/* @__PURE__ */ jsx(Button$1, { disabled: !open, onClick: () => onClose(true), children: t2("Layout.Dialog.Confirm") })
|
|
1450
|
-
] })
|
|
1451
|
-
] });
|
|
1452
|
-
}
|
|
1453
|
-
function useDialogs() {
|
|
1454
|
-
const { open, close } = useContext(DialogsContext);
|
|
1455
|
-
const alert = useEventCallback_default(
|
|
1456
|
-
(message, { ...options } = {}) => open(AlertDialog, { ...options, message })
|
|
1457
|
-
);
|
|
1458
|
-
const confirm = useEventCallback_default(
|
|
1459
|
-
(message, { ...options } = {}) => open(ConfirmDialog, { ...options, message })
|
|
1460
|
-
);
|
|
1461
|
-
return useMemo(() => ({ alert, confirm, open, close }), [alert, close, confirm, open]);
|
|
1462
|
-
}
|
|
1474
|
+
// src/components/file/fileViewer/common/ActionsMenu.tsx
|
|
1475
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1463
1476
|
var ActionsMenu = ({ meta, menu, setMenu }) => {
|
|
1464
|
-
const { t: t2 } =
|
|
1477
|
+
const { t: t2 } = useTranslation3();
|
|
1465
1478
|
const { fileMetas, onDelete, actions } = useFile();
|
|
1466
1479
|
const { confirm } = useDialogs();
|
|
1467
1480
|
const handleMenuClose = () => {
|
|
@@ -1483,7 +1496,7 @@ var ActionsMenu = ({ meta, menu, setMenu }) => {
|
|
|
1483
1496
|
onDelete({ remainingFileMetas, deletedFileMeta: meta });
|
|
1484
1497
|
}
|
|
1485
1498
|
};
|
|
1486
|
-
return /* @__PURE__ */
|
|
1499
|
+
return /* @__PURE__ */ jsx7(
|
|
1487
1500
|
Menu,
|
|
1488
1501
|
{
|
|
1489
1502
|
open: menu !== null,
|
|
@@ -1491,23 +1504,26 @@ var ActionsMenu = ({ meta, menu, setMenu }) => {
|
|
|
1491
1504
|
anchorReference: "anchorPosition",
|
|
1492
1505
|
variant: "menu",
|
|
1493
1506
|
anchorPosition: menu === null ? void 0 : { top: menu.mouseY, left: menu.mouseX },
|
|
1494
|
-
children: /* @__PURE__ */
|
|
1495
|
-
actions?.download !== false && /* @__PURE__ */
|
|
1496
|
-
/* @__PURE__ */
|
|
1497
|
-
/* @__PURE__ */
|
|
1507
|
+
children: /* @__PURE__ */ jsxs5(List, { disablePadding: true, children: [
|
|
1508
|
+
actions?.download !== false && /* @__PURE__ */ jsxs5(ListItemButton, { onClick: handleOnDownload, disabled: isDownloading, children: [
|
|
1509
|
+
/* @__PURE__ */ jsx7(ListItemIcon, { children: /* @__PURE__ */ jsx7(FileDownload, {}) }),
|
|
1510
|
+
/* @__PURE__ */ jsx7(ListItemText, { children: t2("Layout.File.Download") })
|
|
1498
1511
|
] }),
|
|
1499
|
-
actions?.delete !== false && /* @__PURE__ */
|
|
1500
|
-
/* @__PURE__ */
|
|
1501
|
-
/* @__PURE__ */
|
|
1512
|
+
actions?.delete !== false && /* @__PURE__ */ jsxs5(ListItemButton, { onClick: handleOnDelete, disabled: isDeleting, children: [
|
|
1513
|
+
/* @__PURE__ */ jsx7(ListItemIcon, { children: /* @__PURE__ */ jsx7(Delete, {}) }),
|
|
1514
|
+
/* @__PURE__ */ jsx7(ListItemText, { children: t2("Layout.File.Delete") })
|
|
1502
1515
|
] })
|
|
1503
1516
|
] })
|
|
1504
1517
|
}
|
|
1505
1518
|
);
|
|
1506
1519
|
};
|
|
1520
|
+
|
|
1521
|
+
// src/components/file/fileViewer/FileViewerGrid.tsx
|
|
1522
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1507
1523
|
var IMAGE_SIZE = 150;
|
|
1508
1524
|
var FileViewerGrid = ({ sx, size, itemBar }) => {
|
|
1509
1525
|
const { fileMetas } = useFile();
|
|
1510
|
-
return /* @__PURE__ */
|
|
1526
|
+
return /* @__PURE__ */ jsx8(Stack3, { direction: "row", spacing: 1, sx: { overflow: "auto", ...sx }, children: fileMetas.map((fileMeta) => /* @__PURE__ */ jsx8(
|
|
1511
1527
|
GridFileViewerItem,
|
|
1512
1528
|
{
|
|
1513
1529
|
meta: fileMeta,
|
|
@@ -1519,9 +1535,9 @@ var FileViewerGrid = ({ sx, size, itemBar }) => {
|
|
|
1519
1535
|
};
|
|
1520
1536
|
var GridFileViewerItem = ({ meta, size, itemBar }) => {
|
|
1521
1537
|
const { setImageId, actions } = useFile();
|
|
1522
|
-
const [showItemBar, setShowItemBar] =
|
|
1523
|
-
const [menu, setMenu] =
|
|
1524
|
-
|
|
1538
|
+
const [showItemBar, setShowItemBar] = useState3(itemBar === "always");
|
|
1539
|
+
const [menu, setMenu] = useState3(null);
|
|
1540
|
+
useEffect3(() => {
|
|
1525
1541
|
setShowItemBar(itemBar === "always");
|
|
1526
1542
|
}, [itemBar]);
|
|
1527
1543
|
const { data: source } = useGetFileThumbnail(meta);
|
|
@@ -1549,10 +1565,10 @@ var GridFileViewerItem = ({ meta, size, itemBar }) => {
|
|
|
1549
1565
|
}
|
|
1550
1566
|
}
|
|
1551
1567
|
};
|
|
1552
|
-
return /* @__PURE__ */
|
|
1553
|
-
/* @__PURE__ */
|
|
1554
|
-
/* @__PURE__ */
|
|
1555
|
-
|
|
1568
|
+
return /* @__PURE__ */ jsxs6(Fragment, { children: [
|
|
1569
|
+
/* @__PURE__ */ jsxs6(ImageListItem, { sx: { width: size ?? IMAGE_SIZE, height: size ?? IMAGE_SIZE }, onMouseEnter: handleOnMouseEnter, onMouseLeave: handleOnMouseLeave, children: [
|
|
1570
|
+
/* @__PURE__ */ jsx8(
|
|
1571
|
+
Box2,
|
|
1556
1572
|
{
|
|
1557
1573
|
component: "img",
|
|
1558
1574
|
src: source,
|
|
@@ -1562,21 +1578,30 @@ var GridFileViewerItem = ({ meta, size, itemBar }) => {
|
|
|
1562
1578
|
sx: { cursor: "pointer", objectFit: "contain", width: size ?? IMAGE_SIZE, height: size ?? IMAGE_SIZE }
|
|
1563
1579
|
}
|
|
1564
1580
|
),
|
|
1565
|
-
itemBar !== "hidden" && showItemBar && /* @__PURE__ */
|
|
1581
|
+
itemBar !== "hidden" && showItemBar && /* @__PURE__ */ jsx8(
|
|
1566
1582
|
ImageListItemBar,
|
|
1567
1583
|
{
|
|
1568
|
-
title: /* @__PURE__ */
|
|
1569
|
-
actionIcon: (actions?.download !== false || actions?.delete !== false) && /* @__PURE__ */
|
|
1584
|
+
title: /* @__PURE__ */ jsx8(Tooltip, { title: meta.fileName, children: /* @__PURE__ */ jsx8(Box2, { children: meta.fileName }) }),
|
|
1585
|
+
actionIcon: (actions?.download !== false || actions?.delete !== false) && /* @__PURE__ */ jsx8(IconButton, { sx: { color: grey[100] }, onClick: openMenu, children: /* @__PURE__ */ jsx8(MoreVert, {}) })
|
|
1570
1586
|
}
|
|
1571
1587
|
)
|
|
1572
1588
|
] }),
|
|
1573
|
-
(actions?.download !== false || actions?.delete !== false) && /* @__PURE__ */
|
|
1589
|
+
(actions?.download !== false || actions?.delete !== false) && /* @__PURE__ */ jsx8(ActionsMenu, { meta, menu, setMenu })
|
|
1574
1590
|
] });
|
|
1575
1591
|
};
|
|
1592
|
+
|
|
1593
|
+
// src/components/file/fileViewer/FileViewerList.tsx
|
|
1594
|
+
import AttachFile from "@mui/icons-material/AttachFile";
|
|
1595
|
+
import Image from "@mui/icons-material/Image";
|
|
1596
|
+
import MoreVert2 from "@mui/icons-material/MoreVert";
|
|
1597
|
+
import SmartDisplay from "@mui/icons-material/SmartDisplay";
|
|
1598
|
+
import { IconButton as IconButton2, List as List2, ListItemButton as ListItemButton2, ListItemIcon as ListItemIcon2, ListItemText as ListItemText2 } from "@mui/material";
|
|
1599
|
+
import { Fragment as Fragment2, useState as useState4 } from "react";
|
|
1600
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1576
1601
|
var FileViewerList = ({ sx }) => {
|
|
1577
1602
|
const { fileMetas } = useFile();
|
|
1578
|
-
return /* @__PURE__ */
|
|
1579
|
-
(fileMeta) => /* @__PURE__ */
|
|
1603
|
+
return /* @__PURE__ */ jsx9(List2, { dense: true, sx, children: fileMetas.map(
|
|
1604
|
+
(fileMeta) => /* @__PURE__ */ jsx9(
|
|
1580
1605
|
ListFileViewerItem,
|
|
1581
1606
|
{
|
|
1582
1607
|
meta: fileMeta
|
|
@@ -1587,7 +1612,7 @@ var FileViewerList = ({ sx }) => {
|
|
|
1587
1612
|
};
|
|
1588
1613
|
var ListFileViewerItem = ({ meta }) => {
|
|
1589
1614
|
const { setImageId, actions } = useFile();
|
|
1590
|
-
const [menu, setMenu] =
|
|
1615
|
+
const [menu, setMenu] = useState4(null);
|
|
1591
1616
|
const openMenu = (event) => {
|
|
1592
1617
|
event.stopPropagation();
|
|
1593
1618
|
setMenu(menu === null ? { mouseX: event.clientX, mouseY: event.clientY } : null);
|
|
@@ -1613,31 +1638,37 @@ var ListFileViewerItem = ({ meta }) => {
|
|
|
1613
1638
|
const icon = () => {
|
|
1614
1639
|
switch (meta.mediaType) {
|
|
1615
1640
|
case "image": {
|
|
1616
|
-
return /* @__PURE__ */
|
|
1641
|
+
return /* @__PURE__ */ jsx9(Image, {});
|
|
1617
1642
|
}
|
|
1618
1643
|
case "video": {
|
|
1619
|
-
return /* @__PURE__ */
|
|
1644
|
+
return /* @__PURE__ */ jsx9(SmartDisplay, {});
|
|
1620
1645
|
}
|
|
1621
1646
|
default: {
|
|
1622
|
-
return /* @__PURE__ */
|
|
1647
|
+
return /* @__PURE__ */ jsx9(AttachFile, {});
|
|
1623
1648
|
}
|
|
1624
1649
|
}
|
|
1625
1650
|
};
|
|
1626
|
-
return /* @__PURE__ */
|
|
1627
|
-
/* @__PURE__ */
|
|
1628
|
-
/* @__PURE__ */
|
|
1629
|
-
/* @__PURE__ */
|
|
1630
|
-
(actions?.download !== false || actions?.delete !== false) && /* @__PURE__ */
|
|
1651
|
+
return /* @__PURE__ */ jsxs7(Fragment2, { children: [
|
|
1652
|
+
/* @__PURE__ */ jsxs7(ListItemButton2, { onClick, children: [
|
|
1653
|
+
/* @__PURE__ */ jsx9(ListItemIcon2, { children: icon() }),
|
|
1654
|
+
/* @__PURE__ */ jsx9(ListItemText2, { primary: `${meta.fileName}.${meta.fileExtension}` }),
|
|
1655
|
+
(actions?.download !== false || actions?.delete !== false) && /* @__PURE__ */ jsx9(IconButton2, { edge: "end", onClick: openMenu, children: /* @__PURE__ */ jsx9(MoreVert2, {}) })
|
|
1631
1656
|
] }, meta.id),
|
|
1632
|
-
(actions?.download !== false || actions?.delete !== false) && /* @__PURE__ */
|
|
1657
|
+
(actions?.download !== false || actions?.delete !== false) && /* @__PURE__ */ jsx9(ActionsMenu, { meta, menu, setMenu })
|
|
1633
1658
|
] });
|
|
1634
1659
|
};
|
|
1660
|
+
|
|
1661
|
+
// src/components/file/fileViewer/ImageViewer.tsx
|
|
1662
|
+
import Close from "@mui/icons-material/Close";
|
|
1663
|
+
import { Box as Box3, Dialog as Dialog2, Fab } from "@mui/material";
|
|
1664
|
+
import { useEffect as useEffect4 } from "react";
|
|
1665
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1635
1666
|
var ImageViewer = ({ metaId }) => {
|
|
1636
1667
|
const { fileMetas, setImageId } = useFile();
|
|
1637
1668
|
const meta = fileMetas.find((m) => m.id === metaId);
|
|
1638
1669
|
const { data: source } = useGetFile(meta);
|
|
1639
|
-
|
|
1640
|
-
if (
|
|
1670
|
+
useEffect4(() => {
|
|
1671
|
+
if (metaId)
|
|
1641
1672
|
globalThis.addEventListener("keydown", handleOnKeydown);
|
|
1642
1673
|
return () => {
|
|
1643
1674
|
globalThis.removeEventListener("keydown", handleOnKeydown);
|
|
@@ -1674,21 +1705,28 @@ var ImageViewer = ({ metaId }) => {
|
|
|
1674
1705
|
};
|
|
1675
1706
|
const onClose = () => setImageId("");
|
|
1676
1707
|
if (!metaId) return null;
|
|
1677
|
-
return /* @__PURE__ */
|
|
1678
|
-
/* @__PURE__ */
|
|
1679
|
-
/* @__PURE__ */
|
|
1708
|
+
return /* @__PURE__ */ jsxs8(Dialog2, { open: true, onClose, maxWidth: "xl", children: [
|
|
1709
|
+
/* @__PURE__ */ jsx10(Box3, { component: "img", src: source, alt: metaId, sx: { maxWidth: "100vw", maxHeight: { xs: "calc(100vh - 56px)", sm: "calc(100vh - 64px)" } } }),
|
|
1710
|
+
/* @__PURE__ */ jsx10(Fab, { size: "medium", onClick: onClose, sx: { position: "fixed", top: 8, right: 8 }, children: /* @__PURE__ */ jsx10(Close, {}) })
|
|
1680
1711
|
] });
|
|
1681
1712
|
};
|
|
1713
|
+
|
|
1714
|
+
// src/components/file/FileViewer.tsx
|
|
1715
|
+
import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1682
1716
|
var FileViewer = ({ subId, onDelete, actions, children }) => {
|
|
1683
1717
|
const { data: fileMetas = [] } = useGetFileMetas(subId, { enabled: !!subId });
|
|
1684
|
-
const [imageId, setImageId] =
|
|
1718
|
+
const [imageId, setImageId] = useState5("");
|
|
1685
1719
|
const components = { Grid: FileViewerGrid, List: FileViewerList };
|
|
1686
1720
|
if (fileMetas.length === 0) return null;
|
|
1687
|
-
return /* @__PURE__ */
|
|
1721
|
+
return /* @__PURE__ */ jsxs9(FileContext.Provider, { value: { fileMetas, onDelete, actions, setImageId }, children: [
|
|
1688
1722
|
children(components),
|
|
1689
|
-
/* @__PURE__ */
|
|
1723
|
+
/* @__PURE__ */ jsx11(ImageViewer, { metaId: imageId })
|
|
1690
1724
|
] });
|
|
1691
1725
|
};
|
|
1726
|
+
|
|
1727
|
+
// src/components/data-grid/ChipInputCell.tsx
|
|
1728
|
+
import { Chip as Chip2, Stack as Stack4 } from "@mui/material";
|
|
1729
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
1692
1730
|
var isArray = (value) => Array.isArray(value);
|
|
1693
1731
|
var ChipInputCell = ({ params, slotProps, getLabel }) => {
|
|
1694
1732
|
if (!params.value) return null;
|
|
@@ -1697,71 +1735,120 @@ var ChipInputCell = ({ params, slotProps, getLabel }) => {
|
|
|
1697
1735
|
return value;
|
|
1698
1736
|
};
|
|
1699
1737
|
if (isArray(params.value))
|
|
1700
|
-
return /* @__PURE__ */
|
|
1701
|
-
(value, index) => /* @__PURE__ */
|
|
1738
|
+
return /* @__PURE__ */ jsx12(Stack4, { direction: "row", alignItems: "center", gap: 1, sx: { overflowX: "auto", height: "100%", width: params.colDef.computedWidth }, children: params.value.map(
|
|
1739
|
+
(value, index) => /* @__PURE__ */ jsx12(Chip2, { label: getLabelValue(value), ...slotProps }, `${index + 1}-chip-input-cell`)
|
|
1702
1740
|
) });
|
|
1703
|
-
return /* @__PURE__ */
|
|
1741
|
+
return /* @__PURE__ */ jsx12(Chip2, { label: getLabelValue(params.value), ...slotProps });
|
|
1704
1742
|
};
|
|
1743
|
+
|
|
1744
|
+
// src/components/data-grid/EditableColumnHeader.tsx
|
|
1745
|
+
import Edit from "@mui/icons-material/Edit";
|
|
1746
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1705
1747
|
var EditableColumnHeader = ({ colDef }) => {
|
|
1706
|
-
return /* @__PURE__ */
|
|
1748
|
+
return /* @__PURE__ */ jsx13(TypographyWithIcon, { endIcon: /* @__PURE__ */ jsx13(Edit, { color: "disabled", fontSize: "small" }), variant: "body2", className: "MuiDataGrid-columnHeaderTitle", children: colDef.headerName });
|
|
1707
1749
|
};
|
|
1708
|
-
|
|
1709
|
-
|
|
1750
|
+
|
|
1751
|
+
// src/components/router/RouterButton.tsx
|
|
1752
|
+
import { Button as Button2 } from "@mui/material";
|
|
1753
|
+
import { createLink } from "@tanstack/react-router";
|
|
1754
|
+
import React5 from "react";
|
|
1755
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
1756
|
+
var Component = React5.forwardRef(function ButtonComponent(props, reference) {
|
|
1757
|
+
return /* @__PURE__ */ jsx14(Button2, { ref: reference, component: "a", ...props });
|
|
1710
1758
|
});
|
|
1711
1759
|
var CreatedComponent = createLink(Component);
|
|
1712
1760
|
var RouterButton = (props) => {
|
|
1713
|
-
return /* @__PURE__ */
|
|
1761
|
+
return /* @__PURE__ */ jsx14(CreatedComponent, { ...props });
|
|
1714
1762
|
};
|
|
1715
|
-
|
|
1763
|
+
|
|
1764
|
+
// src/components/router/RouterGridActionsCellItem.tsx
|
|
1765
|
+
import { GridActionsCellItem } from "@mui/x-data-grid-premium";
|
|
1766
|
+
import { createLink as createLink2 } from "@tanstack/react-router";
|
|
1767
|
+
import React6 from "react";
|
|
1768
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1769
|
+
var Component2 = React6.forwardRef(
|
|
1716
1770
|
function GridActionsCellItemComponent(props, reference) {
|
|
1717
|
-
return /* @__PURE__ */
|
|
1771
|
+
return /* @__PURE__ */ jsx15(GridActionsCellItem, { ref: reference, component: "a", ...props });
|
|
1718
1772
|
}
|
|
1719
1773
|
);
|
|
1720
|
-
var CreatedComponent2 =
|
|
1774
|
+
var CreatedComponent2 = createLink2(Component2);
|
|
1721
1775
|
var RouterGridActionsCellItem = (props) => {
|
|
1722
|
-
return /* @__PURE__ */
|
|
1776
|
+
return /* @__PURE__ */ jsx15(CreatedComponent2, { ...props });
|
|
1723
1777
|
};
|
|
1724
|
-
|
|
1725
|
-
|
|
1778
|
+
|
|
1779
|
+
// src/components/router/RouterIconButton.tsx
|
|
1780
|
+
import { IconButton as IconButton3 } from "@mui/material";
|
|
1781
|
+
import { createLink as createLink3 } from "@tanstack/react-router";
|
|
1782
|
+
import React7 from "react";
|
|
1783
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1784
|
+
var Component3 = React7.forwardRef(function IconButtonComponent(props, reference) {
|
|
1785
|
+
return /* @__PURE__ */ jsx16(IconButton3, { ref: reference, component: "a", ...props });
|
|
1726
1786
|
});
|
|
1727
|
-
var CreatedComponent3 =
|
|
1787
|
+
var CreatedComponent3 = createLink3(Component3);
|
|
1728
1788
|
var RouterIconButton = (props) => {
|
|
1729
|
-
return /* @__PURE__ */
|
|
1789
|
+
return /* @__PURE__ */ jsx16(CreatedComponent3, { ...props });
|
|
1730
1790
|
};
|
|
1731
|
-
|
|
1732
|
-
|
|
1791
|
+
|
|
1792
|
+
// src/components/router/RouterLink.tsx
|
|
1793
|
+
import { Link } from "@mui/material";
|
|
1794
|
+
import { createLink as createLink4 } from "@tanstack/react-router";
|
|
1795
|
+
import React8 from "react";
|
|
1796
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1797
|
+
var Component4 = React8.forwardRef(function LinkComponent(props, reference) {
|
|
1798
|
+
return /* @__PURE__ */ jsx17(Link, { ref: reference, ...props });
|
|
1733
1799
|
});
|
|
1734
|
-
var CreatedComponent4 =
|
|
1800
|
+
var CreatedComponent4 = createLink4(Component4);
|
|
1735
1801
|
var RouterLink = (props) => {
|
|
1736
|
-
return /* @__PURE__ */
|
|
1802
|
+
return /* @__PURE__ */ jsx17(CreatedComponent4, { ...props });
|
|
1737
1803
|
};
|
|
1738
|
-
|
|
1739
|
-
|
|
1804
|
+
|
|
1805
|
+
// src/components/router/RouterTab.tsx
|
|
1806
|
+
import { Tab } from "@mui/material";
|
|
1807
|
+
import { createLink as createLink5 } from "@tanstack/react-router";
|
|
1808
|
+
import React9 from "react";
|
|
1809
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1810
|
+
var Component5 = React9.forwardRef(function TabComponent(props, reference) {
|
|
1811
|
+
return /* @__PURE__ */ jsx18(Tab, { ref: reference, component: "a", ...props });
|
|
1740
1812
|
});
|
|
1741
|
-
var CreatedComponent5 =
|
|
1813
|
+
var CreatedComponent5 = createLink5(Component5);
|
|
1742
1814
|
var RouterTab = (props) => {
|
|
1743
|
-
return /* @__PURE__ */
|
|
1815
|
+
return /* @__PURE__ */ jsx18(CreatedComponent5, { ...props });
|
|
1744
1816
|
};
|
|
1745
|
-
|
|
1746
|
-
|
|
1817
|
+
|
|
1818
|
+
// src/components/router/RouterListItemButton.tsx
|
|
1819
|
+
import { ListItemButton as ListItemButton3 } from "@mui/material";
|
|
1820
|
+
import { createLink as createLink6 } from "@tanstack/react-router";
|
|
1821
|
+
import React10 from "react";
|
|
1822
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1823
|
+
var Component6 = React10.forwardRef(function ButtonComponent2(props, reference) {
|
|
1824
|
+
return /* @__PURE__ */ jsx19(ListItemButton3, { ref: reference, component: "a", ...props });
|
|
1747
1825
|
});
|
|
1748
|
-
var CreatedComponent6 =
|
|
1826
|
+
var CreatedComponent6 = createLink6(Component6);
|
|
1749
1827
|
var RouterListItemButton = (props) => {
|
|
1750
|
-
return /* @__PURE__ */
|
|
1828
|
+
return /* @__PURE__ */ jsx19(CreatedComponent6, { ...props });
|
|
1751
1829
|
};
|
|
1830
|
+
|
|
1831
|
+
// src/components/router/RouterNotFound.tsx
|
|
1832
|
+
import { Box as Box4, Divider, Typography as Typography5 } from "@mui/material";
|
|
1833
|
+
import { useTranslation as useTranslation4 } from "react-i18next";
|
|
1834
|
+
import { jsx as jsx20, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1752
1835
|
function RouterNotFound() {
|
|
1753
|
-
const { t: t2 } =
|
|
1754
|
-
return /* @__PURE__ */
|
|
1755
|
-
/* @__PURE__ */
|
|
1756
|
-
/* @__PURE__ */
|
|
1757
|
-
/* @__PURE__ */
|
|
1836
|
+
const { t: t2 } = useTranslation4();
|
|
1837
|
+
return /* @__PURE__ */ jsx20(Box4, { height: "100vh", display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", textAlign: "center", px: 2, children: /* @__PURE__ */ jsxs10(Box4, { display: "flex", alignItems: "center", mb: 4, children: [
|
|
1838
|
+
/* @__PURE__ */ jsx20(Typography5, { variant: "h3", component: "span", fontWeight: 500, sx: { lineHeight: 1 }, children: "404" }),
|
|
1839
|
+
/* @__PURE__ */ jsx20(Divider, { orientation: "vertical", flexItem: true, sx: { mx: 3 } }),
|
|
1840
|
+
/* @__PURE__ */ jsx20(Typography5, { variant: "h5", component: "span", children: t2("Layout.ThisPageCouldNotBeFound") })
|
|
1758
1841
|
] }) });
|
|
1759
1842
|
}
|
|
1843
|
+
|
|
1844
|
+
// src/components/router/RouterError.tsx
|
|
1845
|
+
import { Box as Box5, Divider as Divider2, Typography as Typography6 } from "@mui/material";
|
|
1846
|
+
import { jsx as jsx21, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1760
1847
|
var RouterError = ({ error }) => {
|
|
1761
|
-
return /* @__PURE__ */
|
|
1762
|
-
/* @__PURE__ */
|
|
1763
|
-
/* @__PURE__ */
|
|
1764
|
-
/* @__PURE__ */
|
|
1848
|
+
return /* @__PURE__ */ jsx21(Box5, { height: "100vh", display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", textAlign: "center", px: 2, children: /* @__PURE__ */ jsxs11(Box5, { display: "flex", alignItems: "center", mb: 4, children: [
|
|
1849
|
+
/* @__PURE__ */ jsx21(Typography6, { variant: "h3", component: "span", fontWeight: 500, sx: { lineHeight: 1 }, children: error.name || "500" }),
|
|
1850
|
+
/* @__PURE__ */ jsx21(Divider2, { orientation: "vertical", flexItem: true, sx: { mx: 3 } }),
|
|
1851
|
+
/* @__PURE__ */ jsx21(Typography6, { variant: "h5", component: "span", children: error.message })
|
|
1765
1852
|
] }) });
|
|
1766
1853
|
};
|
|
1767
1854
|
|
|
@@ -1788,7 +1875,10 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
1788
1875
|
}
|
|
1789
1876
|
|
|
1790
1877
|
// node_modules/@mui/x-date-pickers/esm/LocalizationProvider/LocalizationProvider.js
|
|
1791
|
-
var import_prop_types = __toESM(require_prop_types());
|
|
1878
|
+
var import_prop_types = __toESM(require_prop_types(), 1);
|
|
1879
|
+
import * as React11 from "react";
|
|
1880
|
+
import { useThemeProps } from "@mui/material/styles";
|
|
1881
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1792
1882
|
var _excluded = ["localeText"];
|
|
1793
1883
|
var PickerAdapterContext = /* @__PURE__ */ React11.createContext(null);
|
|
1794
1884
|
if (process.env.NODE_ENV !== "production") PickerAdapterContext.displayName = "PickerAdapterContext";
|
|
@@ -1800,6 +1890,7 @@ var LocalizationProvider = function LocalizationProvider2(inProps) {
|
|
|
1800
1890
|
adapter: parentAdapter,
|
|
1801
1891
|
localeText: parentLocaleText
|
|
1802
1892
|
} = React11.useContext(PickerAdapterContext) ?? {
|
|
1893
|
+
utils: void 0,
|
|
1803
1894
|
adapter: void 0,
|
|
1804
1895
|
localeText: void 0
|
|
1805
1896
|
};
|
|
@@ -1853,7 +1944,7 @@ var LocalizationProvider = function LocalizationProvider2(inProps) {
|
|
|
1853
1944
|
localeText
|
|
1854
1945
|
};
|
|
1855
1946
|
}, [defaultDates, adapter, localeText]);
|
|
1856
|
-
return /* @__PURE__ */
|
|
1947
|
+
return /* @__PURE__ */ _jsx(PickerAdapterContext.Provider, {
|
|
1857
1948
|
value: contextValue,
|
|
1858
1949
|
children
|
|
1859
1950
|
});
|
|
@@ -1929,6 +2020,14 @@ function warnOnce(message, gravity = "warning") {
|
|
|
1929
2020
|
}
|
|
1930
2021
|
}
|
|
1931
2022
|
}
|
|
2023
|
+
|
|
2024
|
+
// node_modules/@mui/x-date-pickers/esm/AdapterDayjs/AdapterDayjs.js
|
|
2025
|
+
import dayjs from "dayjs";
|
|
2026
|
+
import weekOfYearPlugin from "dayjs/plugin/weekOfYear.js";
|
|
2027
|
+
import customParseFormatPlugin from "dayjs/plugin/customParseFormat.js";
|
|
2028
|
+
import localizedFormatPlugin from "dayjs/plugin/localizedFormat.js";
|
|
2029
|
+
import isBetweenPlugin from "dayjs/plugin/isBetween.js";
|
|
2030
|
+
import advancedFormatPlugin from "dayjs/plugin/advancedFormat.js";
|
|
1932
2031
|
dayjs.extend(localizedFormatPlugin);
|
|
1933
2032
|
dayjs.extend(weekOfYearPlugin);
|
|
1934
2033
|
dayjs.extend(isBetweenPlugin);
|
|
@@ -2410,65 +2509,143 @@ var AdapterDayjs = class {
|
|
|
2410
2509
|
return years;
|
|
2411
2510
|
};
|
|
2412
2511
|
};
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2512
|
+
|
|
2513
|
+
// src/providers/LayoutProvider.tsx
|
|
2514
|
+
import { useEffect as useEffect6, useState as useState10 } from "react";
|
|
2515
|
+
import { I18nextProvider, useTranslation as useTranslation7 } from "react-i18next";
|
|
2516
|
+
import * as z from "zod";
|
|
2517
|
+
import { cs, en } from "zod/locales";
|
|
2518
|
+
|
|
2519
|
+
// src/providers/DialogsProvider.tsx
|
|
2520
|
+
import { useCallback, useId, useMemo as useMemo3, useRef as useRef3, useState as useState6 } from "react";
|
|
2521
|
+
import { jsx as jsx22, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2522
|
+
function DialogsProvider({ children, unmountAfter = 1e3 }) {
|
|
2523
|
+
const [stack, setStack] = useState6([]);
|
|
2524
|
+
const keyPrefix = useId();
|
|
2525
|
+
const nextId = useRef3(0);
|
|
2526
|
+
const dialogMetadata = useRef3(/* @__PURE__ */ new WeakMap());
|
|
2527
|
+
const requestDialog = useEventCallback_default(function open(Component7, payload, options = {}) {
|
|
2528
|
+
const { onClose = async () => {
|
|
2529
|
+
} } = options;
|
|
2530
|
+
let resolve;
|
|
2531
|
+
const promise = new Promise((resolveImpl) => {
|
|
2532
|
+
resolve = resolveImpl;
|
|
2533
|
+
});
|
|
2534
|
+
const key = `${keyPrefix}-${nextId.current}`;
|
|
2535
|
+
nextId.current += 1;
|
|
2536
|
+
const newEntry = {
|
|
2537
|
+
key,
|
|
2538
|
+
open: true,
|
|
2539
|
+
promise,
|
|
2540
|
+
Component: Component7,
|
|
2541
|
+
payload,
|
|
2542
|
+
onClose,
|
|
2543
|
+
resolve
|
|
2544
|
+
};
|
|
2545
|
+
dialogMetadata.current.set(promise, newEntry);
|
|
2546
|
+
setStack((previousStack) => [...previousStack, newEntry]);
|
|
2547
|
+
return promise;
|
|
2548
|
+
});
|
|
2549
|
+
const removeDialogFromStack = useCallback((dialog) => {
|
|
2550
|
+
setStack((previousStack) => previousStack.filter((entry) => entry.promise !== dialog));
|
|
2551
|
+
dialogMetadata.current.delete(dialog);
|
|
2552
|
+
}, []);
|
|
2553
|
+
const closeDialogUi = useEventCallback_default(function closeDialogUi2(dialog) {
|
|
2554
|
+
setStack(
|
|
2555
|
+
(previousStack) => previousStack.map((entry) => entry.promise === dialog ? { ...entry, open: false } : entry)
|
|
2556
|
+
);
|
|
2557
|
+
setTimeout(() => removeDialogFromStack(dialog), unmountAfter);
|
|
2558
|
+
});
|
|
2559
|
+
const closeDialog = useEventCallback_default(async function closeDialog2(dialog, result) {
|
|
2560
|
+
const entryToClose = dialogMetadata.current.get(dialog);
|
|
2561
|
+
if (!entryToClose) {
|
|
2562
|
+
throw new Error("Dialog not found in stack");
|
|
2563
|
+
}
|
|
2564
|
+
try {
|
|
2565
|
+
await entryToClose.onClose(result);
|
|
2566
|
+
} finally {
|
|
2567
|
+
entryToClose.resolve(result);
|
|
2568
|
+
closeDialogUi(dialog);
|
|
2569
|
+
}
|
|
2570
|
+
return dialog;
|
|
2571
|
+
});
|
|
2572
|
+
const contextValue = useMemo3(() => ({ open: requestDialog, close: closeDialog }), [requestDialog, closeDialog]);
|
|
2573
|
+
return /* @__PURE__ */ jsxs12(DialogsContext.Provider, { value: contextValue, children: [
|
|
2574
|
+
children,
|
|
2575
|
+
stack.map(({ key, open, Component: Component7, payload, promise }) => /* @__PURE__ */ jsx22(
|
|
2576
|
+
Component7,
|
|
2577
|
+
{
|
|
2578
|
+
payload,
|
|
2579
|
+
open,
|
|
2580
|
+
onClose: async (result) => {
|
|
2581
|
+
await closeDialog(promise, result);
|
|
2582
|
+
}
|
|
2436
2583
|
},
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
};
|
|
2584
|
+
key
|
|
2585
|
+
))
|
|
2586
|
+
] });
|
|
2587
|
+
}
|
|
2588
|
+
|
|
2589
|
+
// src/utils/i18n.ts
|
|
2590
|
+
import { createIsomorphicFn } from "@tanstack/react-start";
|
|
2591
|
+
import { getCookie } from "@tanstack/react-start/server";
|
|
2592
|
+
import i18n from "i18next";
|
|
2593
|
+
import LanguageDetector from "i18next-browser-languagedetector";
|
|
2594
|
+
import HttpBackend from "i18next-http-backend";
|
|
2595
|
+
import { initReactI18next } from "react-i18next";
|
|
2596
|
+
import { default as default2 } from "i18next";
|
|
2597
|
+
var i18nCookieName = "i18nextLng";
|
|
2598
|
+
i18n.use(HttpBackend).use(LanguageDetector).use(initReactI18next).init({
|
|
2599
|
+
fallbackLng: "en",
|
|
2600
|
+
detection: {
|
|
2601
|
+
order: ["cookie"],
|
|
2602
|
+
lookupCookie: i18nCookieName,
|
|
2603
|
+
caches: ["cookie"],
|
|
2604
|
+
cookieMinutes: 60 * 24 * 365
|
|
2605
|
+
},
|
|
2606
|
+
interpolation: { escapeValue: false }
|
|
2607
|
+
});
|
|
2608
|
+
var setupRouterSsrI18nIntegration = createIsomorphicFn().server(async () => {
|
|
2609
|
+
const language = getCookie(i18nCookieName);
|
|
2610
|
+
await i18n.changeLanguage(language || "en");
|
|
2611
|
+
});
|
|
2612
|
+
|
|
2613
|
+
// src/components/core/Layout.tsx
|
|
2614
|
+
import Menu3 from "@mui/icons-material/Menu";
|
|
2615
|
+
import MenuOpen from "@mui/icons-material/MenuOpen";
|
|
2616
|
+
import { AppBar, Box as Box9, CssBaseline, IconButton as IconButton5, InitColorSchemeScript, LinearProgress, Toolbar } from "@mui/material";
|
|
2617
|
+
import { ThemeProvider, styled as styled2 } from "@mui/material/styles";
|
|
2618
|
+
import { useIsFetching, useIsMutating } from "@tanstack/react-query";
|
|
2619
|
+
import useLocalStorageState from "use-local-storage-state";
|
|
2620
|
+
|
|
2621
|
+
// src/components/core/navigation/NavigationRail.tsx
|
|
2622
|
+
import { useMediaQuery } from "@mui/material";
|
|
2623
|
+
import Box7 from "@mui/material/Box";
|
|
2624
|
+
import Drawer from "@mui/material/Drawer";
|
|
2625
|
+
import { useTheme as useTheme2 } from "@mui/material/styles";
|
|
2626
|
+
import { useNavigate, useRouterState as useRouterState2 } from "@tanstack/react-router";
|
|
2627
|
+
|
|
2628
|
+
// src/components/core/navigation/NavigationList.tsx
|
|
2629
|
+
import Divider3 from "@mui/material/Divider";
|
|
2630
|
+
import List3 from "@mui/material/List";
|
|
2631
|
+
import ListSubheader from "@mui/material/ListSubheader";
|
|
2632
|
+
import { Fragment as Fragment5, useEffect as useEffect5, useState as useState8 } from "react";
|
|
2633
|
+
|
|
2634
|
+
// src/components/core/navigation/NavigationListItem.tsx
|
|
2635
|
+
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
|
|
2636
|
+
import Avatar from "@mui/material/Avatar";
|
|
2637
|
+
import Box6 from "@mui/material/Box";
|
|
2638
|
+
import Popper from "@mui/material/Popper";
|
|
2639
|
+
import ListItem from "@mui/material/ListItem";
|
|
2640
|
+
import ListItemButton4 from "@mui/material/ListItemButton";
|
|
2641
|
+
import ListItemIcon3 from "@mui/material/ListItemIcon";
|
|
2642
|
+
import ListItemText3 from "@mui/material/ListItemText";
|
|
2643
|
+
import Paper2 from "@mui/material/Paper";
|
|
2644
|
+
import { styled } from "@mui/material/styles";
|
|
2645
|
+
import Typography7 from "@mui/material/Typography";
|
|
2646
|
+
import { Fragment as Fragment3, useMemo as useMemo4, useState as useState7 } from "react";
|
|
2647
|
+
import { Collapse } from "@mui/material";
|
|
2648
|
+
import { Fragment as Fragment4, jsx as jsx23, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2472
2649
|
var ICON_SIZE = 34;
|
|
2473
2650
|
var StyledNavButton = styled(ListItemButton4)(({ theme }) => ({
|
|
2474
2651
|
borderRadius: 8,
|
|
@@ -2512,12 +2689,12 @@ var StyledRouterButton = styled(RouterListItemButton)(({ theme }) => ({
|
|
|
2512
2689
|
}));
|
|
2513
2690
|
var IconOrAvatar = ({ item, collapsed }) => {
|
|
2514
2691
|
if (item.icon || collapsed) {
|
|
2515
|
-
return /* @__PURE__ */
|
|
2516
|
-
/* @__PURE__ */
|
|
2692
|
+
return /* @__PURE__ */ jsxs13(Box6, { sx: collapsed ? { position: "absolute", left: "50%", top: "calc(50% - 6px)", transform: "translate(-50%, -50%)" } : {}, children: [
|
|
2693
|
+
/* @__PURE__ */ jsxs13(ListItemIcon3, { sx: { display: "flex", alignItems: "center", justifyContent: "center", minWidth: ICON_SIZE }, children: [
|
|
2517
2694
|
item.icon ?? null,
|
|
2518
|
-
!item.icon && collapsed ? /* @__PURE__ */
|
|
2695
|
+
!item.icon && collapsed ? /* @__PURE__ */ jsx23(Avatar, { sx: { width: ICON_SIZE - 7, height: ICON_SIZE - 7, fontSize: 12 }, children: item.title }) : null
|
|
2519
2696
|
] }),
|
|
2520
|
-
collapsed ? /* @__PURE__ */
|
|
2697
|
+
collapsed ? /* @__PURE__ */ jsx23(
|
|
2521
2698
|
Typography7,
|
|
2522
2699
|
{
|
|
2523
2700
|
variant: "caption",
|
|
@@ -2541,7 +2718,7 @@ var IconOrAvatar = ({ item, collapsed }) => {
|
|
|
2541
2718
|
}
|
|
2542
2719
|
return null;
|
|
2543
2720
|
};
|
|
2544
|
-
var MiniPopover = ({ open, anchorEl, children }) => /* @__PURE__ */
|
|
2721
|
+
var MiniPopover = ({ open, anchorEl, children }) => /* @__PURE__ */ jsx23(
|
|
2545
2722
|
Popper,
|
|
2546
2723
|
{
|
|
2547
2724
|
open,
|
|
@@ -2552,7 +2729,7 @@ var MiniPopover = ({ open, anchorEl, children }) => /* @__PURE__ */ jsx(
|
|
|
2552
2729
|
{ name: "preventOverflow", options: { padding: 8 } },
|
|
2553
2730
|
{ name: "flip", options: { fallbackPlacements: ["right-end", "left-start"] } }
|
|
2554
2731
|
],
|
|
2555
|
-
children: /* @__PURE__ */
|
|
2732
|
+
children: /* @__PURE__ */ jsx23(
|
|
2556
2733
|
Paper2,
|
|
2557
2734
|
{
|
|
2558
2735
|
sx: {
|
|
@@ -2568,9 +2745,9 @@ var MiniPopover = ({ open, anchorEl, children }) => /* @__PURE__ */ jsx(
|
|
|
2568
2745
|
}
|
|
2569
2746
|
);
|
|
2570
2747
|
var NavigationListItem = ({ item, isOpen, selected, disabled, collapsed, isSidebarFullyExpanded = true, isSidebarFullyCollapsed, onClick, renderNested }) => {
|
|
2571
|
-
const [hoveredPopoverItem, setHoveredPopoverItem] =
|
|
2572
|
-
const [anchorElement, setAnchorElement] =
|
|
2573
|
-
const chevronSx =
|
|
2748
|
+
const [hoveredPopoverItem, setHoveredPopoverItem] = useState7(null);
|
|
2749
|
+
const [anchorElement, setAnchorElement] = useState7(null);
|
|
2750
|
+
const chevronSx = useMemo4(() => {
|
|
2574
2751
|
if (collapsed && isSidebarFullyCollapsed && item.children) {
|
|
2575
2752
|
return {
|
|
2576
2753
|
fontSize: 18,
|
|
@@ -2594,9 +2771,9 @@ var NavigationListItem = ({ item, isOpen, selected, disabled, collapsed, isSideb
|
|
|
2594
2771
|
disabled,
|
|
2595
2772
|
sx: { px: 1.4, height: collapsed ? 60 : 48 }
|
|
2596
2773
|
};
|
|
2597
|
-
const buttonContent = /* @__PURE__ */
|
|
2598
|
-
/* @__PURE__ */
|
|
2599
|
-
!collapsed && /* @__PURE__ */
|
|
2774
|
+
const buttonContent = /* @__PURE__ */ jsxs13(Fragment4, { children: [
|
|
2775
|
+
/* @__PURE__ */ jsx23(IconOrAvatar, { item, collapsed }),
|
|
2776
|
+
!collapsed && /* @__PURE__ */ jsx23(
|
|
2600
2777
|
ListItemText3,
|
|
2601
2778
|
{
|
|
2602
2779
|
primary: item.title,
|
|
@@ -2604,10 +2781,10 @@ var NavigationListItem = ({ item, isOpen, selected, disabled, collapsed, isSideb
|
|
|
2604
2781
|
sx: { ml: 1.2, flex: 1, minWidth: 0, "& .MuiTypography-root": { whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" } }
|
|
2605
2782
|
}
|
|
2606
2783
|
),
|
|
2607
|
-
item.children ? /* @__PURE__ */
|
|
2784
|
+
item.children ? /* @__PURE__ */ jsx23(ExpandMoreIcon, { sx: chevronSx }) : null
|
|
2608
2785
|
] });
|
|
2609
|
-
const listItem = /* @__PURE__ */
|
|
2610
|
-
ListItem
|
|
2786
|
+
const listItem = /* @__PURE__ */ jsxs13(
|
|
2787
|
+
ListItem,
|
|
2611
2788
|
{
|
|
2612
2789
|
...item.children && collapsed ? {
|
|
2613
2790
|
onMouseEnter: (event) => {
|
|
@@ -2620,7 +2797,7 @@ var NavigationListItem = ({ item, isOpen, selected, disabled, collapsed, isSideb
|
|
|
2620
2797
|
} : {},
|
|
2621
2798
|
sx: { py: 0, px: 1, overflowX: "hidden" },
|
|
2622
2799
|
children: [
|
|
2623
|
-
shouldJustExpand ? /* @__PURE__ */
|
|
2800
|
+
shouldJustExpand ? /* @__PURE__ */ jsx23(StyledNavButton, { ...buttonProps, onClick: () => onClick?.(item), children: buttonContent }) : /* @__PURE__ */ jsx23(
|
|
2624
2801
|
StyledRouterButton,
|
|
2625
2802
|
{
|
|
2626
2803
|
...buttonProps,
|
|
@@ -2631,25 +2808,28 @@ var NavigationListItem = ({ item, isOpen, selected, disabled, collapsed, isSideb
|
|
|
2631
2808
|
children: buttonContent
|
|
2632
2809
|
}
|
|
2633
2810
|
),
|
|
2634
|
-
item.children && collapsed ? /* @__PURE__ */
|
|
2811
|
+
item.children && collapsed ? /* @__PURE__ */ jsx23(MiniPopover, { open: item.title === hoveredPopoverItem, anchorEl: anchorElement, children: renderNested?.(item.children) }) : null
|
|
2635
2812
|
]
|
|
2636
2813
|
}
|
|
2637
2814
|
);
|
|
2638
|
-
return /* @__PURE__ */
|
|
2815
|
+
return /* @__PURE__ */ jsxs13(Fragment3, { children: [
|
|
2639
2816
|
listItem,
|
|
2640
|
-
item.children && !collapsed ? /* @__PURE__ */
|
|
2817
|
+
item.children && !collapsed ? /* @__PURE__ */ jsx23(Collapse, { in: isOpen, timeout: "auto", unmountOnExit: true, children: renderNested?.(item.children) }) : null
|
|
2641
2818
|
] }, item.to);
|
|
2642
2819
|
};
|
|
2820
|
+
|
|
2821
|
+
// src/components/core/navigation/NavigationList.tsx
|
|
2822
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
2643
2823
|
var isPageItem = (item) => !("kind" in item);
|
|
2644
2824
|
var isDivider = (item) => "kind" in item && item.kind === "divider";
|
|
2645
2825
|
var isHeader = (item) => "kind" in item && item.kind === "header";
|
|
2646
2826
|
var NavigationList = ({ subNavigation, depth = 0, collapsed, isPopover, isSidebarFullyExpanded = true, isSidebarFullyCollapsed, expandedWidth, renderItem, activePath, onNavigate }) => {
|
|
2647
|
-
const [openKeys, setOpenKeys] =
|
|
2648
|
-
|
|
2827
|
+
const [openKeys, setOpenKeys] = useState8([]);
|
|
2828
|
+
useEffect5(() => {
|
|
2649
2829
|
if (collapsed) setOpenKeys([]);
|
|
2650
2830
|
}, [collapsed]);
|
|
2651
2831
|
const toggleKey = (key) => setOpenKeys((previous) => previous.includes(key) ? previous.filter((k) => k !== key) : [...previous, key]);
|
|
2652
|
-
const renderNested = (children) => /* @__PURE__ */
|
|
2832
|
+
const renderNested = (children) => /* @__PURE__ */ jsx24(
|
|
2653
2833
|
NavigationList,
|
|
2654
2834
|
{
|
|
2655
2835
|
subNavigation: children,
|
|
@@ -2661,7 +2841,7 @@ var NavigationList = ({ subNavigation, depth = 0, collapsed, isPopover, isSideba
|
|
|
2661
2841
|
}
|
|
2662
2842
|
);
|
|
2663
2843
|
const filteredNavigation = subNavigation.filter((nav) => !nav.hidden);
|
|
2664
|
-
return /* @__PURE__ */
|
|
2844
|
+
return /* @__PURE__ */ jsx24(
|
|
2665
2845
|
List3,
|
|
2666
2846
|
{
|
|
2667
2847
|
sx: {
|
|
@@ -2674,8 +2854,8 @@ var NavigationList = ({ subNavigation, depth = 0, collapsed, isPopover, isSideba
|
|
|
2674
2854
|
},
|
|
2675
2855
|
children: filteredNavigation.map((navItem, index) => {
|
|
2676
2856
|
if (isHeader(navItem)) {
|
|
2677
|
-
return /* @__PURE__ */
|
|
2678
|
-
ListSubheader
|
|
2857
|
+
return /* @__PURE__ */ jsx24(
|
|
2858
|
+
ListSubheader,
|
|
2679
2859
|
{
|
|
2680
2860
|
sx: {
|
|
2681
2861
|
fontSize: 12,
|
|
@@ -2697,13 +2877,13 @@ var NavigationList = ({ subNavigation, depth = 0, collapsed, isPopover, isSideba
|
|
|
2697
2877
|
}
|
|
2698
2878
|
if (isDivider(navItem)) {
|
|
2699
2879
|
const nextItem = filteredNavigation[index + 1];
|
|
2700
|
-
return /* @__PURE__ */
|
|
2880
|
+
return /* @__PURE__ */ jsx24("li", { children: /* @__PURE__ */ jsx24(Divider3, { sx: { mx: 1, mt: 1, mb: isHeader(nextItem) && !collapsed ? 0 : 1 } }) }, `divider-${depth}-${index}`);
|
|
2701
2881
|
}
|
|
2702
2882
|
if (!isPageItem(navItem)) return null;
|
|
2703
2883
|
const key = `item-${depth}-${index}`;
|
|
2704
2884
|
const uniqueItemKey = `${depth}-${index}-${navItem.title}`;
|
|
2705
|
-
if (renderItem) return /* @__PURE__ */
|
|
2706
|
-
return /* @__PURE__ */
|
|
2885
|
+
if (renderItem) return /* @__PURE__ */ jsx24(Fragment5, { children: renderItem(navItem, { collapsed: !!collapsed }) }, key);
|
|
2886
|
+
return /* @__PURE__ */ jsx24(
|
|
2707
2887
|
NavigationListItem,
|
|
2708
2888
|
{
|
|
2709
2889
|
item: navItem,
|
|
@@ -2721,16 +2901,19 @@ var NavigationList = ({ subNavigation, depth = 0, collapsed, isPopover, isSideba
|
|
|
2721
2901
|
}
|
|
2722
2902
|
);
|
|
2723
2903
|
};
|
|
2904
|
+
|
|
2905
|
+
// src/components/core/navigation/NavigationRail.tsx
|
|
2906
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
2724
2907
|
var MINI_WIDTH = 84;
|
|
2725
2908
|
var EXPANDED_WIDTH = 320;
|
|
2726
2909
|
var TOOLBAR_HEIGHT = 65;
|
|
2727
2910
|
var NavigationRail = ({ navigation, expanded, setExpanded }) => {
|
|
2728
2911
|
const navigate = useNavigate();
|
|
2729
|
-
const routerState =
|
|
2730
|
-
const theme =
|
|
2912
|
+
const routerState = useRouterState2();
|
|
2913
|
+
const theme = useTheme2();
|
|
2731
2914
|
const showPermanent = useMediaQuery(theme.breakpoints.up("sm"));
|
|
2732
|
-
const drawerContent = (collapsed) => /* @__PURE__ */
|
|
2733
|
-
|
|
2915
|
+
const drawerContent = (collapsed) => /* @__PURE__ */ jsx25(
|
|
2916
|
+
Box7,
|
|
2734
2917
|
{
|
|
2735
2918
|
component: "nav",
|
|
2736
2919
|
sx: {
|
|
@@ -2743,7 +2926,7 @@ var NavigationRail = ({ navigation, expanded, setExpanded }) => {
|
|
|
2743
2926
|
overflowX: "hidden",
|
|
2744
2927
|
pt: navigation[0] && isHeader(navigation[0]) && !collapsed ? 0 : 2
|
|
2745
2928
|
},
|
|
2746
|
-
children: /* @__PURE__ */
|
|
2929
|
+
children: /* @__PURE__ */ jsx25(
|
|
2747
2930
|
NavigationList,
|
|
2748
2931
|
{
|
|
2749
2932
|
subNavigation: navigation,
|
|
@@ -2758,7 +2941,7 @@ var NavigationRail = ({ navigation, expanded, setExpanded }) => {
|
|
|
2758
2941
|
}
|
|
2759
2942
|
);
|
|
2760
2943
|
if (showPermanent)
|
|
2761
|
-
return /* @__PURE__ */
|
|
2944
|
+
return /* @__PURE__ */ jsx25(
|
|
2762
2945
|
Drawer,
|
|
2763
2946
|
{
|
|
2764
2947
|
variant: "permanent",
|
|
@@ -2774,26 +2957,48 @@ var NavigationRail = ({ navigation, expanded, setExpanded }) => {
|
|
|
2774
2957
|
children: drawerContent(!expanded)
|
|
2775
2958
|
}
|
|
2776
2959
|
);
|
|
2777
|
-
return /* @__PURE__ */
|
|
2960
|
+
return /* @__PURE__ */ jsx25(Drawer, { open: expanded, onClose: () => setExpanded(false), children: drawerContent(!expanded) });
|
|
2778
2961
|
};
|
|
2779
|
-
|
|
2962
|
+
|
|
2963
|
+
// src/components/core/ToolbarAccount.tsx
|
|
2964
|
+
import AccountCircle from "@mui/icons-material/AccountCircle";
|
|
2965
|
+
import ArrowBack from "@mui/icons-material/ArrowBack";
|
|
2966
|
+
import Brightness4 from "@mui/icons-material/Brightness4";
|
|
2967
|
+
import ChevronRight from "@mui/icons-material/ChevronRight";
|
|
2968
|
+
import DarkMode from "@mui/icons-material/DarkMode";
|
|
2969
|
+
import LightMode from "@mui/icons-material/LightMode";
|
|
2970
|
+
import Login from "@mui/icons-material/Login";
|
|
2971
|
+
import Logout from "@mui/icons-material/Logout";
|
|
2972
|
+
import SettingsBrightness from "@mui/icons-material/SettingsBrightness";
|
|
2973
|
+
import Translate from "@mui/icons-material/Translate";
|
|
2974
|
+
import { Avatar as Avatar2, Box as Box8, IconButton as IconButton4, List as List4, ListItem as ListItem2, ListItemButton as ListItemButton5, ListItemIcon as ListItemIcon4, ListItemText as ListItemText4, ListSubheader as ListSubheader2, Menu as Menu2, Typography as Typography8, useColorScheme } from "@mui/material";
|
|
2975
|
+
import { Fragment as Fragment6, useState as useState9 } from "react";
|
|
2976
|
+
import { useTranslation as useTranslation5 } from "react-i18next";
|
|
2977
|
+
|
|
2978
|
+
// src/auth-test/keycloak.ts
|
|
2979
|
+
import { useRouter } from "@tanstack/react-router";
|
|
2980
|
+
import Keycloak from "keycloak-js";
|
|
2981
|
+
var keycloakConfig = {
|
|
2780
2982
|
url: import.meta.env.VITE_KEYCLOAK_URL,
|
|
2781
2983
|
realm: import.meta.env.VITE_KEYCLOAK_REALM,
|
|
2782
2984
|
clientId: import.meta.env.VITE_KEYCLOAK_CLIENT_ID,
|
|
2783
2985
|
idpHint: import.meta.env.VITE_KEYCLOAK_IDP_HINT,
|
|
2784
2986
|
confidentialClientId: import.meta.env.VITE_KEYCLOAK_CONFIDENTIAL_CLIENT_ID,
|
|
2785
2987
|
confidentialClientSecret: import.meta.env.VITE_KEYCLOAK_CONFIDENTIAL_CLIENT_SECRET
|
|
2786
|
-
}
|
|
2988
|
+
};
|
|
2787
2989
|
function useKeycloak() {
|
|
2788
2990
|
const routerContext = useRouter();
|
|
2789
2991
|
const keycloak = routerContext.options.context.keycloak;
|
|
2790
2992
|
return keycloak;
|
|
2791
2993
|
}
|
|
2994
|
+
|
|
2995
|
+
// src/components/core/ToolbarAccount.tsx
|
|
2996
|
+
import { jsx as jsx26, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2792
2997
|
var ToolbarAccount = () => {
|
|
2793
|
-
const [anchorElement, setAnchorElement] =
|
|
2794
|
-
const [tab, setTab] =
|
|
2998
|
+
const [anchorElement, setAnchorElement] = useState9();
|
|
2999
|
+
const [tab, setTab] = useState9("settings");
|
|
2795
3000
|
const open = Boolean(anchorElement);
|
|
2796
|
-
const { t: t2, i18n: i18n2 } =
|
|
3001
|
+
const { t: t2, i18n: i18n2 } = useTranslation5();
|
|
2797
3002
|
const { mode, setMode } = useColorScheme();
|
|
2798
3003
|
const changeLanguage = (newLanguage) => () => {
|
|
2799
3004
|
i18n2.changeLanguage(newLanguage).finally(() => closeMenu());
|
|
@@ -2828,60 +3033,60 @@ var ToolbarAccount = () => {
|
|
|
2828
3033
|
setTimeout(() => setTab("settings"), 300);
|
|
2829
3034
|
};
|
|
2830
3035
|
const changeTab = (newTab) => () => setTab(newTab);
|
|
2831
|
-
const settings = /* @__PURE__ */
|
|
2832
|
-
/* @__PURE__ */
|
|
2833
|
-
/* @__PURE__ */
|
|
2834
|
-
/* @__PURE__ */
|
|
2835
|
-
/* @__PURE__ */
|
|
3036
|
+
const settings = /* @__PURE__ */ jsxs14(List4, { component: "nav", subheader: /* @__PURE__ */ jsx26(ListSubheader2, { sx: { backgroundColor: "transparent" }, children: t2("Layout.Settings") }), children: [
|
|
3037
|
+
/* @__PURE__ */ jsxs14(ListItemButton5, { onClick: changeTab("theme"), sx: { py: 0.3 }, children: [
|
|
3038
|
+
/* @__PURE__ */ jsx26(ListItemIcon4, { children: /* @__PURE__ */ jsx26(Brightness4, {}) }),
|
|
3039
|
+
/* @__PURE__ */ jsx26(ListItemText4, { primary: t2("Layout.Appearance"), secondary: getModeText() }),
|
|
3040
|
+
/* @__PURE__ */ jsx26(ChevronRight, {})
|
|
2836
3041
|
] }),
|
|
2837
|
-
/* @__PURE__ */
|
|
2838
|
-
/* @__PURE__ */
|
|
2839
|
-
/* @__PURE__ */
|
|
2840
|
-
/* @__PURE__ */
|
|
3042
|
+
/* @__PURE__ */ jsxs14(ListItemButton5, { onClick: changeTab("language"), sx: { py: 0.3 }, children: [
|
|
3043
|
+
/* @__PURE__ */ jsx26(ListItemIcon4, { children: /* @__PURE__ */ jsx26(Translate, {}) }),
|
|
3044
|
+
/* @__PURE__ */ jsx26(ListItemText4, { primary: t2("Layout.Language"), secondary: i18n2.resolvedLanguage === "en" ? "English" : "\u010Ce\u0161tina" }),
|
|
3045
|
+
/* @__PURE__ */ jsx26(ChevronRight, {})
|
|
2841
3046
|
] })
|
|
2842
3047
|
] });
|
|
2843
|
-
const theme = /* @__PURE__ */
|
|
2844
|
-
/* @__PURE__ */
|
|
3048
|
+
const theme = /* @__PURE__ */ jsxs14(List4, { subheader: /* @__PURE__ */ jsxs14(ListSubheader2, { onClick: changeTab("settings"), sx: { backgroundColor: "transparent", display: "flex", alignItems: "center", px: 1, cursor: "pointer" }, children: [
|
|
3049
|
+
/* @__PURE__ */ jsx26(IconButton4, { size: "small", sx: { mr: 0.5 }, children: /* @__PURE__ */ jsx26(ArrowBack, { fontSize: "small" }) }),
|
|
2845
3050
|
" ",
|
|
2846
3051
|
t2("Layout.Appearance")
|
|
2847
3052
|
] }), children: [
|
|
2848
|
-
/* @__PURE__ */
|
|
2849
|
-
/* @__PURE__ */
|
|
2850
|
-
/* @__PURE__ */
|
|
3053
|
+
/* @__PURE__ */ jsxs14(ListItemButton5, { onClick: changeMode("light"), disabled: mode === "light", children: [
|
|
3054
|
+
/* @__PURE__ */ jsx26(ListItemIcon4, { children: /* @__PURE__ */ jsx26(LightMode, {}) }),
|
|
3055
|
+
/* @__PURE__ */ jsx26(ListItemText4, { primary: t2("Layout.Light") })
|
|
2851
3056
|
] }),
|
|
2852
|
-
/* @__PURE__ */
|
|
2853
|
-
/* @__PURE__ */
|
|
2854
|
-
/* @__PURE__ */
|
|
3057
|
+
/* @__PURE__ */ jsxs14(ListItemButton5, { onClick: changeMode("dark"), disabled: mode === "dark", children: [
|
|
3058
|
+
/* @__PURE__ */ jsx26(ListItemIcon4, { children: /* @__PURE__ */ jsx26(DarkMode, {}) }),
|
|
3059
|
+
/* @__PURE__ */ jsx26(ListItemText4, { primary: t2("Layout.Dark") })
|
|
2855
3060
|
] }),
|
|
2856
|
-
/* @__PURE__ */
|
|
2857
|
-
/* @__PURE__ */
|
|
2858
|
-
/* @__PURE__ */
|
|
3061
|
+
/* @__PURE__ */ jsxs14(ListItemButton5, { onClick: changeMode("system"), disabled: mode === "system", children: [
|
|
3062
|
+
/* @__PURE__ */ jsx26(ListItemIcon4, { children: /* @__PURE__ */ jsx26(SettingsBrightness, {}) }),
|
|
3063
|
+
/* @__PURE__ */ jsx26(ListItemText4, { primary: t2("Layout.System") })
|
|
2859
3064
|
] })
|
|
2860
3065
|
] });
|
|
2861
|
-
const language = /* @__PURE__ */
|
|
2862
|
-
/* @__PURE__ */
|
|
3066
|
+
const language = /* @__PURE__ */ jsxs14(List4, { subheader: /* @__PURE__ */ jsxs14(ListSubheader2, { onClick: changeTab("settings"), sx: { backgroundColor: "transparent", display: "flex", alignItems: "center", px: 1, cursor: "pointer" }, children: [
|
|
3067
|
+
/* @__PURE__ */ jsx26(IconButton4, { size: "small", sx: { mr: 0.5 }, children: /* @__PURE__ */ jsx26(ArrowBack, { fontSize: "small" }) }),
|
|
2863
3068
|
" ",
|
|
2864
3069
|
t2("Layout.Language")
|
|
2865
3070
|
] }), children: [
|
|
2866
|
-
/* @__PURE__ */
|
|
2867
|
-
/* @__PURE__ */
|
|
3071
|
+
/* @__PURE__ */ jsx26(ListItemButton5, { onClick: changeLanguage("en"), disabled: i18n2.resolvedLanguage === "en", children: /* @__PURE__ */ jsx26(ListItemText4, { primary: "English" }) }),
|
|
3072
|
+
/* @__PURE__ */ jsx26(ListItemButton5, { onClick: changeLanguage("cs"), disabled: i18n2.resolvedLanguage === "cs", children: /* @__PURE__ */ jsx26(ListItemText4, { primary: "\u010Ce\u0161tina" }) })
|
|
2868
3073
|
] });
|
|
2869
|
-
return /* @__PURE__ */
|
|
2870
|
-
/* @__PURE__ */
|
|
2871
|
-
/* @__PURE__ */
|
|
2872
|
-
/* @__PURE__ */
|
|
2873
|
-
/* @__PURE__ */
|
|
2874
|
-
/* @__PURE__ */
|
|
2875
|
-
/* @__PURE__ */
|
|
2876
|
-
/* @__PURE__ */
|
|
3074
|
+
return /* @__PURE__ */ jsxs14(Fragment6, { children: [
|
|
3075
|
+
/* @__PURE__ */ jsx26(IconButton4, { size: "small", edge: "end", onClick: openMenu, children: user?.name ? /* @__PURE__ */ jsx26(Avatar2, { sx: { width: { xs: 32, sm: 40 }, height: { xs: 32, sm: 40 }, bgcolor: "primary.main" }, children: /* @__PURE__ */ jsx26(Typography8, { variant: "subtitle2", sx: { fontWeight: "bold", lineHeight: 0 }, children: usernameInitials() }) }) : /* @__PURE__ */ jsx26(AccountCircle, { fontSize: "large" }) }),
|
|
3076
|
+
/* @__PURE__ */ jsx26(Menu2, { anchorEl: anchorElement, open, onClose: closeMenu, children: /* @__PURE__ */ jsxs14(Box8, { sx: { width: 240 }, children: [
|
|
3077
|
+
/* @__PURE__ */ jsx26(List4, { children: user?.name ? /* @__PURE__ */ jsxs14(Fragment6, { children: [
|
|
3078
|
+
/* @__PURE__ */ jsx26(ListItem2, { children: /* @__PURE__ */ jsx26(ListItemText4, { primary: user.name, secondary: /* @__PURE__ */ jsxs14("span", { children: [
|
|
3079
|
+
/* @__PURE__ */ jsx26("span", { children: user.employeeId }),
|
|
3080
|
+
/* @__PURE__ */ jsx26("br", {}),
|
|
3081
|
+
/* @__PURE__ */ jsx26("span", { children: user.department })
|
|
2877
3082
|
] }) }) }),
|
|
2878
|
-
/* @__PURE__ */
|
|
2879
|
-
/* @__PURE__ */
|
|
2880
|
-
/* @__PURE__ */
|
|
3083
|
+
/* @__PURE__ */ jsxs14(ListItemButton5, { onClick: () => keycloak.logout(), children: [
|
|
3084
|
+
/* @__PURE__ */ jsx26(ListItemIcon4, { children: /* @__PURE__ */ jsx26(Logout, { color: "error" }) }),
|
|
3085
|
+
/* @__PURE__ */ jsx26(ListItemText4, { primary: t2("Layout.Logout") })
|
|
2881
3086
|
] })
|
|
2882
|
-
] }) : /* @__PURE__ */
|
|
2883
|
-
/* @__PURE__ */
|
|
2884
|
-
/* @__PURE__ */
|
|
3087
|
+
] }) : /* @__PURE__ */ jsxs14(ListItemButton5, { onClick: () => keycloak.login(), children: [
|
|
3088
|
+
/* @__PURE__ */ jsx26(ListItemIcon4, { children: /* @__PURE__ */ jsx26(Login, { color: "success" }) }),
|
|
3089
|
+
/* @__PURE__ */ jsx26(ListItemText4, { primary: t2("Layout.LogIn") })
|
|
2885
3090
|
] }) }),
|
|
2886
3091
|
tab === "settings" && settings,
|
|
2887
3092
|
tab === "theme" && theme,
|
|
@@ -2889,7 +3094,77 @@ var ToolbarAccount = () => {
|
|
|
2889
3094
|
] }) })
|
|
2890
3095
|
] });
|
|
2891
3096
|
};
|
|
2892
|
-
|
|
3097
|
+
|
|
3098
|
+
// src/hooks/ThemeHook.ts
|
|
3099
|
+
import { createTheme, darken, lighten } from "@mui/material";
|
|
3100
|
+
import { grey as grey2 } from "@mui/material/colors";
|
|
3101
|
+
import { csCZ, enUS } from "@mui/material/locale";
|
|
3102
|
+
import { csCZ as dataGridCsCz, enUS as dataGridEnUs } from "@mui/x-data-grid-premium/locales";
|
|
3103
|
+
import { csCZ as datePickersCsCz, enUS as datePickersEnUs } from "@mui/x-date-pickers-pro/locales";
|
|
3104
|
+
import { useTranslation as useTranslation6 } from "react-i18next";
|
|
3105
|
+
var WISTRON_PRIMARY_COLOR = "#00506E";
|
|
3106
|
+
var WISTRON_SECONDARY_COLOR = "#64DC00";
|
|
3107
|
+
var useGetTheme = (theme) => {
|
|
3108
|
+
const { i18n: i18n2 } = useTranslation6();
|
|
3109
|
+
return createTheme(
|
|
3110
|
+
{
|
|
3111
|
+
cssVariables: {
|
|
3112
|
+
colorSchemeSelector: "data-mui-color-scheme"
|
|
3113
|
+
},
|
|
3114
|
+
colorSchemes: {
|
|
3115
|
+
light: {
|
|
3116
|
+
palette: {
|
|
3117
|
+
primary: { main: WISTRON_PRIMARY_COLOR },
|
|
3118
|
+
secondary: { main: WISTRON_SECONDARY_COLOR }
|
|
3119
|
+
}
|
|
3120
|
+
},
|
|
3121
|
+
dark: {
|
|
3122
|
+
palette: {
|
|
3123
|
+
primary: { main: lighten(WISTRON_PRIMARY_COLOR, 0.5) },
|
|
3124
|
+
secondary: { main: darken(WISTRON_SECONDARY_COLOR, 0.5) }
|
|
3125
|
+
}
|
|
3126
|
+
},
|
|
3127
|
+
...theme?.colorSchemes
|
|
3128
|
+
},
|
|
3129
|
+
components: {
|
|
3130
|
+
MuiCssBaseline: {
|
|
3131
|
+
styleOverrides: (theme2) => {
|
|
3132
|
+
return {
|
|
3133
|
+
body: {
|
|
3134
|
+
"&::-webkit-scrollbar, & *::-webkit-scrollbar": {
|
|
3135
|
+
width: "0.7em",
|
|
3136
|
+
height: "0.7em"
|
|
3137
|
+
},
|
|
3138
|
+
"&::-webkit-scrollbar-track, & *::-webkit-scrollbar-track": {
|
|
3139
|
+
backgroundColor: theme2.palette.mode === "dark" ? grey2[900] : grey2[200],
|
|
3140
|
+
borderRadius: "5px"
|
|
3141
|
+
},
|
|
3142
|
+
"&::-webkit-scrollbar-thumb, & *::-webkit-scrollbar-thumb": {
|
|
3143
|
+
backgroundColor: theme2.palette.mode === "dark" ? grey2[800] : grey2[400],
|
|
3144
|
+
borderRadius: "10px"
|
|
3145
|
+
},
|
|
3146
|
+
"&::-webkit-scrollbar-thumb:hover, & *::-webkit-scrollbar-thumb:hover": {
|
|
3147
|
+
backgroundColor: theme2.palette.mode === "dark" ? grey2[700] : grey2[500]
|
|
3148
|
+
},
|
|
3149
|
+
"&::-webkit-scrollbar-corner, & *::-webkit-scrollbar-corner": {
|
|
3150
|
+
backgroundColor: "transparent"
|
|
3151
|
+
}
|
|
3152
|
+
}
|
|
3153
|
+
};
|
|
3154
|
+
}
|
|
3155
|
+
},
|
|
3156
|
+
...theme?.components
|
|
3157
|
+
}
|
|
3158
|
+
},
|
|
3159
|
+
i18n2.resolvedLanguage === "cs" ? datePickersCsCz : datePickersEnUs,
|
|
3160
|
+
i18n2.resolvedLanguage === "cs" ? dataGridCsCz : dataGridEnUs,
|
|
3161
|
+
i18n2.resolvedLanguage === "cs" ? csCZ : enUS
|
|
3162
|
+
);
|
|
3163
|
+
};
|
|
3164
|
+
|
|
3165
|
+
// src/components/core/Layout.tsx
|
|
3166
|
+
import { jsx as jsx27, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3167
|
+
var DrawerHeader = styled2("div")(({ theme }) => ({
|
|
2893
3168
|
display: "flex",
|
|
2894
3169
|
alignItems: "center",
|
|
2895
3170
|
justifyContent: "flex-end",
|
|
@@ -2901,11 +3176,11 @@ var Layout = (props) => {
|
|
|
2901
3176
|
const [navigationOpen, setNavigationOpen] = useLocalStorageState("navigationOpen", { defaultServerValue: false });
|
|
2902
3177
|
const isFetching = !!useIsFetching();
|
|
2903
3178
|
const isMutating = !!useIsMutating();
|
|
2904
|
-
return /* @__PURE__ */
|
|
2905
|
-
/* @__PURE__ */
|
|
2906
|
-
/* @__PURE__ */
|
|
2907
|
-
/* @__PURE__ */
|
|
2908
|
-
/* @__PURE__ */
|
|
3179
|
+
return /* @__PURE__ */ jsxs15(ThemeProvider, { theme, children: [
|
|
3180
|
+
/* @__PURE__ */ jsx27(InitColorSchemeScript, {}),
|
|
3181
|
+
/* @__PURE__ */ jsx27(CssBaseline, {}),
|
|
3182
|
+
/* @__PURE__ */ jsxs15(Box9, { sx: { display: "flex", height: "100dvh", maxHeight: "100dvh", overflow: "hidden", width: "100%" }, children: [
|
|
3183
|
+
/* @__PURE__ */ jsx27(
|
|
2909
3184
|
AppBar,
|
|
2910
3185
|
{
|
|
2911
3186
|
color: "transparent",
|
|
@@ -2915,130 +3190,73 @@ var Layout = (props) => {
|
|
|
2915
3190
|
borderColor: theme.vars?.palette.divider,
|
|
2916
3191
|
boxShadow: "none"
|
|
2917
3192
|
},
|
|
2918
|
-
children: /* @__PURE__ */
|
|
2919
|
-
props.navigation && /* @__PURE__ */
|
|
2920
|
-
|
|
3193
|
+
children: /* @__PURE__ */ jsxs15(Toolbar, { children: [
|
|
3194
|
+
props.navigation && /* @__PURE__ */ jsx27(
|
|
3195
|
+
IconButton5,
|
|
2921
3196
|
{
|
|
2922
3197
|
onClick: () => setNavigationOpen((previous) => !previous),
|
|
2923
3198
|
sx: { marginRight: 2 },
|
|
2924
|
-
children: navigationOpen ? /* @__PURE__ */
|
|
3199
|
+
children: navigationOpen ? /* @__PURE__ */ jsx27(MenuOpen, {}) : /* @__PURE__ */ jsx27(Menu3, {})
|
|
2925
3200
|
}
|
|
2926
3201
|
),
|
|
2927
|
-
/* @__PURE__ */
|
|
2928
|
-
/* @__PURE__ */
|
|
3202
|
+
/* @__PURE__ */ jsx27(AppTitle, {}),
|
|
3203
|
+
/* @__PURE__ */ jsx27(ToolbarAccount, {})
|
|
2929
3204
|
] })
|
|
2930
3205
|
}
|
|
2931
3206
|
),
|
|
2932
|
-
props.navigation && /* @__PURE__ */
|
|
2933
|
-
/* @__PURE__ */
|
|
2934
|
-
/* @__PURE__ */
|
|
2935
|
-
/* @__PURE__ */
|
|
3207
|
+
props.navigation && /* @__PURE__ */ jsx27(NavigationRail, { navigation: props.navigation, expanded: navigationOpen ?? false, setExpanded: setNavigationOpen }),
|
|
3208
|
+
/* @__PURE__ */ jsxs15(Box9, { component: "main", sx: { flexGrow: 1, display: "flex", flexDirection: "column", minWidth: 0, height: "100%", overflow: "hidden" }, children: [
|
|
3209
|
+
/* @__PURE__ */ jsx27(DrawerHeader, {}),
|
|
3210
|
+
/* @__PURE__ */ jsx27(Box9, { sx: { flex: 1, overflow: "auto", position: "relative" }, children: props.children })
|
|
2936
3211
|
] })
|
|
2937
3212
|
] }),
|
|
2938
|
-
(isFetching || isMutating) && /* @__PURE__ */
|
|
3213
|
+
(isFetching || isMutating) && /* @__PURE__ */ jsx27(LinearProgress, { sx: { position: "fixed", top: { xs: 56, sm: 64 }, left: 0, right: 0 } })
|
|
2939
3214
|
] });
|
|
2940
3215
|
};
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
useSuspense: false
|
|
2949
|
-
}
|
|
2950
|
-
});
|
|
2951
|
-
function DialogsProvider({ children, unmountAfter = 1e3 }) {
|
|
2952
|
-
const [stack, setStack] = useState([]);
|
|
2953
|
-
const keyPrefix = useId();
|
|
2954
|
-
const nextId = useRef(0);
|
|
2955
|
-
const dialogMetadata = useRef(/* @__PURE__ */ new WeakMap());
|
|
2956
|
-
const requestDialog = useEventCallback_default(function open(Component7, payload, options = {}) {
|
|
2957
|
-
const { onClose = async () => {
|
|
2958
|
-
} } = options;
|
|
2959
|
-
let resolve;
|
|
2960
|
-
const promise = new Promise((resolveImpl) => {
|
|
2961
|
-
resolve = resolveImpl;
|
|
2962
|
-
});
|
|
2963
|
-
const key = `${keyPrefix}-${nextId.current}`;
|
|
2964
|
-
nextId.current += 1;
|
|
2965
|
-
const newEntry = {
|
|
2966
|
-
key,
|
|
2967
|
-
open: true,
|
|
2968
|
-
promise,
|
|
2969
|
-
Component: Component7,
|
|
2970
|
-
payload,
|
|
2971
|
-
onClose,
|
|
2972
|
-
resolve
|
|
2973
|
-
};
|
|
2974
|
-
dialogMetadata.current.set(promise, newEntry);
|
|
2975
|
-
setStack((previousStack) => [...previousStack, newEntry]);
|
|
2976
|
-
return promise;
|
|
2977
|
-
});
|
|
2978
|
-
const removeDialogFromStack = useCallback((dialog) => {
|
|
2979
|
-
setStack((previousStack) => previousStack.filter((entry) => entry.promise !== dialog));
|
|
2980
|
-
dialogMetadata.current.delete(dialog);
|
|
2981
|
-
}, []);
|
|
2982
|
-
const closeDialogUi = useEventCallback_default(function closeDialogUi2(dialog) {
|
|
2983
|
-
setStack(
|
|
2984
|
-
(previousStack) => previousStack.map((entry) => entry.promise === dialog ? { ...entry, open: false } : entry)
|
|
2985
|
-
);
|
|
2986
|
-
setTimeout(() => removeDialogFromStack(dialog), unmountAfter);
|
|
2987
|
-
});
|
|
2988
|
-
const closeDialog = useEventCallback_default(async function closeDialog2(dialog, result) {
|
|
2989
|
-
const entryToClose = dialogMetadata.current.get(dialog);
|
|
2990
|
-
if (!entryToClose) {
|
|
2991
|
-
throw new Error("Dialog not found in stack");
|
|
2992
|
-
}
|
|
2993
|
-
try {
|
|
2994
|
-
await entryToClose.onClose(result);
|
|
2995
|
-
} finally {
|
|
2996
|
-
entryToClose.resolve(result);
|
|
2997
|
-
closeDialogUi(dialog);
|
|
2998
|
-
}
|
|
2999
|
-
return dialog;
|
|
3000
|
-
});
|
|
3001
|
-
const contextValue = useMemo(() => ({ open: requestDialog, close: closeDialog }), [requestDialog, closeDialog]);
|
|
3002
|
-
return /* @__PURE__ */ jsxs(DialogsContext.Provider, { value: contextValue, children: [
|
|
3003
|
-
children,
|
|
3004
|
-
stack.map(({ key, open, Component: Component7, payload, promise }) => /* @__PURE__ */ jsx(
|
|
3005
|
-
Component7,
|
|
3006
|
-
{
|
|
3007
|
-
payload,
|
|
3008
|
-
open,
|
|
3009
|
-
onClose: async (result) => {
|
|
3010
|
-
await closeDialog(promise, result);
|
|
3011
|
-
}
|
|
3012
|
-
},
|
|
3013
|
-
key
|
|
3014
|
-
))
|
|
3015
|
-
] });
|
|
3016
|
-
}
|
|
3216
|
+
|
|
3217
|
+
// src/contexts/LayoutContext.ts
|
|
3218
|
+
import { createContext as createContext4, useContext as useContext4 } from "react";
|
|
3219
|
+
var LayoutContext = createContext4(null);
|
|
3220
|
+
|
|
3221
|
+
// src/providers/LayoutProvider.tsx
|
|
3222
|
+
import { jsx as jsx28, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3017
3223
|
var LayoutProvider = (props) => {
|
|
3018
|
-
const [user, setUser] =
|
|
3019
|
-
const { t: t2 } =
|
|
3224
|
+
const [user, setUser] = useState10({ employeeId: "", name: "Unknown", department: "", company: "", category: "" });
|
|
3225
|
+
const { t: t2 } = useTranslation7();
|
|
3020
3226
|
const navigation = props.getNavigation?.({ user, t: t2 });
|
|
3021
|
-
|
|
3227
|
+
useEffect6(() => {
|
|
3022
3228
|
z.config(default2.resolvedLanguage === "cs" ? cs() : en());
|
|
3023
3229
|
}, []);
|
|
3024
|
-
return /* @__PURE__ */
|
|
3230
|
+
return /* @__PURE__ */ jsx28(I18nextProvider, { i18n: default2, children: /* @__PURE__ */ jsx28(LocalizationProvider, { dateAdapter: AdapterDayjs, adapterLocale: default2.resolvedLanguage, children: /* @__PURE__ */ jsx28(LayoutContext.Provider, { value: { user: { get: user, set: setUser } }, children: /* @__PURE__ */ jsxs16(Layout, { navigation, theme: props.theme, children: [
|
|
3025
3231
|
"\xA8",
|
|
3026
|
-
/* @__PURE__ */
|
|
3232
|
+
/* @__PURE__ */ jsx28(DialogsProvider, { children: props.children })
|
|
3027
3233
|
] }) }) }) });
|
|
3028
3234
|
};
|
|
3029
3235
|
|
|
3236
|
+
// src/index.ts
|
|
3237
|
+
import { uuidv7 as uuidv72 } from "uuidv7";
|
|
3238
|
+
|
|
3239
|
+
// src/hooks/FormHooks.ts
|
|
3240
|
+
import { createFormHook, createFormHookContexts } from "@tanstack/react-form";
|
|
3241
|
+
|
|
3242
|
+
// src/components/form/FormAutocomplete.tsx
|
|
3243
|
+
import { Autocomplete, TextField } from "@mui/material";
|
|
3244
|
+
|
|
3030
3245
|
// src/utils/FormUtils.ts
|
|
3031
3246
|
var getFieldStatus = (field) => {
|
|
3032
3247
|
const { meta } = field.state;
|
|
3033
3248
|
const isTouched = meta.isTouched;
|
|
3034
|
-
const hasError = !!meta.errors
|
|
3035
|
-
const helperText = meta.errors
|
|
3249
|
+
const hasError = !!meta.errors.length;
|
|
3250
|
+
const helperText = meta.errors[0]?.message;
|
|
3036
3251
|
return { isTouched, hasError, helperText };
|
|
3037
3252
|
};
|
|
3253
|
+
|
|
3254
|
+
// src/components/form/FormAutocomplete.tsx
|
|
3255
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
3038
3256
|
var FormAutocomplete = ({ textFieldProps, ...autocompleteProps }) => {
|
|
3039
3257
|
const field = useFieldContext();
|
|
3040
3258
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
3041
|
-
return /* @__PURE__ */
|
|
3259
|
+
return /* @__PURE__ */ jsx29(
|
|
3042
3260
|
Autocomplete,
|
|
3043
3261
|
{
|
|
3044
3262
|
value: field.state.value,
|
|
@@ -3047,7 +3265,7 @@ var FormAutocomplete = ({ textFieldProps, ...autocompleteProps }) => {
|
|
|
3047
3265
|
onBlur: field.handleBlur,
|
|
3048
3266
|
"aria-label": field.name,
|
|
3049
3267
|
...autocompleteProps,
|
|
3050
|
-
renderInput: (parameters) => /* @__PURE__ */
|
|
3268
|
+
renderInput: (parameters) => /* @__PURE__ */ jsx29(
|
|
3051
3269
|
TextField,
|
|
3052
3270
|
{
|
|
3053
3271
|
...parameters,
|
|
@@ -3060,14 +3278,18 @@ var FormAutocomplete = ({ textFieldProps, ...autocompleteProps }) => {
|
|
|
3060
3278
|
}
|
|
3061
3279
|
);
|
|
3062
3280
|
};
|
|
3281
|
+
|
|
3282
|
+
// src/components/form/FormCheckbox.tsx
|
|
3283
|
+
import { Checkbox, FormControl, FormControlLabel, FormHelperText } from "@mui/material";
|
|
3284
|
+
import { jsx as jsx30, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3063
3285
|
var FormCheckbox = (props) => {
|
|
3064
3286
|
const field = useFieldContext();
|
|
3065
3287
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
3066
|
-
return /* @__PURE__ */
|
|
3067
|
-
/* @__PURE__ */
|
|
3288
|
+
return /* @__PURE__ */ jsxs17(FormControl, { component: "fieldset", children: [
|
|
3289
|
+
/* @__PURE__ */ jsx30(
|
|
3068
3290
|
FormControlLabel,
|
|
3069
3291
|
{
|
|
3070
|
-
control: /* @__PURE__ */
|
|
3292
|
+
control: /* @__PURE__ */ jsx30(
|
|
3071
3293
|
Checkbox,
|
|
3072
3294
|
{
|
|
3073
3295
|
name: field.name,
|
|
@@ -3081,17 +3303,22 @@ var FormCheckbox = (props) => {
|
|
|
3081
3303
|
label: props.label ?? ""
|
|
3082
3304
|
}
|
|
3083
3305
|
),
|
|
3084
|
-
isTouched && hasError && /* @__PURE__ */
|
|
3306
|
+
isTouched && hasError && /* @__PURE__ */ jsx30(FormHelperText, { error: hasError, children: helperText })
|
|
3085
3307
|
] });
|
|
3086
3308
|
};
|
|
3309
|
+
|
|
3310
|
+
// src/components/form/FormDatePicker.tsx
|
|
3311
|
+
import { DatePicker } from "@mui/x-date-pickers-pro";
|
|
3312
|
+
import dayjs2 from "dayjs";
|
|
3313
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
3087
3314
|
var FormDatePicker = (props) => {
|
|
3088
3315
|
const field = useFieldContext();
|
|
3089
3316
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
3090
|
-
return /* @__PURE__ */
|
|
3317
|
+
return /* @__PURE__ */ jsx31(
|
|
3091
3318
|
DatePicker,
|
|
3092
3319
|
{
|
|
3093
3320
|
name: field.name,
|
|
3094
|
-
value: field.state.value ?
|
|
3321
|
+
value: field.state.value ? dayjs2(field.state.value) : null,
|
|
3095
3322
|
onChange: (value) => field.handleChange(value ? value.format() : null),
|
|
3096
3323
|
slotProps: {
|
|
3097
3324
|
textField: {
|
|
@@ -3107,14 +3334,19 @@ var FormDatePicker = (props) => {
|
|
|
3107
3334
|
}
|
|
3108
3335
|
);
|
|
3109
3336
|
};
|
|
3337
|
+
|
|
3338
|
+
// src/components/form/FormDateTimePicker.tsx
|
|
3339
|
+
import { DateTimePicker } from "@mui/x-date-pickers-pro";
|
|
3340
|
+
import dayjs3 from "dayjs";
|
|
3341
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
3110
3342
|
var FormDateTimePicker = (props) => {
|
|
3111
3343
|
const field = useFieldContext();
|
|
3112
3344
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
3113
|
-
return /* @__PURE__ */
|
|
3345
|
+
return /* @__PURE__ */ jsx32(
|
|
3114
3346
|
DateTimePicker,
|
|
3115
3347
|
{
|
|
3116
3348
|
name: field.name,
|
|
3117
|
-
value: field.state.value ?
|
|
3349
|
+
value: field.state.value ? dayjs3(field.state.value) : null,
|
|
3118
3350
|
onChange: (value) => field.handleChange(value ? value.format() : null),
|
|
3119
3351
|
slotProps: {
|
|
3120
3352
|
textField: {
|
|
@@ -3130,13 +3362,18 @@ var FormDateTimePicker = (props) => {
|
|
|
3130
3362
|
}
|
|
3131
3363
|
);
|
|
3132
3364
|
};
|
|
3365
|
+
|
|
3366
|
+
// src/components/form/FormNumberField.tsx
|
|
3367
|
+
import { TextField as TextField2 } from "@mui/material";
|
|
3368
|
+
import { NumericFormat } from "react-number-format";
|
|
3369
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
3133
3370
|
var FormNumberField = ({ options, ...props }) => {
|
|
3134
3371
|
const field = useFieldContext();
|
|
3135
3372
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
3136
|
-
return /* @__PURE__ */
|
|
3373
|
+
return /* @__PURE__ */ jsx33(
|
|
3137
3374
|
NumericFormat,
|
|
3138
3375
|
{
|
|
3139
|
-
customInput:
|
|
3376
|
+
customInput: TextField2,
|
|
3140
3377
|
name: field.name,
|
|
3141
3378
|
value: field.state.value ?? "",
|
|
3142
3379
|
onValueChange: ({ floatValue }) => field.handleChange(floatValue),
|
|
@@ -3149,12 +3386,16 @@ var FormNumberField = ({ options, ...props }) => {
|
|
|
3149
3386
|
}
|
|
3150
3387
|
);
|
|
3151
3388
|
};
|
|
3389
|
+
|
|
3390
|
+
// src/components/form/FormRadioGroup.tsx
|
|
3391
|
+
import { FormControl as FormControl2, FormControlLabel as FormControlLabel2, FormHelperText as FormHelperText2, FormLabel, Radio, RadioGroup } from "@mui/material";
|
|
3392
|
+
import { jsx as jsx34, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3152
3393
|
var FormRadioGroup = ({ label, options, ...props }) => {
|
|
3153
3394
|
const field = useFieldContext();
|
|
3154
3395
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
3155
|
-
return /* @__PURE__ */
|
|
3156
|
-
label && /* @__PURE__ */
|
|
3157
|
-
/* @__PURE__ */
|
|
3396
|
+
return /* @__PURE__ */ jsxs18(FormControl2, { component: "fieldset", children: [
|
|
3397
|
+
label && /* @__PURE__ */ jsx34(FormLabel, { component: "legend", children: label }),
|
|
3398
|
+
/* @__PURE__ */ jsx34(
|
|
3158
3399
|
RadioGroup,
|
|
3159
3400
|
{
|
|
3160
3401
|
name: field.name,
|
|
@@ -3163,26 +3404,30 @@ var FormRadioGroup = ({ label, options, ...props }) => {
|
|
|
3163
3404
|
onBlur: field.handleBlur,
|
|
3164
3405
|
"aria-label": field.name,
|
|
3165
3406
|
...props,
|
|
3166
|
-
children: options.map((option) => /* @__PURE__ */
|
|
3167
|
-
|
|
3407
|
+
children: options.map((option) => /* @__PURE__ */ jsx34(
|
|
3408
|
+
FormControlLabel2,
|
|
3168
3409
|
{
|
|
3169
3410
|
value: option.value,
|
|
3170
|
-
control: /* @__PURE__ */
|
|
3411
|
+
control: /* @__PURE__ */ jsx34(Radio, {}),
|
|
3171
3412
|
label: option.label
|
|
3172
3413
|
},
|
|
3173
3414
|
option.value
|
|
3174
3415
|
))
|
|
3175
3416
|
}
|
|
3176
3417
|
),
|
|
3177
|
-
isTouched && hasError && /* @__PURE__ */
|
|
3418
|
+
isTouched && hasError && /* @__PURE__ */ jsx34(FormHelperText2, { error: hasError, children: helperText })
|
|
3178
3419
|
] });
|
|
3179
3420
|
};
|
|
3421
|
+
|
|
3422
|
+
// src/components/form/FormSlider.tsx
|
|
3423
|
+
import { FormControl as FormControl3, FormHelperText as FormHelperText3, FormLabel as FormLabel2, Slider } from "@mui/material";
|
|
3424
|
+
import { jsx as jsx35, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3180
3425
|
var FormSlider = ({ label, ...props }) => {
|
|
3181
3426
|
const field = useFieldContext();
|
|
3182
3427
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
3183
|
-
return /* @__PURE__ */
|
|
3184
|
-
label && /* @__PURE__ */
|
|
3185
|
-
/* @__PURE__ */
|
|
3428
|
+
return /* @__PURE__ */ jsxs19(FormControl3, { component: "fieldset", children: [
|
|
3429
|
+
label && /* @__PURE__ */ jsx35(FormLabel2, { children: label }),
|
|
3430
|
+
/* @__PURE__ */ jsx35(
|
|
3186
3431
|
Slider,
|
|
3187
3432
|
{
|
|
3188
3433
|
name: field.name,
|
|
@@ -3193,9 +3438,13 @@ var FormSlider = ({ label, ...props }) => {
|
|
|
3193
3438
|
...props
|
|
3194
3439
|
}
|
|
3195
3440
|
),
|
|
3196
|
-
isTouched && hasError && /* @__PURE__ */
|
|
3441
|
+
isTouched && hasError && /* @__PURE__ */ jsx35(FormHelperText3, { error: hasError, children: helperText })
|
|
3197
3442
|
] });
|
|
3198
3443
|
};
|
|
3444
|
+
|
|
3445
|
+
// src/components/form/FormSubmitButton.tsx
|
|
3446
|
+
import { Button as Button3 } from "@mui/material";
|
|
3447
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
3199
3448
|
var FormSubmitButton = (props) => {
|
|
3200
3449
|
const form = useFormContext();
|
|
3201
3450
|
const handleClick = (event) => {
|
|
@@ -3203,8 +3452,8 @@ var FormSubmitButton = (props) => {
|
|
|
3203
3452
|
event.stopPropagation();
|
|
3204
3453
|
form.handleSubmit();
|
|
3205
3454
|
};
|
|
3206
|
-
return /* @__PURE__ */
|
|
3207
|
-
|
|
3455
|
+
return /* @__PURE__ */ jsx36(form.Subscribe, { selector: (state) => [state.canSubmit, state.isSubmitting], children: ([canSubmit, isSubmitting]) => /* @__PURE__ */ jsx36(
|
|
3456
|
+
Button3,
|
|
3208
3457
|
{
|
|
3209
3458
|
loading: isSubmitting,
|
|
3210
3459
|
disabled: !canSubmit,
|
|
@@ -3215,14 +3464,18 @@ var FormSubmitButton = (props) => {
|
|
|
3215
3464
|
}
|
|
3216
3465
|
) });
|
|
3217
3466
|
};
|
|
3467
|
+
|
|
3468
|
+
// src/components/form/FormSwitch.tsx
|
|
3469
|
+
import { FormControl as FormControl4, FormControlLabel as FormControlLabel3, FormHelperText as FormHelperText4, Switch } from "@mui/material";
|
|
3470
|
+
import { jsx as jsx37, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3218
3471
|
var FormSwitch = (props) => {
|
|
3219
3472
|
const field = useFieldContext();
|
|
3220
3473
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
3221
|
-
return /* @__PURE__ */
|
|
3222
|
-
/* @__PURE__ */
|
|
3223
|
-
|
|
3474
|
+
return /* @__PURE__ */ jsxs20(FormControl4, { component: "fieldset", children: [
|
|
3475
|
+
/* @__PURE__ */ jsx37(
|
|
3476
|
+
FormControlLabel3,
|
|
3224
3477
|
{
|
|
3225
|
-
control: /* @__PURE__ */
|
|
3478
|
+
control: /* @__PURE__ */ jsx37(
|
|
3226
3479
|
Switch,
|
|
3227
3480
|
{
|
|
3228
3481
|
name: field.name,
|
|
@@ -3236,14 +3489,18 @@ var FormSwitch = (props) => {
|
|
|
3236
3489
|
label: props.label ?? ""
|
|
3237
3490
|
}
|
|
3238
3491
|
),
|
|
3239
|
-
isTouched && hasError && /* @__PURE__ */
|
|
3492
|
+
isTouched && hasError && /* @__PURE__ */ jsx37(FormHelperText4, { error: hasError, children: helperText })
|
|
3240
3493
|
] });
|
|
3241
3494
|
};
|
|
3495
|
+
|
|
3496
|
+
// src/components/form/FormTextField.tsx
|
|
3497
|
+
import { TextField as TextField3 } from "@mui/material";
|
|
3498
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
3242
3499
|
var FormTextField = (props) => {
|
|
3243
3500
|
const field = useFieldContext();
|
|
3244
3501
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
3245
|
-
return /* @__PURE__ */
|
|
3246
|
-
|
|
3502
|
+
return /* @__PURE__ */ jsx38(
|
|
3503
|
+
TextField3,
|
|
3247
3504
|
{
|
|
3248
3505
|
name: field.name,
|
|
3249
3506
|
value: field.state.value ?? "",
|
|
@@ -3277,6 +3534,50 @@ var { useAppForm: useLayoutForm, withForm: withLayoutForm } = createFormHook({
|
|
|
3277
3534
|
fieldContext,
|
|
3278
3535
|
formContext
|
|
3279
3536
|
});
|
|
3537
|
+
|
|
3538
|
+
// src/index.ts
|
|
3539
|
+
import { default as default3 } from "use-local-storage-state";
|
|
3540
|
+
import { useTranslation as useTranslation8 } from "react-i18next";
|
|
3541
|
+
import { t } from "i18next";
|
|
3542
|
+
export {
|
|
3543
|
+
ChipInputCell,
|
|
3544
|
+
Dropzone,
|
|
3545
|
+
EditableColumnHeader,
|
|
3546
|
+
FileViewer,
|
|
3547
|
+
LayoutProvider,
|
|
3548
|
+
PageHeader,
|
|
3549
|
+
Platform,
|
|
3550
|
+
RouterButton,
|
|
3551
|
+
RouterError,
|
|
3552
|
+
RouterGridActionsCellItem,
|
|
3553
|
+
RouterIconButton,
|
|
3554
|
+
RouterLink,
|
|
3555
|
+
RouterListItemButton,
|
|
3556
|
+
RouterNotFound,
|
|
3557
|
+
RouterTab,
|
|
3558
|
+
TableContainer,
|
|
3559
|
+
TypographyWithIcon,
|
|
3560
|
+
rootRouteHead,
|
|
3561
|
+
t,
|
|
3562
|
+
useDeleteFile,
|
|
3563
|
+
useDeleteFiles,
|
|
3564
|
+
useDialogs,
|
|
3565
|
+
useDownloadFile,
|
|
3566
|
+
useFieldContext,
|
|
3567
|
+
useFormContext,
|
|
3568
|
+
useGetFile,
|
|
3569
|
+
useGetFileMetas,
|
|
3570
|
+
useGetFileThumbnail,
|
|
3571
|
+
useLayoutForm,
|
|
3572
|
+
default3 as useLocalStorageState,
|
|
3573
|
+
useOpenFile,
|
|
3574
|
+
useTranslation8 as useTranslation,
|
|
3575
|
+
useUpdateFileMeta,
|
|
3576
|
+
useUploadFile,
|
|
3577
|
+
uuidv72 as uuidv7,
|
|
3578
|
+
wczApiClient,
|
|
3579
|
+
withLayoutForm
|
|
3580
|
+
};
|
|
3280
3581
|
/*! Bundled license information:
|
|
3281
3582
|
|
|
3282
3583
|
react-is/cjs/react-is.production.min.js:
|
|
@@ -3306,7 +3607,4 @@ object-assign/index.js:
|
|
|
3306
3607
|
@license MIT
|
|
3307
3608
|
*)
|
|
3308
3609
|
*/
|
|
3309
|
-
|
|
3310
|
-
export { ChipInputCell, Dropzone, EditableColumnHeader, FileViewer, LayoutProvider, PageHeader, Platform, RouterButton, RouterError, RouterGridActionsCellItem, RouterIconButton, RouterLink, RouterListItemButton, RouterNotFound, RouterTab, TableContainer, TypographyWithIcon, rootRouteHead, useDeleteFile, useDeleteFiles, useDialogs, useDownloadFile, useFieldContext, useFormContext, useGetFile, useGetFileMetas, useGetFileThumbnail, useLayoutForm, useOpenFile, useUpdateFileMeta, useUploadFile, wczApiClient, withLayoutForm };
|
|
3311
|
-
//# sourceMappingURL=index.js.map
|
|
3312
3610
|
//# sourceMappingURL=index.js.map
|