wcz-test 4.0.1 → 4.1.1
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 +28 -25
- package/dist/index.js +726 -502
- 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",
|
|
@@ -1087,12 +1025,10 @@ var stackSxProps = [
|
|
|
1087
1025
|
var TypographyWithIcon = ({ startIcon, endIcon, children, sx, gutterBottom, ...props }) => {
|
|
1088
1026
|
const sxCopy = { ...sx };
|
|
1089
1027
|
const stackStyles = {};
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
delete sxCopy[current];
|
|
1095
|
-
}
|
|
1028
|
+
for (const current of stackSxProps) {
|
|
1029
|
+
if (sxCopy[current]) {
|
|
1030
|
+
stackStyles[current] = sxCopy[current];
|
|
1031
|
+
delete sxCopy[current];
|
|
1096
1032
|
}
|
|
1097
1033
|
}
|
|
1098
1034
|
return /* @__PURE__ */ jsxs(Stack, { direction: "row", alignItems: "center", gap: 1, sx: stackStyles, mb: gutterBottom ? 0.7 : void 0, children: [
|
|
@@ -1101,9 +1037,18 @@ var TypographyWithIcon = ({ startIcon, endIcon, children, sx, gutterBottom, ...p
|
|
|
1101
1037
|
endIcon
|
|
1102
1038
|
] });
|
|
1103
1039
|
};
|
|
1040
|
+
|
|
1041
|
+
// src/components/core/PageHeader.tsx
|
|
1042
|
+
import { CardHeader, Typography as Typography2 } from "@mui/material";
|
|
1043
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
1104
1044
|
var PageHeader = ({ title, action, sx }) => {
|
|
1105
|
-
return /* @__PURE__ */
|
|
1045
|
+
return /* @__PURE__ */ jsx2(CardHeader, { title: /* @__PURE__ */ jsx2(Typography2, { variant: "h4", fontWeight: 600, children: title }), action, sx: { px: 0, ...sx } });
|
|
1106
1046
|
};
|
|
1047
|
+
|
|
1048
|
+
// src/components/core/TableContainer.tsx
|
|
1049
|
+
import { Box } from "@mui/material";
|
|
1050
|
+
import { useEffect, useRef, useState } from "react";
|
|
1051
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
1107
1052
|
var TableContainer = ({ children, sx, ...props }) => {
|
|
1108
1053
|
const reference = useRef(null);
|
|
1109
1054
|
const [height, setHeight] = useState();
|
|
@@ -1127,7 +1072,7 @@ var TableContainer = ({ children, sx, ...props }) => {
|
|
|
1127
1072
|
ro.disconnect();
|
|
1128
1073
|
};
|
|
1129
1074
|
}, []);
|
|
1130
|
-
return /* @__PURE__ */
|
|
1075
|
+
return /* @__PURE__ */ jsx3(
|
|
1131
1076
|
Box,
|
|
1132
1077
|
{
|
|
1133
1078
|
ref: reference,
|
|
@@ -1140,7 +1085,7 @@ var TableContainer = ({ children, sx, ...props }) => {
|
|
|
1140
1085
|
},
|
|
1141
1086
|
height,
|
|
1142
1087
|
...props,
|
|
1143
|
-
children: /* @__PURE__ */
|
|
1088
|
+
children: /* @__PURE__ */ jsx3(Box, { sx: (theme) => ({
|
|
1144
1089
|
flex: 1,
|
|
1145
1090
|
minHeight: 0,
|
|
1146
1091
|
height: "100%",
|
|
@@ -1166,6 +1111,13 @@ var TableContainer = ({ children, sx, ...props }) => {
|
|
|
1166
1111
|
}
|
|
1167
1112
|
);
|
|
1168
1113
|
};
|
|
1114
|
+
|
|
1115
|
+
// src/components/file/Dropzone.tsx
|
|
1116
|
+
import CloudUpload from "@mui/icons-material/CloudUpload";
|
|
1117
|
+
import { Paper, Typography as Typography3, useTheme } from "@mui/material";
|
|
1118
|
+
import { useDropzone } from "react-dropzone";
|
|
1119
|
+
import { useTranslation } from "react-i18next";
|
|
1120
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1169
1121
|
var baseStyle = {
|
|
1170
1122
|
flex: 1,
|
|
1171
1123
|
display: "flex",
|
|
@@ -1189,12 +1141,30 @@ var Dropzone = ({ sx, ...props }) => {
|
|
|
1189
1141
|
...isDragAccept ? { borderColor: theme.palette.success.main } : {},
|
|
1190
1142
|
...isDragReject ? { borderColor: theme.palette.error.main } : {}
|
|
1191
1143
|
};
|
|
1192
|
-
return /* @__PURE__ */
|
|
1193
|
-
/* @__PURE__ */
|
|
1194
|
-
/* @__PURE__ */
|
|
1195
|
-
/* @__PURE__ */
|
|
1144
|
+
return /* @__PURE__ */ jsxs2(Paper, { variant: "outlined", ...getRootProps({ style }), sx, children: [
|
|
1145
|
+
/* @__PURE__ */ jsx4("input", { ...getInputProps(), style: { display: "none" } }),
|
|
1146
|
+
/* @__PURE__ */ jsx4(CloudUpload, {}),
|
|
1147
|
+
/* @__PURE__ */ jsx4(Typography3, { children: t2("Layout.File.DragSomeFilesHereOrClickToSelectThem") })
|
|
1196
1148
|
] });
|
|
1197
1149
|
};
|
|
1150
|
+
|
|
1151
|
+
// src/components/file/FileViewer.tsx
|
|
1152
|
+
import { useState as useState5 } from "react";
|
|
1153
|
+
|
|
1154
|
+
// src/components/file/fileViewer/FileViewerGrid.tsx
|
|
1155
|
+
import MoreVert from "@mui/icons-material/MoreVert";
|
|
1156
|
+
import { Box as Box2, IconButton, ImageListItem, ImageListItemBar, Stack as Stack3, Tooltip } from "@mui/material";
|
|
1157
|
+
import { grey } from "@mui/material/colors";
|
|
1158
|
+
import { Fragment, useEffect as useEffect2, useState as useState3 } from "react";
|
|
1159
|
+
|
|
1160
|
+
// src/components/file/fileViewer/common/ActionsMenu.tsx
|
|
1161
|
+
import Delete from "@mui/icons-material/Delete";
|
|
1162
|
+
import FileDownload from "@mui/icons-material/FileDownload";
|
|
1163
|
+
import { List, ListItemButton, ListItemIcon, ListItemText, Menu } from "@mui/material";
|
|
1164
|
+
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
1165
|
+
|
|
1166
|
+
// src/contexts/FileContext.ts
|
|
1167
|
+
import { createContext, useContext } from "react";
|
|
1198
1168
|
var FileContext = createContext(null);
|
|
1199
1169
|
var useFile = () => {
|
|
1200
1170
|
const context = useContext(FileContext);
|
|
@@ -1203,18 +1173,74 @@ var useFile = () => {
|
|
|
1203
1173
|
}
|
|
1204
1174
|
return context;
|
|
1205
1175
|
};
|
|
1176
|
+
|
|
1177
|
+
// src/hooks/DialogsHooks.tsx
|
|
1178
|
+
import { Button, Dialog, DialogActions, DialogContent, DialogTitle, useEventCallback } from "@mui/material";
|
|
1179
|
+
import { useContext as useContext2, useMemo } from "react";
|
|
1180
|
+
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
1181
|
+
|
|
1182
|
+
// src/contexts/DialogsContext.ts
|
|
1183
|
+
import { createContext as createContext2 } from "react";
|
|
1184
|
+
var DialogsContext = createContext2({});
|
|
1185
|
+
|
|
1186
|
+
// src/hooks/DialogsHooks.tsx
|
|
1187
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1188
|
+
function AlertDialog({ open, payload, onClose }) {
|
|
1189
|
+
const { t: t2 } = useTranslation2();
|
|
1190
|
+
return /* @__PURE__ */ jsxs3(Dialog, { maxWidth: "xs", fullWidth: true, open, onClose: () => onClose(), children: [
|
|
1191
|
+
/* @__PURE__ */ jsx5(DialogTitle, { children: payload.title ?? t2("Layout.Dialog.Alert") }),
|
|
1192
|
+
/* @__PURE__ */ jsx5(DialogContent, { children: payload.message }),
|
|
1193
|
+
/* @__PURE__ */ jsx5(DialogActions, { children: /* @__PURE__ */ jsx5(Button, { disabled: !open, onClick: () => onClose(), children: t2("Layout.Dialog.Confirm") }) })
|
|
1194
|
+
] });
|
|
1195
|
+
}
|
|
1196
|
+
function ConfirmDialog({ open, payload, onClose }) {
|
|
1197
|
+
const { t: t2 } = useTranslation2();
|
|
1198
|
+
return /* @__PURE__ */ jsxs3(Dialog, { maxWidth: "xs", fullWidth: true, open, onClose: () => onClose(false), children: [
|
|
1199
|
+
/* @__PURE__ */ jsx5(DialogTitle, { children: payload.title ?? t2("Layout.Dialog.Confirm") }),
|
|
1200
|
+
/* @__PURE__ */ jsx5(DialogContent, { children: payload.message }),
|
|
1201
|
+
/* @__PURE__ */ jsxs3(DialogActions, { children: [
|
|
1202
|
+
/* @__PURE__ */ jsx5(Button, { autoFocus: true, disabled: !open, onClick: () => onClose(false), children: payload.cancelText ?? t2("Layout.Dialog.Cancel") }),
|
|
1203
|
+
/* @__PURE__ */ jsx5(Button, { disabled: !open, onClick: () => onClose(true), children: t2("Layout.Dialog.Confirm") })
|
|
1204
|
+
] })
|
|
1205
|
+
] });
|
|
1206
|
+
}
|
|
1207
|
+
function useDialogs() {
|
|
1208
|
+
const { open, close } = useContext2(DialogsContext);
|
|
1209
|
+
const alert = useEventCallback(
|
|
1210
|
+
(message, { ...options } = {}) => open(AlertDialog, { ...options, message })
|
|
1211
|
+
);
|
|
1212
|
+
const confirm = useEventCallback(
|
|
1213
|
+
(message, { ...options } = {}) => open(ConfirmDialog, { ...options, message })
|
|
1214
|
+
);
|
|
1215
|
+
return useMemo(() => ({ alert, confirm, open, close }), [alert, close, confirm, open]);
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
// src/hooks/FileHooks.ts
|
|
1219
|
+
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
1220
|
+
import saveAs from "file-saver";
|
|
1221
|
+
import { useState as useState2 } from "react";
|
|
1222
|
+
import { Upload as TusUpload } from "tus-js-client";
|
|
1223
|
+
import { uuidv7 } from "uuidv7";
|
|
1224
|
+
|
|
1225
|
+
// src/components/core/AppTitle.tsx
|
|
1226
|
+
import { Chip, Stack as Stack2, Typography as Typography4 } from "@mui/material";
|
|
1227
|
+
import { useRouterState } from "@tanstack/react-router";
|
|
1228
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1206
1229
|
var AppTitle = () => {
|
|
1207
1230
|
const title = useAppTitle();
|
|
1208
|
-
return /* @__PURE__ */
|
|
1209
|
-
/* @__PURE__ */
|
|
1210
|
-
/* @__PURE__ */
|
|
1211
|
-
import.meta.env.DEV && /* @__PURE__ */
|
|
1231
|
+
return /* @__PURE__ */ jsxs4(Stack2, { direction: "row", alignItems: "center", spacing: 2, flexGrow: 1, children: [
|
|
1232
|
+
/* @__PURE__ */ jsx6("img", { src: "/favicon-32x32.png", alt: "app-logo", loading: "lazy" }),
|
|
1233
|
+
/* @__PURE__ */ jsx6(Typography4, { variant: "h6", children: title }),
|
|
1234
|
+
import.meta.env.DEV && /* @__PURE__ */ jsx6(Chip, { size: "small", label: "TEST", color: "info" })
|
|
1212
1235
|
] });
|
|
1213
1236
|
};
|
|
1214
1237
|
var useAppTitle = () => {
|
|
1215
1238
|
const rootRouterState = useRouterState({ select: (s) => s.matches[0] });
|
|
1216
1239
|
return rootRouterState.meta?.find((meta) => meta?.title)?.title;
|
|
1217
1240
|
};
|
|
1241
|
+
|
|
1242
|
+
// src/utils/ClientUtils.ts
|
|
1243
|
+
import axios from "axios";
|
|
1218
1244
|
var Platform = class {
|
|
1219
1245
|
static get isAndroid() {
|
|
1220
1246
|
return /android/i.test(this.userAgent);
|
|
@@ -1371,7 +1397,7 @@ var useDeleteFiles = (options) => {
|
|
|
1371
1397
|
};
|
|
1372
1398
|
var useUploadFile = ({ subId, onSuccess, onError }) => {
|
|
1373
1399
|
const appTitle = useAppTitle();
|
|
1374
|
-
const [progress, setProgress] =
|
|
1400
|
+
const [progress, setProgress] = useState2(0);
|
|
1375
1401
|
const queryClient = useQueryClient();
|
|
1376
1402
|
const mutate = async (file) => {
|
|
1377
1403
|
if (!subId) throw new Error("subId is required for file upload");
|
|
@@ -1382,7 +1408,7 @@ var useUploadFile = ({ subId, onSuccess, onError }) => {
|
|
|
1382
1408
|
subId,
|
|
1383
1409
|
fileName: file.name
|
|
1384
1410
|
};
|
|
1385
|
-
const upload = new
|
|
1411
|
+
const upload = new TusUpload(file, {
|
|
1386
1412
|
endpoint: `${BASE_URL}/v1/upload`,
|
|
1387
1413
|
chunkSize: 1048576,
|
|
1388
1414
|
// 1 MB
|
|
@@ -1393,7 +1419,7 @@ var useUploadFile = ({ subId, onSuccess, onError }) => {
|
|
|
1393
1419
|
fileName: metadata.fileName,
|
|
1394
1420
|
fileExtension: file.type
|
|
1395
1421
|
},
|
|
1396
|
-
//headers: { "Authorization": `Bearer ${await getToken()}` }, //TODO: implement token retrieval
|
|
1422
|
+
// headers: { "Authorization": `Bearer ${await getToken()}` }, //TODO: implement token retrieval
|
|
1397
1423
|
onError: (error) => {
|
|
1398
1424
|
setProgress(0);
|
|
1399
1425
|
onError?.(error);
|
|
@@ -1415,53 +1441,11 @@ var useUploadFile = ({ subId, onSuccess, onError }) => {
|
|
|
1415
1441
|
};
|
|
1416
1442
|
return { mutate, progress };
|
|
1417
1443
|
};
|
|
1418
|
-
var useEnhancedEffect = typeof window !== "undefined" ? React11.useLayoutEffect : React11.useEffect;
|
|
1419
|
-
var useEnhancedEffect_default = useEnhancedEffect;
|
|
1420
1444
|
|
|
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
|
-
}
|
|
1445
|
+
// src/components/file/fileViewer/common/ActionsMenu.tsx
|
|
1446
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1463
1447
|
var ActionsMenu = ({ meta, menu, setMenu }) => {
|
|
1464
|
-
const { t: t2 } =
|
|
1448
|
+
const { t: t2 } = useTranslation3();
|
|
1465
1449
|
const { fileMetas, onDelete, actions } = useFile();
|
|
1466
1450
|
const { confirm } = useDialogs();
|
|
1467
1451
|
const handleMenuClose = () => {
|
|
@@ -1483,7 +1467,7 @@ var ActionsMenu = ({ meta, menu, setMenu }) => {
|
|
|
1483
1467
|
onDelete({ remainingFileMetas, deletedFileMeta: meta });
|
|
1484
1468
|
}
|
|
1485
1469
|
};
|
|
1486
|
-
return /* @__PURE__ */
|
|
1470
|
+
return /* @__PURE__ */ jsx7(
|
|
1487
1471
|
Menu,
|
|
1488
1472
|
{
|
|
1489
1473
|
open: menu !== null,
|
|
@@ -1491,23 +1475,26 @@ var ActionsMenu = ({ meta, menu, setMenu }) => {
|
|
|
1491
1475
|
anchorReference: "anchorPosition",
|
|
1492
1476
|
variant: "menu",
|
|
1493
1477
|
anchorPosition: menu === null ? void 0 : { top: menu.mouseY, left: menu.mouseX },
|
|
1494
|
-
children: /* @__PURE__ */
|
|
1495
|
-
actions?.download !== false && /* @__PURE__ */
|
|
1496
|
-
/* @__PURE__ */
|
|
1497
|
-
/* @__PURE__ */
|
|
1478
|
+
children: /* @__PURE__ */ jsxs5(List, { disablePadding: true, children: [
|
|
1479
|
+
actions?.download !== false && /* @__PURE__ */ jsxs5(ListItemButton, { onClick: handleOnDownload, disabled: isDownloading, children: [
|
|
1480
|
+
/* @__PURE__ */ jsx7(ListItemIcon, { children: /* @__PURE__ */ jsx7(FileDownload, {}) }),
|
|
1481
|
+
/* @__PURE__ */ jsx7(ListItemText, { children: t2("Layout.File.Download") })
|
|
1498
1482
|
] }),
|
|
1499
|
-
actions?.delete !== false && /* @__PURE__ */
|
|
1500
|
-
/* @__PURE__ */
|
|
1501
|
-
/* @__PURE__ */
|
|
1483
|
+
actions?.delete !== false && /* @__PURE__ */ jsxs5(ListItemButton, { onClick: handleOnDelete, disabled: isDeleting, children: [
|
|
1484
|
+
/* @__PURE__ */ jsx7(ListItemIcon, { children: /* @__PURE__ */ jsx7(Delete, {}) }),
|
|
1485
|
+
/* @__PURE__ */ jsx7(ListItemText, { children: t2("Layout.File.Delete") })
|
|
1502
1486
|
] })
|
|
1503
1487
|
] })
|
|
1504
1488
|
}
|
|
1505
1489
|
);
|
|
1506
1490
|
};
|
|
1491
|
+
|
|
1492
|
+
// src/components/file/fileViewer/FileViewerGrid.tsx
|
|
1493
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1507
1494
|
var IMAGE_SIZE = 150;
|
|
1508
1495
|
var FileViewerGrid = ({ sx, size, itemBar }) => {
|
|
1509
1496
|
const { fileMetas } = useFile();
|
|
1510
|
-
return /* @__PURE__ */
|
|
1497
|
+
return /* @__PURE__ */ jsx8(Stack3, { direction: "row", spacing: 1, sx: { overflow: "auto", ...sx }, children: fileMetas.map((fileMeta) => /* @__PURE__ */ jsx8(
|
|
1511
1498
|
GridFileViewerItem,
|
|
1512
1499
|
{
|
|
1513
1500
|
meta: fileMeta,
|
|
@@ -1519,9 +1506,9 @@ var FileViewerGrid = ({ sx, size, itemBar }) => {
|
|
|
1519
1506
|
};
|
|
1520
1507
|
var GridFileViewerItem = ({ meta, size, itemBar }) => {
|
|
1521
1508
|
const { setImageId, actions } = useFile();
|
|
1522
|
-
const [showItemBar, setShowItemBar] =
|
|
1523
|
-
const [menu, setMenu] =
|
|
1524
|
-
|
|
1509
|
+
const [showItemBar, setShowItemBar] = useState3(itemBar === "always");
|
|
1510
|
+
const [menu, setMenu] = useState3(null);
|
|
1511
|
+
useEffect2(() => {
|
|
1525
1512
|
setShowItemBar(itemBar === "always");
|
|
1526
1513
|
}, [itemBar]);
|
|
1527
1514
|
const { data: source } = useGetFileThumbnail(meta);
|
|
@@ -1549,10 +1536,10 @@ var GridFileViewerItem = ({ meta, size, itemBar }) => {
|
|
|
1549
1536
|
}
|
|
1550
1537
|
}
|
|
1551
1538
|
};
|
|
1552
|
-
return /* @__PURE__ */
|
|
1553
|
-
/* @__PURE__ */
|
|
1554
|
-
/* @__PURE__ */
|
|
1555
|
-
|
|
1539
|
+
return /* @__PURE__ */ jsxs6(Fragment, { children: [
|
|
1540
|
+
/* @__PURE__ */ jsxs6(ImageListItem, { sx: { width: size ?? IMAGE_SIZE, height: size ?? IMAGE_SIZE }, onMouseEnter: handleOnMouseEnter, onMouseLeave: handleOnMouseLeave, children: [
|
|
1541
|
+
/* @__PURE__ */ jsx8(
|
|
1542
|
+
Box2,
|
|
1556
1543
|
{
|
|
1557
1544
|
component: "img",
|
|
1558
1545
|
src: source,
|
|
@@ -1562,21 +1549,30 @@ var GridFileViewerItem = ({ meta, size, itemBar }) => {
|
|
|
1562
1549
|
sx: { cursor: "pointer", objectFit: "contain", width: size ?? IMAGE_SIZE, height: size ?? IMAGE_SIZE }
|
|
1563
1550
|
}
|
|
1564
1551
|
),
|
|
1565
|
-
itemBar !== "hidden" && showItemBar && /* @__PURE__ */
|
|
1552
|
+
itemBar !== "hidden" && showItemBar && /* @__PURE__ */ jsx8(
|
|
1566
1553
|
ImageListItemBar,
|
|
1567
1554
|
{
|
|
1568
|
-
title: /* @__PURE__ */
|
|
1569
|
-
actionIcon: (actions?.download !== false || actions
|
|
1555
|
+
title: /* @__PURE__ */ jsx8(Tooltip, { title: meta.fileName, children: /* @__PURE__ */ jsx8(Box2, { children: meta.fileName }) }),
|
|
1556
|
+
actionIcon: (actions?.download !== false || actions.delete !== false) && /* @__PURE__ */ jsx8(IconButton, { sx: { color: grey[100] }, onClick: openMenu, children: /* @__PURE__ */ jsx8(MoreVert, {}) })
|
|
1570
1557
|
}
|
|
1571
1558
|
)
|
|
1572
1559
|
] }),
|
|
1573
|
-
(actions?.download !== false || actions
|
|
1560
|
+
(actions?.download !== false || actions.delete !== false) && /* @__PURE__ */ jsx8(ActionsMenu, { meta, menu, setMenu })
|
|
1574
1561
|
] });
|
|
1575
1562
|
};
|
|
1563
|
+
|
|
1564
|
+
// src/components/file/fileViewer/FileViewerList.tsx
|
|
1565
|
+
import AttachFile from "@mui/icons-material/AttachFile";
|
|
1566
|
+
import Image from "@mui/icons-material/Image";
|
|
1567
|
+
import MoreVert2 from "@mui/icons-material/MoreVert";
|
|
1568
|
+
import SmartDisplay from "@mui/icons-material/SmartDisplay";
|
|
1569
|
+
import { IconButton as IconButton2, List as List2, ListItemButton as ListItemButton2, ListItemIcon as ListItemIcon2, ListItemText as ListItemText2 } from "@mui/material";
|
|
1570
|
+
import { Fragment as Fragment2, useState as useState4 } from "react";
|
|
1571
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1576
1572
|
var FileViewerList = ({ sx }) => {
|
|
1577
1573
|
const { fileMetas } = useFile();
|
|
1578
|
-
return /* @__PURE__ */
|
|
1579
|
-
(fileMeta) => /* @__PURE__ */
|
|
1574
|
+
return /* @__PURE__ */ jsx9(List2, { dense: true, sx, children: fileMetas.map(
|
|
1575
|
+
(fileMeta) => /* @__PURE__ */ jsx9(
|
|
1580
1576
|
ListFileViewerItem,
|
|
1581
1577
|
{
|
|
1582
1578
|
meta: fileMeta
|
|
@@ -1587,7 +1583,7 @@ var FileViewerList = ({ sx }) => {
|
|
|
1587
1583
|
};
|
|
1588
1584
|
var ListFileViewerItem = ({ meta }) => {
|
|
1589
1585
|
const { setImageId, actions } = useFile();
|
|
1590
|
-
const [menu, setMenu] =
|
|
1586
|
+
const [menu, setMenu] = useState4(null);
|
|
1591
1587
|
const openMenu = (event) => {
|
|
1592
1588
|
event.stopPropagation();
|
|
1593
1589
|
setMenu(menu === null ? { mouseX: event.clientX, mouseY: event.clientY } : null);
|
|
@@ -1613,31 +1609,37 @@ var ListFileViewerItem = ({ meta }) => {
|
|
|
1613
1609
|
const icon = () => {
|
|
1614
1610
|
switch (meta.mediaType) {
|
|
1615
1611
|
case "image": {
|
|
1616
|
-
return /* @__PURE__ */
|
|
1612
|
+
return /* @__PURE__ */ jsx9(Image, {});
|
|
1617
1613
|
}
|
|
1618
1614
|
case "video": {
|
|
1619
|
-
return /* @__PURE__ */
|
|
1615
|
+
return /* @__PURE__ */ jsx9(SmartDisplay, {});
|
|
1620
1616
|
}
|
|
1621
1617
|
default: {
|
|
1622
|
-
return /* @__PURE__ */
|
|
1618
|
+
return /* @__PURE__ */ jsx9(AttachFile, {});
|
|
1623
1619
|
}
|
|
1624
1620
|
}
|
|
1625
1621
|
};
|
|
1626
|
-
return /* @__PURE__ */
|
|
1627
|
-
/* @__PURE__ */
|
|
1628
|
-
/* @__PURE__ */
|
|
1629
|
-
/* @__PURE__ */
|
|
1630
|
-
(actions?.download !== false || actions
|
|
1622
|
+
return /* @__PURE__ */ jsxs7(Fragment2, { children: [
|
|
1623
|
+
/* @__PURE__ */ jsxs7(ListItemButton2, { onClick, children: [
|
|
1624
|
+
/* @__PURE__ */ jsx9(ListItemIcon2, { children: icon() }),
|
|
1625
|
+
/* @__PURE__ */ jsx9(ListItemText2, { primary: `${meta.fileName}.${meta.fileExtension}` }),
|
|
1626
|
+
(actions?.download !== false || actions.delete !== false) && /* @__PURE__ */ jsx9(IconButton2, { edge: "end", onClick: openMenu, children: /* @__PURE__ */ jsx9(MoreVert2, {}) })
|
|
1631
1627
|
] }, meta.id),
|
|
1632
|
-
(actions?.download !== false || actions
|
|
1628
|
+
(actions?.download !== false || actions.delete !== false) && /* @__PURE__ */ jsx9(ActionsMenu, { meta, menu, setMenu })
|
|
1633
1629
|
] });
|
|
1634
1630
|
};
|
|
1631
|
+
|
|
1632
|
+
// src/components/file/fileViewer/ImageViewer.tsx
|
|
1633
|
+
import Close from "@mui/icons-material/Close";
|
|
1634
|
+
import { Box as Box3, Dialog as Dialog2, Fab } from "@mui/material";
|
|
1635
|
+
import { useEffect as useEffect3 } from "react";
|
|
1636
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1635
1637
|
var ImageViewer = ({ metaId }) => {
|
|
1636
1638
|
const { fileMetas, setImageId } = useFile();
|
|
1637
1639
|
const meta = fileMetas.find((m) => m.id === metaId);
|
|
1638
1640
|
const { data: source } = useGetFile(meta);
|
|
1639
|
-
|
|
1640
|
-
if (
|
|
1641
|
+
useEffect3(() => {
|
|
1642
|
+
if (metaId)
|
|
1641
1643
|
globalThis.addEventListener("keydown", handleOnKeydown);
|
|
1642
1644
|
return () => {
|
|
1643
1645
|
globalThis.removeEventListener("keydown", handleOnKeydown);
|
|
@@ -1674,21 +1676,28 @@ var ImageViewer = ({ metaId }) => {
|
|
|
1674
1676
|
};
|
|
1675
1677
|
const onClose = () => setImageId("");
|
|
1676
1678
|
if (!metaId) return null;
|
|
1677
|
-
return /* @__PURE__ */
|
|
1678
|
-
/* @__PURE__ */
|
|
1679
|
-
/* @__PURE__ */
|
|
1679
|
+
return /* @__PURE__ */ jsxs8(Dialog2, { open: true, onClose, maxWidth: "xl", children: [
|
|
1680
|
+
/* @__PURE__ */ jsx10(Box3, { component: "img", src: source, alt: metaId, sx: { maxWidth: "100vw", maxHeight: { xs: "calc(100vh - 56px)", sm: "calc(100vh - 64px)" } } }),
|
|
1681
|
+
/* @__PURE__ */ jsx10(Fab, { size: "medium", onClick: onClose, sx: { position: "fixed", top: 8, right: 8 }, children: /* @__PURE__ */ jsx10(Close, {}) })
|
|
1680
1682
|
] });
|
|
1681
1683
|
};
|
|
1684
|
+
|
|
1685
|
+
// src/components/file/FileViewer.tsx
|
|
1686
|
+
import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1682
1687
|
var FileViewer = ({ subId, onDelete, actions, children }) => {
|
|
1683
1688
|
const { data: fileMetas = [] } = useGetFileMetas(subId, { enabled: !!subId });
|
|
1684
|
-
const [imageId, setImageId] =
|
|
1689
|
+
const [imageId, setImageId] = useState5("");
|
|
1685
1690
|
const components = { Grid: FileViewerGrid, List: FileViewerList };
|
|
1686
1691
|
if (fileMetas.length === 0) return null;
|
|
1687
|
-
return /* @__PURE__ */
|
|
1692
|
+
return /* @__PURE__ */ jsxs9(FileContext.Provider, { value: { fileMetas, onDelete, actions, setImageId }, children: [
|
|
1688
1693
|
children(components),
|
|
1689
|
-
/* @__PURE__ */
|
|
1694
|
+
/* @__PURE__ */ jsx11(ImageViewer, { metaId: imageId })
|
|
1690
1695
|
] });
|
|
1691
1696
|
};
|
|
1697
|
+
|
|
1698
|
+
// src/components/data-grid/ChipInputCell.tsx
|
|
1699
|
+
import { Chip as Chip2, Stack as Stack4 } from "@mui/material";
|
|
1700
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
1692
1701
|
var isArray = (value) => Array.isArray(value);
|
|
1693
1702
|
var ChipInputCell = ({ params, slotProps, getLabel }) => {
|
|
1694
1703
|
if (!params.value) return null;
|
|
@@ -1697,71 +1706,120 @@ var ChipInputCell = ({ params, slotProps, getLabel }) => {
|
|
|
1697
1706
|
return value;
|
|
1698
1707
|
};
|
|
1699
1708
|
if (isArray(params.value))
|
|
1700
|
-
return /* @__PURE__ */
|
|
1701
|
-
(value, index) => /* @__PURE__ */
|
|
1709
|
+
return /* @__PURE__ */ jsx12(Stack4, { direction: "row", alignItems: "center", gap: 1, sx: { overflowX: "auto", height: "100%", width: params.colDef.computedWidth }, children: params.value.map(
|
|
1710
|
+
(value, index) => /* @__PURE__ */ jsx12(Chip2, { label: getLabelValue(value), ...slotProps }, `${index + 1}-chip-input-cell`)
|
|
1702
1711
|
) });
|
|
1703
|
-
return /* @__PURE__ */
|
|
1712
|
+
return /* @__PURE__ */ jsx12(Chip2, { label: getLabelValue(params.value), ...slotProps });
|
|
1704
1713
|
};
|
|
1714
|
+
|
|
1715
|
+
// src/components/data-grid/EditableColumnHeader.tsx
|
|
1716
|
+
import Edit from "@mui/icons-material/Edit";
|
|
1717
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1705
1718
|
var EditableColumnHeader = ({ colDef }) => {
|
|
1706
|
-
return /* @__PURE__ */
|
|
1719
|
+
return /* @__PURE__ */ jsx13(TypographyWithIcon, { endIcon: /* @__PURE__ */ jsx13(Edit, { color: "disabled", fontSize: "small" }), variant: "body2", className: "MuiDataGrid-columnHeaderTitle", children: colDef.headerName });
|
|
1707
1720
|
};
|
|
1708
|
-
|
|
1709
|
-
|
|
1721
|
+
|
|
1722
|
+
// src/components/router/RouterButton.tsx
|
|
1723
|
+
import { Button as Button2 } from "@mui/material";
|
|
1724
|
+
import { createLink } from "@tanstack/react-router";
|
|
1725
|
+
import React3 from "react";
|
|
1726
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
1727
|
+
var Component = React3.forwardRef(function ButtonComponent(props, reference) {
|
|
1728
|
+
return /* @__PURE__ */ jsx14(Button2, { ref: reference, component: "a", ...props });
|
|
1710
1729
|
});
|
|
1711
1730
|
var CreatedComponent = createLink(Component);
|
|
1712
1731
|
var RouterButton = (props) => {
|
|
1713
|
-
return /* @__PURE__ */
|
|
1732
|
+
return /* @__PURE__ */ jsx14(CreatedComponent, { ...props });
|
|
1714
1733
|
};
|
|
1715
|
-
|
|
1734
|
+
|
|
1735
|
+
// src/components/router/RouterGridActionsCellItem.tsx
|
|
1736
|
+
import { GridActionsCellItem } from "@mui/x-data-grid-premium";
|
|
1737
|
+
import { createLink as createLink2 } from "@tanstack/react-router";
|
|
1738
|
+
import React4 from "react";
|
|
1739
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1740
|
+
var Component2 = React4.forwardRef(
|
|
1716
1741
|
function GridActionsCellItemComponent(props, reference) {
|
|
1717
|
-
return /* @__PURE__ */
|
|
1742
|
+
return /* @__PURE__ */ jsx15(GridActionsCellItem, { ref: reference, component: "a", ...props });
|
|
1718
1743
|
}
|
|
1719
1744
|
);
|
|
1720
|
-
var CreatedComponent2 =
|
|
1745
|
+
var CreatedComponent2 = createLink2(Component2);
|
|
1721
1746
|
var RouterGridActionsCellItem = (props) => {
|
|
1722
|
-
return /* @__PURE__ */
|
|
1747
|
+
return /* @__PURE__ */ jsx15(CreatedComponent2, { ...props });
|
|
1723
1748
|
};
|
|
1724
|
-
|
|
1725
|
-
|
|
1749
|
+
|
|
1750
|
+
// src/components/router/RouterIconButton.tsx
|
|
1751
|
+
import { IconButton as IconButton3 } from "@mui/material";
|
|
1752
|
+
import { createLink as createLink3 } from "@tanstack/react-router";
|
|
1753
|
+
import React5 from "react";
|
|
1754
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1755
|
+
var Component3 = React5.forwardRef(function IconButtonComponent(props, reference) {
|
|
1756
|
+
return /* @__PURE__ */ jsx16(IconButton3, { ref: reference, component: "a", ...props });
|
|
1726
1757
|
});
|
|
1727
|
-
var CreatedComponent3 =
|
|
1758
|
+
var CreatedComponent3 = createLink3(Component3);
|
|
1728
1759
|
var RouterIconButton = (props) => {
|
|
1729
|
-
return /* @__PURE__ */
|
|
1760
|
+
return /* @__PURE__ */ jsx16(CreatedComponent3, { ...props });
|
|
1730
1761
|
};
|
|
1731
|
-
|
|
1732
|
-
|
|
1762
|
+
|
|
1763
|
+
// src/components/router/RouterLink.tsx
|
|
1764
|
+
import { Link } from "@mui/material";
|
|
1765
|
+
import { createLink as createLink4 } from "@tanstack/react-router";
|
|
1766
|
+
import React6 from "react";
|
|
1767
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1768
|
+
var Component4 = React6.forwardRef(function LinkComponent(props, reference) {
|
|
1769
|
+
return /* @__PURE__ */ jsx17(Link, { ref: reference, ...props });
|
|
1733
1770
|
});
|
|
1734
|
-
var CreatedComponent4 =
|
|
1771
|
+
var CreatedComponent4 = createLink4(Component4);
|
|
1735
1772
|
var RouterLink = (props) => {
|
|
1736
|
-
return /* @__PURE__ */
|
|
1773
|
+
return /* @__PURE__ */ jsx17(CreatedComponent4, { ...props });
|
|
1737
1774
|
};
|
|
1738
|
-
|
|
1739
|
-
|
|
1775
|
+
|
|
1776
|
+
// src/components/router/RouterTab.tsx
|
|
1777
|
+
import { Tab } from "@mui/material";
|
|
1778
|
+
import { createLink as createLink5 } from "@tanstack/react-router";
|
|
1779
|
+
import React7 from "react";
|
|
1780
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1781
|
+
var Component5 = React7.forwardRef(function TabComponent(props, reference) {
|
|
1782
|
+
return /* @__PURE__ */ jsx18(Tab, { ref: reference, component: "a", ...props });
|
|
1740
1783
|
});
|
|
1741
|
-
var CreatedComponent5 =
|
|
1784
|
+
var CreatedComponent5 = createLink5(Component5);
|
|
1742
1785
|
var RouterTab = (props) => {
|
|
1743
|
-
return /* @__PURE__ */
|
|
1786
|
+
return /* @__PURE__ */ jsx18(CreatedComponent5, { ...props });
|
|
1744
1787
|
};
|
|
1745
|
-
|
|
1746
|
-
|
|
1788
|
+
|
|
1789
|
+
// src/components/router/RouterListItemButton.tsx
|
|
1790
|
+
import { ListItemButton as ListItemButton3 } from "@mui/material";
|
|
1791
|
+
import { createLink as createLink6 } from "@tanstack/react-router";
|
|
1792
|
+
import React8 from "react";
|
|
1793
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1794
|
+
var Component6 = React8.forwardRef(function ButtonComponent2(props, reference) {
|
|
1795
|
+
return /* @__PURE__ */ jsx19(ListItemButton3, { ref: reference, component: "a", ...props });
|
|
1747
1796
|
});
|
|
1748
|
-
var CreatedComponent6 =
|
|
1797
|
+
var CreatedComponent6 = createLink6(Component6);
|
|
1749
1798
|
var RouterListItemButton = (props) => {
|
|
1750
|
-
return /* @__PURE__ */
|
|
1799
|
+
return /* @__PURE__ */ jsx19(CreatedComponent6, { ...props });
|
|
1751
1800
|
};
|
|
1801
|
+
|
|
1802
|
+
// src/components/router/RouterNotFound.tsx
|
|
1803
|
+
import { Box as Box4, Divider, Typography as Typography5 } from "@mui/material";
|
|
1804
|
+
import { useTranslation as useTranslation4 } from "react-i18next";
|
|
1805
|
+
import { jsx as jsx20, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1752
1806
|
function RouterNotFound() {
|
|
1753
|
-
const { t: t2 } =
|
|
1754
|
-
return /* @__PURE__ */
|
|
1755
|
-
/* @__PURE__ */
|
|
1756
|
-
/* @__PURE__ */
|
|
1757
|
-
/* @__PURE__ */
|
|
1807
|
+
const { t: t2 } = useTranslation4();
|
|
1808
|
+
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: [
|
|
1809
|
+
/* @__PURE__ */ jsx20(Typography5, { variant: "h3", component: "span", fontWeight: 500, sx: { lineHeight: 1 }, children: "404" }),
|
|
1810
|
+
/* @__PURE__ */ jsx20(Divider, { orientation: "vertical", flexItem: true, sx: { mx: 3 } }),
|
|
1811
|
+
/* @__PURE__ */ jsx20(Typography5, { variant: "h5", component: "span", children: t2("Layout.ThisPageCouldNotBeFound") })
|
|
1758
1812
|
] }) });
|
|
1759
1813
|
}
|
|
1814
|
+
|
|
1815
|
+
// src/components/router/RouterError.tsx
|
|
1816
|
+
import { Box as Box5, Divider as Divider2, Typography as Typography6 } from "@mui/material";
|
|
1817
|
+
import { jsx as jsx21, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1760
1818
|
var RouterError = ({ error }) => {
|
|
1761
|
-
return /* @__PURE__ */
|
|
1762
|
-
/* @__PURE__ */
|
|
1763
|
-
/* @__PURE__ */
|
|
1764
|
-
/* @__PURE__ */
|
|
1819
|
+
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: [
|
|
1820
|
+
/* @__PURE__ */ jsx21(Typography6, { variant: "h3", component: "span", fontWeight: 500, sx: { lineHeight: 1 }, children: error.name || "500" }),
|
|
1821
|
+
/* @__PURE__ */ jsx21(Divider2, { orientation: "vertical", flexItem: true, sx: { mx: 3 } }),
|
|
1822
|
+
/* @__PURE__ */ jsx21(Typography6, { variant: "h5", component: "span", children: error.message })
|
|
1765
1823
|
] }) });
|
|
1766
1824
|
};
|
|
1767
1825
|
|
|
@@ -1788,9 +1846,12 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
1788
1846
|
}
|
|
1789
1847
|
|
|
1790
1848
|
// node_modules/@mui/x-date-pickers/esm/LocalizationProvider/LocalizationProvider.js
|
|
1791
|
-
var import_prop_types = __toESM(require_prop_types());
|
|
1849
|
+
var import_prop_types = __toESM(require_prop_types(), 1);
|
|
1850
|
+
import * as React9 from "react";
|
|
1851
|
+
import { useThemeProps } from "@mui/material/styles";
|
|
1852
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1792
1853
|
var _excluded = ["localeText"];
|
|
1793
|
-
var PickerAdapterContext = /* @__PURE__ */
|
|
1854
|
+
var PickerAdapterContext = /* @__PURE__ */ React9.createContext(null);
|
|
1794
1855
|
if (process.env.NODE_ENV !== "production") PickerAdapterContext.displayName = "PickerAdapterContext";
|
|
1795
1856
|
var LocalizationProvider = function LocalizationProvider2(inProps) {
|
|
1796
1857
|
const {
|
|
@@ -1799,7 +1860,8 @@ var LocalizationProvider = function LocalizationProvider2(inProps) {
|
|
|
1799
1860
|
const {
|
|
1800
1861
|
adapter: parentAdapter,
|
|
1801
1862
|
localeText: parentLocaleText
|
|
1802
|
-
} =
|
|
1863
|
+
} = React9.useContext(PickerAdapterContext) ?? {
|
|
1864
|
+
utils: void 0,
|
|
1803
1865
|
adapter: void 0,
|
|
1804
1866
|
localeText: void 0
|
|
1805
1867
|
};
|
|
@@ -1817,8 +1879,8 @@ var LocalizationProvider = function LocalizationProvider2(inProps) {
|
|
|
1817
1879
|
adapterLocale,
|
|
1818
1880
|
localeText: themeLocaleText
|
|
1819
1881
|
} = props;
|
|
1820
|
-
const localeText =
|
|
1821
|
-
const adapter =
|
|
1882
|
+
const localeText = React9.useMemo(() => _extends({}, themeLocaleText, parentLocaleText, inLocaleText), [themeLocaleText, parentLocaleText, inLocaleText]);
|
|
1883
|
+
const adapter = React9.useMemo(() => {
|
|
1822
1884
|
if (!DateAdapter) {
|
|
1823
1885
|
if (parentAdapter) {
|
|
1824
1886
|
return parentAdapter;
|
|
@@ -1836,7 +1898,7 @@ var LocalizationProvider = function LocalizationProvider2(inProps) {
|
|
|
1836
1898
|
}
|
|
1837
1899
|
return dateAdapter;
|
|
1838
1900
|
}, [DateAdapter, adapterLocale, dateFormats, dateLibInstance, parentAdapter]);
|
|
1839
|
-
const defaultDates =
|
|
1901
|
+
const defaultDates = React9.useMemo(() => {
|
|
1840
1902
|
if (!adapter) {
|
|
1841
1903
|
return null;
|
|
1842
1904
|
}
|
|
@@ -1845,7 +1907,7 @@ var LocalizationProvider = function LocalizationProvider2(inProps) {
|
|
|
1845
1907
|
maxDate: adapter.date("2099-12-31T00:00:00.000")
|
|
1846
1908
|
};
|
|
1847
1909
|
}, [adapter]);
|
|
1848
|
-
const contextValue =
|
|
1910
|
+
const contextValue = React9.useMemo(() => {
|
|
1849
1911
|
return {
|
|
1850
1912
|
utils: adapter,
|
|
1851
1913
|
adapter,
|
|
@@ -1853,7 +1915,7 @@ var LocalizationProvider = function LocalizationProvider2(inProps) {
|
|
|
1853
1915
|
localeText
|
|
1854
1916
|
};
|
|
1855
1917
|
}, [defaultDates, adapter, localeText]);
|
|
1856
|
-
return /* @__PURE__ */
|
|
1918
|
+
return /* @__PURE__ */ _jsx(PickerAdapterContext.Provider, {
|
|
1857
1919
|
value: contextValue,
|
|
1858
1920
|
children
|
|
1859
1921
|
});
|
|
@@ -1913,6 +1975,27 @@ process.env.NODE_ENV !== "production" ? LocalizationProvider.propTypes = {
|
|
|
1913
1975
|
localeText: import_prop_types.default.object
|
|
1914
1976
|
} : void 0;
|
|
1915
1977
|
|
|
1978
|
+
// node_modules/@mui/utils/esm/useEventCallback/useEventCallback.js
|
|
1979
|
+
import * as React11 from "react";
|
|
1980
|
+
|
|
1981
|
+
// node_modules/@mui/utils/esm/useEnhancedEffect/useEnhancedEffect.js
|
|
1982
|
+
import * as React10 from "react";
|
|
1983
|
+
var useEnhancedEffect = typeof window !== "undefined" ? React10.useLayoutEffect : React10.useEffect;
|
|
1984
|
+
var useEnhancedEffect_default = useEnhancedEffect;
|
|
1985
|
+
|
|
1986
|
+
// node_modules/@mui/utils/esm/useEventCallback/useEventCallback.js
|
|
1987
|
+
function useEventCallback2(fn) {
|
|
1988
|
+
const ref = React11.useRef(fn);
|
|
1989
|
+
useEnhancedEffect_default(() => {
|
|
1990
|
+
ref.current = fn;
|
|
1991
|
+
});
|
|
1992
|
+
return React11.useRef((...args) => (
|
|
1993
|
+
// @ts-expect-error hide `this`
|
|
1994
|
+
(0, ref.current)(...args)
|
|
1995
|
+
)).current;
|
|
1996
|
+
}
|
|
1997
|
+
var useEventCallback_default = useEventCallback2;
|
|
1998
|
+
|
|
1916
1999
|
// node_modules/@mui/x-internals/esm/warning/warning.js
|
|
1917
2000
|
var warnedOnceCache = /* @__PURE__ */ new Set();
|
|
1918
2001
|
function warnOnce(message, gravity = "warning") {
|
|
@@ -1929,6 +2012,14 @@ function warnOnce(message, gravity = "warning") {
|
|
|
1929
2012
|
}
|
|
1930
2013
|
}
|
|
1931
2014
|
}
|
|
2015
|
+
|
|
2016
|
+
// node_modules/@mui/x-date-pickers/esm/AdapterDayjs/AdapterDayjs.js
|
|
2017
|
+
import dayjs from "dayjs";
|
|
2018
|
+
import weekOfYearPlugin from "dayjs/plugin/weekOfYear.js";
|
|
2019
|
+
import customParseFormatPlugin from "dayjs/plugin/customParseFormat.js";
|
|
2020
|
+
import localizedFormatPlugin from "dayjs/plugin/localizedFormat.js";
|
|
2021
|
+
import isBetweenPlugin from "dayjs/plugin/isBetween.js";
|
|
2022
|
+
import advancedFormatPlugin from "dayjs/plugin/advancedFormat.js";
|
|
1932
2023
|
dayjs.extend(localizedFormatPlugin);
|
|
1933
2024
|
dayjs.extend(weekOfYearPlugin);
|
|
1934
2025
|
dayjs.extend(isBetweenPlugin);
|
|
@@ -2410,65 +2501,147 @@ var AdapterDayjs = class {
|
|
|
2410
2501
|
return years;
|
|
2411
2502
|
};
|
|
2412
2503
|
};
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2504
|
+
|
|
2505
|
+
// src/providers/LayoutProvider.tsx
|
|
2506
|
+
import { useEffect as useEffect6, useState as useState10 } from "react";
|
|
2507
|
+
import { useTranslation as useTranslation6 } from "react-i18next";
|
|
2508
|
+
import * as z from "zod";
|
|
2509
|
+
import { cs, en } from "zod/locales";
|
|
2510
|
+
|
|
2511
|
+
// src/providers/DialogsProvider.tsx
|
|
2512
|
+
import { useCallback, useId, useMemo as useMemo3, useRef as useRef3, useState as useState6 } from "react";
|
|
2513
|
+
import { jsx as jsx22, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2514
|
+
function DialogsProvider({ children, unmountAfter = 1e3 }) {
|
|
2515
|
+
const [stack, setStack] = useState6([]);
|
|
2516
|
+
const keyPrefix = useId();
|
|
2517
|
+
const nextId = useRef3(0);
|
|
2518
|
+
const dialogMetadata = useRef3(/* @__PURE__ */ new WeakMap());
|
|
2519
|
+
const requestDialog = useEventCallback_default(function open(Component7, payload, options = {}) {
|
|
2520
|
+
const { onClose = async () => {
|
|
2521
|
+
} } = options;
|
|
2522
|
+
let resolve;
|
|
2523
|
+
const promise = new Promise((resolveImpl) => {
|
|
2524
|
+
resolve = resolveImpl;
|
|
2525
|
+
});
|
|
2526
|
+
const key = `${keyPrefix}-${nextId.current}`;
|
|
2527
|
+
nextId.current += 1;
|
|
2528
|
+
const newEntry = {
|
|
2529
|
+
key,
|
|
2530
|
+
open: true,
|
|
2531
|
+
promise,
|
|
2532
|
+
Component: Component7,
|
|
2533
|
+
payload,
|
|
2534
|
+
onClose,
|
|
2535
|
+
resolve
|
|
2536
|
+
};
|
|
2537
|
+
dialogMetadata.current.set(promise, newEntry);
|
|
2538
|
+
setStack((previousStack) => [...previousStack, newEntry]);
|
|
2539
|
+
return promise;
|
|
2540
|
+
});
|
|
2541
|
+
const removeDialogFromStack = useCallback((dialog) => {
|
|
2542
|
+
setStack((previousStack) => previousStack.filter((entry) => entry.promise !== dialog));
|
|
2543
|
+
dialogMetadata.current.delete(dialog);
|
|
2544
|
+
}, []);
|
|
2545
|
+
const closeDialogUi = useEventCallback_default(function closeDialogUi2(dialog) {
|
|
2546
|
+
setStack(
|
|
2547
|
+
(previousStack) => previousStack.map((entry) => entry.promise === dialog ? { ...entry, open: false } : entry)
|
|
2548
|
+
);
|
|
2549
|
+
setTimeout(() => removeDialogFromStack(dialog), unmountAfter);
|
|
2550
|
+
});
|
|
2551
|
+
const closeDialog = useEventCallback_default(async function closeDialog2(dialog, result) {
|
|
2552
|
+
const entryToClose = dialogMetadata.current.get(dialog);
|
|
2553
|
+
if (!entryToClose) {
|
|
2554
|
+
throw new Error("Dialog not found in stack");
|
|
2555
|
+
}
|
|
2556
|
+
try {
|
|
2557
|
+
await entryToClose.onClose(result);
|
|
2558
|
+
} finally {
|
|
2559
|
+
entryToClose.resolve(result);
|
|
2560
|
+
closeDialogUi(dialog);
|
|
2561
|
+
}
|
|
2562
|
+
return dialog;
|
|
2563
|
+
});
|
|
2564
|
+
const contextValue = useMemo3(() => ({ open: requestDialog, close: closeDialog }), [requestDialog, closeDialog]);
|
|
2565
|
+
return /* @__PURE__ */ jsxs12(DialogsContext.Provider, { value: contextValue, children: [
|
|
2566
|
+
children,
|
|
2567
|
+
stack.map(({ key, open, Component: Component7, payload, promise }) => /* @__PURE__ */ jsx22(
|
|
2568
|
+
Component7,
|
|
2569
|
+
{
|
|
2570
|
+
payload,
|
|
2571
|
+
open,
|
|
2572
|
+
onClose: async (result) => {
|
|
2573
|
+
await closeDialog(promise, result);
|
|
2574
|
+
}
|
|
2436
2575
|
},
|
|
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
|
-
|
|
2576
|
+
key
|
|
2577
|
+
))
|
|
2578
|
+
] });
|
|
2579
|
+
}
|
|
2580
|
+
|
|
2581
|
+
// src/utils/i18n.ts
|
|
2582
|
+
import { createIsomorphicFn } from "@tanstack/react-start";
|
|
2583
|
+
import { getCookie } from "@tanstack/react-start/server";
|
|
2584
|
+
import i18n from "i18next";
|
|
2585
|
+
import LanguageDetector from "i18next-browser-languagedetector";
|
|
2586
|
+
import HttpBackend from "i18next-http-backend";
|
|
2587
|
+
import { initReactI18next } from "react-i18next";
|
|
2588
|
+
import { default as default2 } from "i18next";
|
|
2589
|
+
var i18nCookieName = "i18nextLng";
|
|
2590
|
+
i18n.use(HttpBackend).use(LanguageDetector).use(initReactI18next).init({
|
|
2591
|
+
fallbackLng: "en",
|
|
2592
|
+
detection: {
|
|
2593
|
+
order: ["cookie"],
|
|
2594
|
+
lookupCookie: i18nCookieName,
|
|
2595
|
+
caches: ["cookie"],
|
|
2596
|
+
cookieMinutes: 60 * 24 * 365
|
|
2597
|
+
},
|
|
2598
|
+
interpolation: { escapeValue: false }
|
|
2599
|
+
});
|
|
2600
|
+
var setSSRLanguage = createIsomorphicFn().server(async () => {
|
|
2601
|
+
const language = getCookie(i18nCookieName);
|
|
2602
|
+
await i18n.changeLanguage(language || "en");
|
|
2603
|
+
});
|
|
2604
|
+
|
|
2605
|
+
// src/contexts/LayoutContext.ts
|
|
2606
|
+
import { createContext as createContext4, useContext as useContext4 } from "react";
|
|
2607
|
+
var LayoutContext = createContext4(null);
|
|
2608
|
+
|
|
2609
|
+
// src/components/core/Layout.tsx
|
|
2610
|
+
import Menu3 from "@mui/icons-material/Menu";
|
|
2611
|
+
import MenuOpen from "@mui/icons-material/MenuOpen";
|
|
2612
|
+
import { AppBar, Box as Box9, CssBaseline, IconButton as IconButton5, InitColorSchemeScript, LinearProgress, Toolbar } from "@mui/material";
|
|
2613
|
+
import { ThemeProvider, createTheme, styled as styled2 } from "@mui/material/styles";
|
|
2614
|
+
import { useIsFetching, useIsMutating } from "@tanstack/react-query";
|
|
2615
|
+
import useLocalStorageState from "use-local-storage-state";
|
|
2616
|
+
|
|
2617
|
+
// src/components/core/navigation/NavigationRail.tsx
|
|
2618
|
+
import { useMediaQuery } from "@mui/material";
|
|
2619
|
+
import Box7 from "@mui/material/Box";
|
|
2620
|
+
import Drawer from "@mui/material/Drawer";
|
|
2621
|
+
import { useTheme as useTheme2 } from "@mui/material/styles";
|
|
2622
|
+
import { useNavigate, useRouterState as useRouterState2 } from "@tanstack/react-router";
|
|
2623
|
+
|
|
2624
|
+
// src/components/core/navigation/NavigationList.tsx
|
|
2625
|
+
import Divider3 from "@mui/material/Divider";
|
|
2626
|
+
import List3 from "@mui/material/List";
|
|
2627
|
+
import ListSubheader from "@mui/material/ListSubheader";
|
|
2628
|
+
import { Fragment as Fragment5, useEffect as useEffect5, useState as useState8 } from "react";
|
|
2629
|
+
|
|
2630
|
+
// src/components/core/navigation/NavigationListItem.tsx
|
|
2631
|
+
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
|
|
2632
|
+
import Avatar from "@mui/material/Avatar";
|
|
2633
|
+
import Box6 from "@mui/material/Box";
|
|
2634
|
+
import Popper from "@mui/material/Popper";
|
|
2635
|
+
import ListItem from "@mui/material/ListItem";
|
|
2636
|
+
import ListItemButton4 from "@mui/material/ListItemButton";
|
|
2637
|
+
import ListItemIcon3 from "@mui/material/ListItemIcon";
|
|
2638
|
+
import ListItemText3 from "@mui/material/ListItemText";
|
|
2639
|
+
import Paper2 from "@mui/material/Paper";
|
|
2640
|
+
import { styled } from "@mui/material/styles";
|
|
2641
|
+
import Typography7 from "@mui/material/Typography";
|
|
2642
|
+
import { Fragment as Fragment3, useMemo as useMemo4, useState as useState7 } from "react";
|
|
2643
|
+
import { Collapse } from "@mui/material";
|
|
2644
|
+
import { Fragment as Fragment4, jsx as jsx23, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2472
2645
|
var ICON_SIZE = 34;
|
|
2473
2646
|
var StyledNavButton = styled(ListItemButton4)(({ theme }) => ({
|
|
2474
2647
|
borderRadius: 8,
|
|
@@ -2512,12 +2685,12 @@ var StyledRouterButton = styled(RouterListItemButton)(({ theme }) => ({
|
|
|
2512
2685
|
}));
|
|
2513
2686
|
var IconOrAvatar = ({ item, collapsed }) => {
|
|
2514
2687
|
if (item.icon || collapsed) {
|
|
2515
|
-
return /* @__PURE__ */
|
|
2516
|
-
/* @__PURE__ */
|
|
2688
|
+
return /* @__PURE__ */ jsxs13(Box6, { sx: collapsed ? { position: "absolute", left: "50%", top: "calc(50% - 6px)", transform: "translate(-50%, -50%)" } : {}, children: [
|
|
2689
|
+
/* @__PURE__ */ jsxs13(ListItemIcon3, { sx: { display: "flex", alignItems: "center", justifyContent: "center", minWidth: ICON_SIZE }, children: [
|
|
2517
2690
|
item.icon ?? null,
|
|
2518
|
-
!item.icon && collapsed ? /* @__PURE__ */
|
|
2691
|
+
!item.icon && collapsed ? /* @__PURE__ */ jsx23(Avatar, { sx: { width: ICON_SIZE - 7, height: ICON_SIZE - 7, fontSize: 12 }, children: item.title }) : null
|
|
2519
2692
|
] }),
|
|
2520
|
-
collapsed ? /* @__PURE__ */
|
|
2693
|
+
collapsed ? /* @__PURE__ */ jsx23(
|
|
2521
2694
|
Typography7,
|
|
2522
2695
|
{
|
|
2523
2696
|
variant: "caption",
|
|
@@ -2541,7 +2714,7 @@ var IconOrAvatar = ({ item, collapsed }) => {
|
|
|
2541
2714
|
}
|
|
2542
2715
|
return null;
|
|
2543
2716
|
};
|
|
2544
|
-
var MiniPopover = ({ open, anchorEl, children }) => /* @__PURE__ */
|
|
2717
|
+
var MiniPopover = ({ open, anchorEl, children }) => /* @__PURE__ */ jsx23(
|
|
2545
2718
|
Popper,
|
|
2546
2719
|
{
|
|
2547
2720
|
open,
|
|
@@ -2552,7 +2725,7 @@ var MiniPopover = ({ open, anchorEl, children }) => /* @__PURE__ */ jsx(
|
|
|
2552
2725
|
{ name: "preventOverflow", options: { padding: 8 } },
|
|
2553
2726
|
{ name: "flip", options: { fallbackPlacements: ["right-end", "left-start"] } }
|
|
2554
2727
|
],
|
|
2555
|
-
children: /* @__PURE__ */
|
|
2728
|
+
children: /* @__PURE__ */ jsx23(
|
|
2556
2729
|
Paper2,
|
|
2557
2730
|
{
|
|
2558
2731
|
sx: {
|
|
@@ -2568,9 +2741,9 @@ var MiniPopover = ({ open, anchorEl, children }) => /* @__PURE__ */ jsx(
|
|
|
2568
2741
|
}
|
|
2569
2742
|
);
|
|
2570
2743
|
var NavigationListItem = ({ item, isOpen, selected, disabled, collapsed, isSidebarFullyExpanded = true, isSidebarFullyCollapsed, onClick, renderNested }) => {
|
|
2571
|
-
const [hoveredPopoverItem, setHoveredPopoverItem] =
|
|
2572
|
-
const [anchorElement, setAnchorElement] =
|
|
2573
|
-
const chevronSx =
|
|
2744
|
+
const [hoveredPopoverItem, setHoveredPopoverItem] = useState7(null);
|
|
2745
|
+
const [anchorElement, setAnchorElement] = useState7(null);
|
|
2746
|
+
const chevronSx = useMemo4(() => {
|
|
2574
2747
|
if (collapsed && isSidebarFullyCollapsed && item.children) {
|
|
2575
2748
|
return {
|
|
2576
2749
|
fontSize: 18,
|
|
@@ -2594,9 +2767,9 @@ var NavigationListItem = ({ item, isOpen, selected, disabled, collapsed, isSideb
|
|
|
2594
2767
|
disabled,
|
|
2595
2768
|
sx: { px: 1.4, height: collapsed ? 60 : 48 }
|
|
2596
2769
|
};
|
|
2597
|
-
const buttonContent = /* @__PURE__ */
|
|
2598
|
-
/* @__PURE__ */
|
|
2599
|
-
!collapsed && /* @__PURE__ */
|
|
2770
|
+
const buttonContent = /* @__PURE__ */ jsxs13(Fragment4, { children: [
|
|
2771
|
+
/* @__PURE__ */ jsx23(IconOrAvatar, { item, collapsed }),
|
|
2772
|
+
!collapsed && /* @__PURE__ */ jsx23(
|
|
2600
2773
|
ListItemText3,
|
|
2601
2774
|
{
|
|
2602
2775
|
primary: item.title,
|
|
@@ -2604,10 +2777,10 @@ var NavigationListItem = ({ item, isOpen, selected, disabled, collapsed, isSideb
|
|
|
2604
2777
|
sx: { ml: 1.2, flex: 1, minWidth: 0, "& .MuiTypography-root": { whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" } }
|
|
2605
2778
|
}
|
|
2606
2779
|
),
|
|
2607
|
-
item.children ? /* @__PURE__ */
|
|
2780
|
+
item.children ? /* @__PURE__ */ jsx23(ExpandMoreIcon, { sx: chevronSx }) : null
|
|
2608
2781
|
] });
|
|
2609
|
-
const listItem = /* @__PURE__ */
|
|
2610
|
-
ListItem
|
|
2782
|
+
const listItem = /* @__PURE__ */ jsxs13(
|
|
2783
|
+
ListItem,
|
|
2611
2784
|
{
|
|
2612
2785
|
...item.children && collapsed ? {
|
|
2613
2786
|
onMouseEnter: (event) => {
|
|
@@ -2620,7 +2793,7 @@ var NavigationListItem = ({ item, isOpen, selected, disabled, collapsed, isSideb
|
|
|
2620
2793
|
} : {},
|
|
2621
2794
|
sx: { py: 0, px: 1, overflowX: "hidden" },
|
|
2622
2795
|
children: [
|
|
2623
|
-
shouldJustExpand ? /* @__PURE__ */
|
|
2796
|
+
shouldJustExpand ? /* @__PURE__ */ jsx23(StyledNavButton, { ...buttonProps, onClick: () => onClick?.(item), children: buttonContent }) : /* @__PURE__ */ jsx23(
|
|
2624
2797
|
StyledRouterButton,
|
|
2625
2798
|
{
|
|
2626
2799
|
...buttonProps,
|
|
@@ -2631,25 +2804,28 @@ var NavigationListItem = ({ item, isOpen, selected, disabled, collapsed, isSideb
|
|
|
2631
2804
|
children: buttonContent
|
|
2632
2805
|
}
|
|
2633
2806
|
),
|
|
2634
|
-
item.children && collapsed ? /* @__PURE__ */
|
|
2807
|
+
item.children && collapsed ? /* @__PURE__ */ jsx23(MiniPopover, { open: item.title === hoveredPopoverItem, anchorEl: anchorElement, children: renderNested?.(item.children) }) : null
|
|
2635
2808
|
]
|
|
2636
2809
|
}
|
|
2637
2810
|
);
|
|
2638
|
-
return /* @__PURE__ */
|
|
2811
|
+
return /* @__PURE__ */ jsxs13(Fragment3, { children: [
|
|
2639
2812
|
listItem,
|
|
2640
|
-
item.children && !collapsed ? /* @__PURE__ */
|
|
2813
|
+
item.children && !collapsed ? /* @__PURE__ */ jsx23(Collapse, { in: isOpen, timeout: "auto", unmountOnExit: true, children: renderNested?.(item.children) }) : null
|
|
2641
2814
|
] }, item.to);
|
|
2642
2815
|
};
|
|
2816
|
+
|
|
2817
|
+
// src/components/core/navigation/NavigationList.tsx
|
|
2818
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
2643
2819
|
var isPageItem = (item) => !("kind" in item);
|
|
2644
2820
|
var isDivider = (item) => "kind" in item && item.kind === "divider";
|
|
2645
2821
|
var isHeader = (item) => "kind" in item && item.kind === "header";
|
|
2646
2822
|
var NavigationList = ({ subNavigation, depth = 0, collapsed, isPopover, isSidebarFullyExpanded = true, isSidebarFullyCollapsed, expandedWidth, renderItem, activePath, onNavigate }) => {
|
|
2647
|
-
const [openKeys, setOpenKeys] =
|
|
2648
|
-
|
|
2823
|
+
const [openKeys, setOpenKeys] = useState8([]);
|
|
2824
|
+
useEffect5(() => {
|
|
2649
2825
|
if (collapsed) setOpenKeys([]);
|
|
2650
2826
|
}, [collapsed]);
|
|
2651
2827
|
const toggleKey = (key) => setOpenKeys((previous) => previous.includes(key) ? previous.filter((k) => k !== key) : [...previous, key]);
|
|
2652
|
-
const renderNested = (children) => /* @__PURE__ */
|
|
2828
|
+
const renderNested = (children) => /* @__PURE__ */ jsx24(
|
|
2653
2829
|
NavigationList,
|
|
2654
2830
|
{
|
|
2655
2831
|
subNavigation: children,
|
|
@@ -2661,7 +2837,7 @@ var NavigationList = ({ subNavigation, depth = 0, collapsed, isPopover, isSideba
|
|
|
2661
2837
|
}
|
|
2662
2838
|
);
|
|
2663
2839
|
const filteredNavigation = subNavigation.filter((nav) => !nav.hidden);
|
|
2664
|
-
return /* @__PURE__ */
|
|
2840
|
+
return /* @__PURE__ */ jsx24(
|
|
2665
2841
|
List3,
|
|
2666
2842
|
{
|
|
2667
2843
|
sx: {
|
|
@@ -2674,8 +2850,8 @@ var NavigationList = ({ subNavigation, depth = 0, collapsed, isPopover, isSideba
|
|
|
2674
2850
|
},
|
|
2675
2851
|
children: filteredNavigation.map((navItem, index) => {
|
|
2676
2852
|
if (isHeader(navItem)) {
|
|
2677
|
-
return /* @__PURE__ */
|
|
2678
|
-
ListSubheader
|
|
2853
|
+
return /* @__PURE__ */ jsx24(
|
|
2854
|
+
ListSubheader,
|
|
2679
2855
|
{
|
|
2680
2856
|
sx: {
|
|
2681
2857
|
fontSize: 12,
|
|
@@ -2697,13 +2873,13 @@ var NavigationList = ({ subNavigation, depth = 0, collapsed, isPopover, isSideba
|
|
|
2697
2873
|
}
|
|
2698
2874
|
if (isDivider(navItem)) {
|
|
2699
2875
|
const nextItem = filteredNavigation[index + 1];
|
|
2700
|
-
return /* @__PURE__ */
|
|
2876
|
+
return /* @__PURE__ */ jsx24("li", { children: /* @__PURE__ */ jsx24(Divider3, { sx: { mx: 1, mt: 1, mb: isHeader(nextItem) && !collapsed ? 0 : 1 } }) }, `divider-${depth}-${index}`);
|
|
2701
2877
|
}
|
|
2702
2878
|
if (!isPageItem(navItem)) return null;
|
|
2703
2879
|
const key = `item-${depth}-${index}`;
|
|
2704
2880
|
const uniqueItemKey = `${depth}-${index}-${navItem.title}`;
|
|
2705
|
-
if (renderItem) return /* @__PURE__ */
|
|
2706
|
-
return /* @__PURE__ */
|
|
2881
|
+
if (renderItem) return /* @__PURE__ */ jsx24(Fragment5, { children: renderItem(navItem, { collapsed: !!collapsed }) }, key);
|
|
2882
|
+
return /* @__PURE__ */ jsx24(
|
|
2707
2883
|
NavigationListItem,
|
|
2708
2884
|
{
|
|
2709
2885
|
item: navItem,
|
|
@@ -2721,16 +2897,19 @@ var NavigationList = ({ subNavigation, depth = 0, collapsed, isPopover, isSideba
|
|
|
2721
2897
|
}
|
|
2722
2898
|
);
|
|
2723
2899
|
};
|
|
2900
|
+
|
|
2901
|
+
// src/components/core/navigation/NavigationRail.tsx
|
|
2902
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
2724
2903
|
var MINI_WIDTH = 84;
|
|
2725
2904
|
var EXPANDED_WIDTH = 320;
|
|
2726
2905
|
var TOOLBAR_HEIGHT = 65;
|
|
2727
2906
|
var NavigationRail = ({ navigation, expanded, setExpanded }) => {
|
|
2728
2907
|
const navigate = useNavigate();
|
|
2729
|
-
const routerState =
|
|
2730
|
-
const theme =
|
|
2908
|
+
const routerState = useRouterState2();
|
|
2909
|
+
const theme = useTheme2();
|
|
2731
2910
|
const showPermanent = useMediaQuery(theme.breakpoints.up("sm"));
|
|
2732
|
-
const drawerContent = (collapsed) => /* @__PURE__ */
|
|
2733
|
-
|
|
2911
|
+
const drawerContent = (collapsed) => /* @__PURE__ */ jsx25(
|
|
2912
|
+
Box7,
|
|
2734
2913
|
{
|
|
2735
2914
|
component: "nav",
|
|
2736
2915
|
sx: {
|
|
@@ -2743,7 +2922,7 @@ var NavigationRail = ({ navigation, expanded, setExpanded }) => {
|
|
|
2743
2922
|
overflowX: "hidden",
|
|
2744
2923
|
pt: navigation[0] && isHeader(navigation[0]) && !collapsed ? 0 : 2
|
|
2745
2924
|
},
|
|
2746
|
-
children: /* @__PURE__ */
|
|
2925
|
+
children: /* @__PURE__ */ jsx25(
|
|
2747
2926
|
NavigationList,
|
|
2748
2927
|
{
|
|
2749
2928
|
subNavigation: navigation,
|
|
@@ -2758,7 +2937,7 @@ var NavigationRail = ({ navigation, expanded, setExpanded }) => {
|
|
|
2758
2937
|
}
|
|
2759
2938
|
);
|
|
2760
2939
|
if (showPermanent)
|
|
2761
|
-
return /* @__PURE__ */
|
|
2940
|
+
return /* @__PURE__ */ jsx25(
|
|
2762
2941
|
Drawer,
|
|
2763
2942
|
{
|
|
2764
2943
|
variant: "permanent",
|
|
@@ -2774,26 +2953,48 @@ var NavigationRail = ({ navigation, expanded, setExpanded }) => {
|
|
|
2774
2953
|
children: drawerContent(!expanded)
|
|
2775
2954
|
}
|
|
2776
2955
|
);
|
|
2777
|
-
return /* @__PURE__ */
|
|
2956
|
+
return /* @__PURE__ */ jsx25(Drawer, { open: expanded, onClose: () => setExpanded(false), children: drawerContent(!expanded) });
|
|
2778
2957
|
};
|
|
2779
|
-
|
|
2958
|
+
|
|
2959
|
+
// src/components/core/ToolbarAccount.tsx
|
|
2960
|
+
import AccountCircle from "@mui/icons-material/AccountCircle";
|
|
2961
|
+
import ArrowBack from "@mui/icons-material/ArrowBack";
|
|
2962
|
+
import Brightness4 from "@mui/icons-material/Brightness4";
|
|
2963
|
+
import ChevronRight from "@mui/icons-material/ChevronRight";
|
|
2964
|
+
import DarkMode from "@mui/icons-material/DarkMode";
|
|
2965
|
+
import LightMode from "@mui/icons-material/LightMode";
|
|
2966
|
+
import Login from "@mui/icons-material/Login";
|
|
2967
|
+
import Logout from "@mui/icons-material/Logout";
|
|
2968
|
+
import SettingsBrightness from "@mui/icons-material/SettingsBrightness";
|
|
2969
|
+
import Translate from "@mui/icons-material/Translate";
|
|
2970
|
+
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";
|
|
2971
|
+
import { Fragment as Fragment6, useState as useState9 } from "react";
|
|
2972
|
+
import { useTranslation as useTranslation5 } from "react-i18next";
|
|
2973
|
+
|
|
2974
|
+
// src/auth-test/keycloak.ts
|
|
2975
|
+
import { useRouter } from "@tanstack/react-router";
|
|
2976
|
+
import Keycloak from "keycloak-js";
|
|
2977
|
+
var keycloakConfig = {
|
|
2780
2978
|
url: import.meta.env.VITE_KEYCLOAK_URL,
|
|
2781
2979
|
realm: import.meta.env.VITE_KEYCLOAK_REALM,
|
|
2782
2980
|
clientId: import.meta.env.VITE_KEYCLOAK_CLIENT_ID,
|
|
2783
2981
|
idpHint: import.meta.env.VITE_KEYCLOAK_IDP_HINT,
|
|
2784
2982
|
confidentialClientId: import.meta.env.VITE_KEYCLOAK_CONFIDENTIAL_CLIENT_ID,
|
|
2785
2983
|
confidentialClientSecret: import.meta.env.VITE_KEYCLOAK_CONFIDENTIAL_CLIENT_SECRET
|
|
2786
|
-
}
|
|
2984
|
+
};
|
|
2787
2985
|
function useKeycloak() {
|
|
2788
2986
|
const routerContext = useRouter();
|
|
2789
2987
|
const keycloak = routerContext.options.context.keycloak;
|
|
2790
2988
|
return keycloak;
|
|
2791
2989
|
}
|
|
2990
|
+
|
|
2991
|
+
// src/components/core/ToolbarAccount.tsx
|
|
2992
|
+
import { jsx as jsx26, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2792
2993
|
var ToolbarAccount = () => {
|
|
2793
|
-
const [anchorElement, setAnchorElement] =
|
|
2794
|
-
const [tab, setTab] =
|
|
2994
|
+
const [anchorElement, setAnchorElement] = useState9();
|
|
2995
|
+
const [tab, setTab] = useState9("settings");
|
|
2795
2996
|
const open = Boolean(anchorElement);
|
|
2796
|
-
const { t: t2, i18n: i18n2 } =
|
|
2997
|
+
const { t: t2, i18n: i18n2 } = useTranslation5();
|
|
2797
2998
|
const { mode, setMode } = useColorScheme();
|
|
2798
2999
|
const changeLanguage = (newLanguage) => () => {
|
|
2799
3000
|
i18n2.changeLanguage(newLanguage).finally(() => closeMenu());
|
|
@@ -2828,60 +3029,60 @@ var ToolbarAccount = () => {
|
|
|
2828
3029
|
setTimeout(() => setTab("settings"), 300);
|
|
2829
3030
|
};
|
|
2830
3031
|
const changeTab = (newTab) => () => setTab(newTab);
|
|
2831
|
-
const settings = /* @__PURE__ */
|
|
2832
|
-
/* @__PURE__ */
|
|
2833
|
-
/* @__PURE__ */
|
|
2834
|
-
/* @__PURE__ */
|
|
2835
|
-
/* @__PURE__ */
|
|
3032
|
+
const settings = /* @__PURE__ */ jsxs14(List4, { component: "nav", subheader: /* @__PURE__ */ jsx26(ListSubheader2, { sx: { backgroundColor: "transparent" }, children: t2("Layout.Settings") }), children: [
|
|
3033
|
+
/* @__PURE__ */ jsxs14(ListItemButton5, { onClick: changeTab("theme"), sx: { py: 0.3 }, children: [
|
|
3034
|
+
/* @__PURE__ */ jsx26(ListItemIcon4, { children: /* @__PURE__ */ jsx26(Brightness4, {}) }),
|
|
3035
|
+
/* @__PURE__ */ jsx26(ListItemText4, { primary: t2("Layout.Appearance"), secondary: getModeText() }),
|
|
3036
|
+
/* @__PURE__ */ jsx26(ChevronRight, {})
|
|
2836
3037
|
] }),
|
|
2837
|
-
/* @__PURE__ */
|
|
2838
|
-
/* @__PURE__ */
|
|
2839
|
-
/* @__PURE__ */
|
|
2840
|
-
/* @__PURE__ */
|
|
3038
|
+
/* @__PURE__ */ jsxs14(ListItemButton5, { onClick: changeTab("language"), sx: { py: 0.3 }, children: [
|
|
3039
|
+
/* @__PURE__ */ jsx26(ListItemIcon4, { children: /* @__PURE__ */ jsx26(Translate, {}) }),
|
|
3040
|
+
/* @__PURE__ */ jsx26(ListItemText4, { primary: t2("Layout.Language"), secondary: i18n2.resolvedLanguage === "en" ? "English" : "\u010Ce\u0161tina" }),
|
|
3041
|
+
/* @__PURE__ */ jsx26(ChevronRight, {})
|
|
2841
3042
|
] })
|
|
2842
3043
|
] });
|
|
2843
|
-
const theme = /* @__PURE__ */
|
|
2844
|
-
/* @__PURE__ */
|
|
3044
|
+
const theme = /* @__PURE__ */ jsxs14(List4, { subheader: /* @__PURE__ */ jsxs14(ListSubheader2, { onClick: changeTab("settings"), sx: { backgroundColor: "transparent", display: "flex", alignItems: "center", px: 1, cursor: "pointer" }, children: [
|
|
3045
|
+
/* @__PURE__ */ jsx26(IconButton4, { size: "small", sx: { mr: 0.5 }, children: /* @__PURE__ */ jsx26(ArrowBack, { fontSize: "small" }) }),
|
|
2845
3046
|
" ",
|
|
2846
3047
|
t2("Layout.Appearance")
|
|
2847
3048
|
] }), children: [
|
|
2848
|
-
/* @__PURE__ */
|
|
2849
|
-
/* @__PURE__ */
|
|
2850
|
-
/* @__PURE__ */
|
|
3049
|
+
/* @__PURE__ */ jsxs14(ListItemButton5, { onClick: changeMode("light"), disabled: mode === "light", children: [
|
|
3050
|
+
/* @__PURE__ */ jsx26(ListItemIcon4, { children: /* @__PURE__ */ jsx26(LightMode, {}) }),
|
|
3051
|
+
/* @__PURE__ */ jsx26(ListItemText4, { primary: t2("Layout.Light") })
|
|
2851
3052
|
] }),
|
|
2852
|
-
/* @__PURE__ */
|
|
2853
|
-
/* @__PURE__ */
|
|
2854
|
-
/* @__PURE__ */
|
|
3053
|
+
/* @__PURE__ */ jsxs14(ListItemButton5, { onClick: changeMode("dark"), disabled: mode === "dark", children: [
|
|
3054
|
+
/* @__PURE__ */ jsx26(ListItemIcon4, { children: /* @__PURE__ */ jsx26(DarkMode, {}) }),
|
|
3055
|
+
/* @__PURE__ */ jsx26(ListItemText4, { primary: t2("Layout.Dark") })
|
|
2855
3056
|
] }),
|
|
2856
|
-
/* @__PURE__ */
|
|
2857
|
-
/* @__PURE__ */
|
|
2858
|
-
/* @__PURE__ */
|
|
3057
|
+
/* @__PURE__ */ jsxs14(ListItemButton5, { onClick: changeMode("system"), disabled: mode === "system", children: [
|
|
3058
|
+
/* @__PURE__ */ jsx26(ListItemIcon4, { children: /* @__PURE__ */ jsx26(SettingsBrightness, {}) }),
|
|
3059
|
+
/* @__PURE__ */ jsx26(ListItemText4, { primary: t2("Layout.System") })
|
|
2859
3060
|
] })
|
|
2860
3061
|
] });
|
|
2861
|
-
const language = /* @__PURE__ */
|
|
2862
|
-
/* @__PURE__ */
|
|
3062
|
+
const language = /* @__PURE__ */ jsxs14(List4, { subheader: /* @__PURE__ */ jsxs14(ListSubheader2, { onClick: changeTab("settings"), sx: { backgroundColor: "transparent", display: "flex", alignItems: "center", px: 1, cursor: "pointer" }, children: [
|
|
3063
|
+
/* @__PURE__ */ jsx26(IconButton4, { size: "small", sx: { mr: 0.5 }, children: /* @__PURE__ */ jsx26(ArrowBack, { fontSize: "small" }) }),
|
|
2863
3064
|
" ",
|
|
2864
3065
|
t2("Layout.Language")
|
|
2865
3066
|
] }), children: [
|
|
2866
|
-
/* @__PURE__ */
|
|
2867
|
-
/* @__PURE__ */
|
|
3067
|
+
/* @__PURE__ */ jsx26(ListItemButton5, { onClick: changeLanguage("en"), disabled: i18n2.resolvedLanguage === "en", children: /* @__PURE__ */ jsx26(ListItemText4, { primary: "English" }) }),
|
|
3068
|
+
/* @__PURE__ */ jsx26(ListItemButton5, { onClick: changeLanguage("cs"), disabled: i18n2.resolvedLanguage === "cs", children: /* @__PURE__ */ jsx26(ListItemText4, { primary: "\u010Ce\u0161tina" }) })
|
|
2868
3069
|
] });
|
|
2869
|
-
return /* @__PURE__ */
|
|
2870
|
-
/* @__PURE__ */
|
|
2871
|
-
/* @__PURE__ */
|
|
2872
|
-
/* @__PURE__ */
|
|
2873
|
-
/* @__PURE__ */
|
|
2874
|
-
/* @__PURE__ */
|
|
2875
|
-
/* @__PURE__ */
|
|
2876
|
-
/* @__PURE__ */
|
|
3070
|
+
return /* @__PURE__ */ jsxs14(Fragment6, { children: [
|
|
3071
|
+
/* @__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" }) }),
|
|
3072
|
+
/* @__PURE__ */ jsx26(Menu2, { anchorEl: anchorElement, open, onClose: closeMenu, children: /* @__PURE__ */ jsxs14(Box8, { sx: { width: 240 }, children: [
|
|
3073
|
+
/* @__PURE__ */ jsx26(List4, { children: user?.name ? /* @__PURE__ */ jsxs14(Fragment6, { children: [
|
|
3074
|
+
/* @__PURE__ */ jsx26(ListItem2, { children: /* @__PURE__ */ jsx26(ListItemText4, { primary: user.name, secondary: /* @__PURE__ */ jsxs14("span", { children: [
|
|
3075
|
+
/* @__PURE__ */ jsx26("span", { children: user.employeeId }),
|
|
3076
|
+
/* @__PURE__ */ jsx26("br", {}),
|
|
3077
|
+
/* @__PURE__ */ jsx26("span", { children: user.department })
|
|
2877
3078
|
] }) }) }),
|
|
2878
|
-
/* @__PURE__ */
|
|
2879
|
-
/* @__PURE__ */
|
|
2880
|
-
/* @__PURE__ */
|
|
3079
|
+
/* @__PURE__ */ jsxs14(ListItemButton5, { onClick: () => keycloak.logout(), children: [
|
|
3080
|
+
/* @__PURE__ */ jsx26(ListItemIcon4, { children: /* @__PURE__ */ jsx26(Logout, { color: "error" }) }),
|
|
3081
|
+
/* @__PURE__ */ jsx26(ListItemText4, { primary: t2("Layout.Logout") })
|
|
2881
3082
|
] })
|
|
2882
|
-
] }) : /* @__PURE__ */
|
|
2883
|
-
/* @__PURE__ */
|
|
2884
|
-
/* @__PURE__ */
|
|
3083
|
+
] }) : /* @__PURE__ */ jsxs14(ListItemButton5, { onClick: () => keycloak.login(), children: [
|
|
3084
|
+
/* @__PURE__ */ jsx26(ListItemIcon4, { children: /* @__PURE__ */ jsx26(Login, { color: "success" }) }),
|
|
3085
|
+
/* @__PURE__ */ jsx26(ListItemText4, { primary: t2("Layout.LogIn") })
|
|
2885
3086
|
] }) }),
|
|
2886
3087
|
tab === "settings" && settings,
|
|
2887
3088
|
tab === "theme" && theme,
|
|
@@ -2889,7 +3090,10 @@ var ToolbarAccount = () => {
|
|
|
2889
3090
|
] }) })
|
|
2890
3091
|
] });
|
|
2891
3092
|
};
|
|
2892
|
-
|
|
3093
|
+
|
|
3094
|
+
// src/components/core/Layout.tsx
|
|
3095
|
+
import { jsx as jsx27, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3096
|
+
var DrawerHeader = styled2("div")(({ theme }) => ({
|
|
2893
3097
|
display: "flex",
|
|
2894
3098
|
alignItems: "center",
|
|
2895
3099
|
justifyContent: "flex-end",
|
|
@@ -2897,15 +3101,15 @@ var DrawerHeader = styled("div")(({ theme }) => ({
|
|
|
2897
3101
|
...theme.mixins.toolbar
|
|
2898
3102
|
}));
|
|
2899
3103
|
var Layout = (props) => {
|
|
2900
|
-
const theme =
|
|
3104
|
+
const theme = createTheme();
|
|
2901
3105
|
const [navigationOpen, setNavigationOpen] = useLocalStorageState("navigationOpen", { defaultServerValue: false });
|
|
2902
3106
|
const isFetching = !!useIsFetching();
|
|
2903
3107
|
const isMutating = !!useIsMutating();
|
|
2904
|
-
return /* @__PURE__ */
|
|
2905
|
-
/* @__PURE__ */
|
|
2906
|
-
/* @__PURE__ */
|
|
2907
|
-
/* @__PURE__ */
|
|
2908
|
-
/* @__PURE__ */
|
|
3108
|
+
return /* @__PURE__ */ jsxs15(ThemeProvider, { theme, children: [
|
|
3109
|
+
/* @__PURE__ */ jsx27(InitColorSchemeScript, {}),
|
|
3110
|
+
/* @__PURE__ */ jsx27(CssBaseline, {}),
|
|
3111
|
+
/* @__PURE__ */ jsxs15(Box9, { sx: { display: "flex", height: "100dvh", maxHeight: "100dvh", overflow: "hidden", width: "100%" }, children: [
|
|
3112
|
+
/* @__PURE__ */ jsx27(
|
|
2909
3113
|
AppBar,
|
|
2910
3114
|
{
|
|
2911
3115
|
color: "transparent",
|
|
@@ -2915,130 +3119,69 @@ var Layout = (props) => {
|
|
|
2915
3119
|
borderColor: theme.vars?.palette.divider,
|
|
2916
3120
|
boxShadow: "none"
|
|
2917
3121
|
},
|
|
2918
|
-
children: /* @__PURE__ */
|
|
2919
|
-
props.navigation && /* @__PURE__ */
|
|
2920
|
-
|
|
3122
|
+
children: /* @__PURE__ */ jsxs15(Toolbar, { children: [
|
|
3123
|
+
props.navigation && /* @__PURE__ */ jsx27(
|
|
3124
|
+
IconButton5,
|
|
2921
3125
|
{
|
|
2922
3126
|
onClick: () => setNavigationOpen((previous) => !previous),
|
|
2923
3127
|
sx: { marginRight: 2 },
|
|
2924
|
-
children: navigationOpen ? /* @__PURE__ */
|
|
3128
|
+
children: navigationOpen ? /* @__PURE__ */ jsx27(MenuOpen, {}) : /* @__PURE__ */ jsx27(Menu3, {})
|
|
2925
3129
|
}
|
|
2926
3130
|
),
|
|
2927
|
-
/* @__PURE__ */
|
|
2928
|
-
/* @__PURE__ */
|
|
3131
|
+
/* @__PURE__ */ jsx27(AppTitle, {}),
|
|
3132
|
+
/* @__PURE__ */ jsx27(ToolbarAccount, {})
|
|
2929
3133
|
] })
|
|
2930
3134
|
}
|
|
2931
3135
|
),
|
|
2932
|
-
props.navigation && /* @__PURE__ */
|
|
2933
|
-
/* @__PURE__ */
|
|
2934
|
-
/* @__PURE__ */
|
|
2935
|
-
/* @__PURE__ */
|
|
3136
|
+
props.navigation && /* @__PURE__ */ jsx27(NavigationRail, { navigation: props.navigation, expanded: navigationOpen ?? false, setExpanded: setNavigationOpen }),
|
|
3137
|
+
/* @__PURE__ */ jsxs15(Box9, { component: "main", sx: { flexGrow: 1, display: "flex", flexDirection: "column", minWidth: 0, height: "100%", overflow: "hidden" }, children: [
|
|
3138
|
+
/* @__PURE__ */ jsx27(DrawerHeader, {}),
|
|
3139
|
+
/* @__PURE__ */ jsx27(Box9, { sx: { flex: 1, overflow: "auto", position: "relative" }, children: props.children })
|
|
2936
3140
|
] })
|
|
2937
3141
|
] }),
|
|
2938
|
-
(isFetching || isMutating) && /* @__PURE__ */
|
|
3142
|
+
(isFetching || isMutating) && /* @__PURE__ */ jsx27(LinearProgress, { sx: { position: "fixed", top: { xs: 56, sm: 64 }, left: 0, right: 0 } })
|
|
2939
3143
|
] });
|
|
2940
3144
|
};
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
interpolation: {
|
|
2945
|
-
escapeValue: false
|
|
2946
|
-
},
|
|
2947
|
-
react: {
|
|
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
|
-
}
|
|
3145
|
+
|
|
3146
|
+
// src/providers/LayoutProvider.tsx
|
|
3147
|
+
import { jsx as jsx28, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3017
3148
|
var LayoutProvider = (props) => {
|
|
3018
|
-
const [user, setUser] =
|
|
3019
|
-
const { t: t2 } =
|
|
3149
|
+
const [user, setUser] = useState10({ employeeId: "", name: "Unknown", department: "", company: "", category: "" });
|
|
3150
|
+
const { t: t2 } = useTranslation6();
|
|
3020
3151
|
const navigation = props.getNavigation?.({ user, t: t2 });
|
|
3021
|
-
|
|
3152
|
+
useEffect6(() => {
|
|
3022
3153
|
z.config(default2.resolvedLanguage === "cs" ? cs() : en());
|
|
3023
3154
|
}, []);
|
|
3024
|
-
return /* @__PURE__ */
|
|
3155
|
+
return /* @__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
3156
|
"\xA8",
|
|
3026
|
-
/* @__PURE__ */
|
|
3027
|
-
] }) }) })
|
|
3157
|
+
/* @__PURE__ */ jsx28(DialogsProvider, { children: props.children })
|
|
3158
|
+
] }) }) });
|
|
3028
3159
|
};
|
|
3029
3160
|
|
|
3161
|
+
// src/index.ts
|
|
3162
|
+
import { uuidv7 as uuidv72 } from "uuidv7";
|
|
3163
|
+
|
|
3164
|
+
// src/hooks/FormHooks.ts
|
|
3165
|
+
import { createFormHook, createFormHookContexts } from "@tanstack/react-form";
|
|
3166
|
+
|
|
3167
|
+
// src/components/form/FormAutocomplete.tsx
|
|
3168
|
+
import { Autocomplete, TextField } from "@mui/material";
|
|
3169
|
+
|
|
3030
3170
|
// src/utils/FormUtils.ts
|
|
3031
3171
|
var getFieldStatus = (field) => {
|
|
3032
3172
|
const { meta } = field.state;
|
|
3033
3173
|
const isTouched = meta.isTouched;
|
|
3034
|
-
const hasError = !!meta.errors
|
|
3035
|
-
const helperText = meta.errors
|
|
3174
|
+
const hasError = !!meta.errors.length;
|
|
3175
|
+
const helperText = meta.errors[0]?.message;
|
|
3036
3176
|
return { isTouched, hasError, helperText };
|
|
3037
3177
|
};
|
|
3178
|
+
|
|
3179
|
+
// src/components/form/FormAutocomplete.tsx
|
|
3180
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
3038
3181
|
var FormAutocomplete = ({ textFieldProps, ...autocompleteProps }) => {
|
|
3039
3182
|
const field = useFieldContext();
|
|
3040
3183
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
3041
|
-
return /* @__PURE__ */
|
|
3184
|
+
return /* @__PURE__ */ jsx29(
|
|
3042
3185
|
Autocomplete,
|
|
3043
3186
|
{
|
|
3044
3187
|
value: field.state.value,
|
|
@@ -3047,7 +3190,7 @@ var FormAutocomplete = ({ textFieldProps, ...autocompleteProps }) => {
|
|
|
3047
3190
|
onBlur: field.handleBlur,
|
|
3048
3191
|
"aria-label": field.name,
|
|
3049
3192
|
...autocompleteProps,
|
|
3050
|
-
renderInput: (parameters) => /* @__PURE__ */
|
|
3193
|
+
renderInput: (parameters) => /* @__PURE__ */ jsx29(
|
|
3051
3194
|
TextField,
|
|
3052
3195
|
{
|
|
3053
3196
|
...parameters,
|
|
@@ -3060,14 +3203,18 @@ var FormAutocomplete = ({ textFieldProps, ...autocompleteProps }) => {
|
|
|
3060
3203
|
}
|
|
3061
3204
|
);
|
|
3062
3205
|
};
|
|
3206
|
+
|
|
3207
|
+
// src/components/form/FormCheckbox.tsx
|
|
3208
|
+
import { Checkbox, FormControl, FormControlLabel, FormHelperText } from "@mui/material";
|
|
3209
|
+
import { jsx as jsx30, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3063
3210
|
var FormCheckbox = (props) => {
|
|
3064
3211
|
const field = useFieldContext();
|
|
3065
3212
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
3066
|
-
return /* @__PURE__ */
|
|
3067
|
-
/* @__PURE__ */
|
|
3213
|
+
return /* @__PURE__ */ jsxs17(FormControl, { component: "fieldset", children: [
|
|
3214
|
+
/* @__PURE__ */ jsx30(
|
|
3068
3215
|
FormControlLabel,
|
|
3069
3216
|
{
|
|
3070
|
-
control: /* @__PURE__ */
|
|
3217
|
+
control: /* @__PURE__ */ jsx30(
|
|
3071
3218
|
Checkbox,
|
|
3072
3219
|
{
|
|
3073
3220
|
name: field.name,
|
|
@@ -3081,17 +3228,22 @@ var FormCheckbox = (props) => {
|
|
|
3081
3228
|
label: props.label ?? ""
|
|
3082
3229
|
}
|
|
3083
3230
|
),
|
|
3084
|
-
isTouched && hasError && /* @__PURE__ */
|
|
3231
|
+
isTouched && hasError && /* @__PURE__ */ jsx30(FormHelperText, { error: hasError, children: helperText })
|
|
3085
3232
|
] });
|
|
3086
3233
|
};
|
|
3234
|
+
|
|
3235
|
+
// src/components/form/FormDatePicker.tsx
|
|
3236
|
+
import { DatePicker } from "@mui/x-date-pickers-pro";
|
|
3237
|
+
import dayjs2 from "dayjs";
|
|
3238
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
3087
3239
|
var FormDatePicker = (props) => {
|
|
3088
3240
|
const field = useFieldContext();
|
|
3089
3241
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
3090
|
-
return /* @__PURE__ */
|
|
3242
|
+
return /* @__PURE__ */ jsx31(
|
|
3091
3243
|
DatePicker,
|
|
3092
3244
|
{
|
|
3093
3245
|
name: field.name,
|
|
3094
|
-
value: field.state.value ?
|
|
3246
|
+
value: field.state.value ? dayjs2(field.state.value) : null,
|
|
3095
3247
|
onChange: (value) => field.handleChange(value ? value.format() : null),
|
|
3096
3248
|
slotProps: {
|
|
3097
3249
|
textField: {
|
|
@@ -3107,14 +3259,19 @@ var FormDatePicker = (props) => {
|
|
|
3107
3259
|
}
|
|
3108
3260
|
);
|
|
3109
3261
|
};
|
|
3262
|
+
|
|
3263
|
+
// src/components/form/FormDateTimePicker.tsx
|
|
3264
|
+
import { DateTimePicker } from "@mui/x-date-pickers-pro";
|
|
3265
|
+
import dayjs3 from "dayjs";
|
|
3266
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
3110
3267
|
var FormDateTimePicker = (props) => {
|
|
3111
3268
|
const field = useFieldContext();
|
|
3112
3269
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
3113
|
-
return /* @__PURE__ */
|
|
3270
|
+
return /* @__PURE__ */ jsx32(
|
|
3114
3271
|
DateTimePicker,
|
|
3115
3272
|
{
|
|
3116
3273
|
name: field.name,
|
|
3117
|
-
value: field.state.value ?
|
|
3274
|
+
value: field.state.value ? dayjs3(field.state.value) : null,
|
|
3118
3275
|
onChange: (value) => field.handleChange(value ? value.format() : null),
|
|
3119
3276
|
slotProps: {
|
|
3120
3277
|
textField: {
|
|
@@ -3130,13 +3287,18 @@ var FormDateTimePicker = (props) => {
|
|
|
3130
3287
|
}
|
|
3131
3288
|
);
|
|
3132
3289
|
};
|
|
3290
|
+
|
|
3291
|
+
// src/components/form/FormNumberField.tsx
|
|
3292
|
+
import { TextField as TextField2 } from "@mui/material";
|
|
3293
|
+
import { NumericFormat } from "react-number-format";
|
|
3294
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
3133
3295
|
var FormNumberField = ({ options, ...props }) => {
|
|
3134
3296
|
const field = useFieldContext();
|
|
3135
3297
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
3136
|
-
return /* @__PURE__ */
|
|
3298
|
+
return /* @__PURE__ */ jsx33(
|
|
3137
3299
|
NumericFormat,
|
|
3138
3300
|
{
|
|
3139
|
-
customInput:
|
|
3301
|
+
customInput: TextField2,
|
|
3140
3302
|
name: field.name,
|
|
3141
3303
|
value: field.state.value ?? "",
|
|
3142
3304
|
onValueChange: ({ floatValue }) => field.handleChange(floatValue),
|
|
@@ -3149,12 +3311,16 @@ var FormNumberField = ({ options, ...props }) => {
|
|
|
3149
3311
|
}
|
|
3150
3312
|
);
|
|
3151
3313
|
};
|
|
3314
|
+
|
|
3315
|
+
// src/components/form/FormRadioGroup.tsx
|
|
3316
|
+
import { FormControl as FormControl2, FormControlLabel as FormControlLabel2, FormHelperText as FormHelperText2, FormLabel, Radio, RadioGroup } from "@mui/material";
|
|
3317
|
+
import { jsx as jsx34, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3152
3318
|
var FormRadioGroup = ({ label, options, ...props }) => {
|
|
3153
3319
|
const field = useFieldContext();
|
|
3154
3320
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
3155
|
-
return /* @__PURE__ */
|
|
3156
|
-
label && /* @__PURE__ */
|
|
3157
|
-
/* @__PURE__ */
|
|
3321
|
+
return /* @__PURE__ */ jsxs18(FormControl2, { component: "fieldset", children: [
|
|
3322
|
+
label && /* @__PURE__ */ jsx34(FormLabel, { component: "legend", children: label }),
|
|
3323
|
+
/* @__PURE__ */ jsx34(
|
|
3158
3324
|
RadioGroup,
|
|
3159
3325
|
{
|
|
3160
3326
|
name: field.name,
|
|
@@ -3163,26 +3329,30 @@ var FormRadioGroup = ({ label, options, ...props }) => {
|
|
|
3163
3329
|
onBlur: field.handleBlur,
|
|
3164
3330
|
"aria-label": field.name,
|
|
3165
3331
|
...props,
|
|
3166
|
-
children: options.map((option) => /* @__PURE__ */
|
|
3167
|
-
|
|
3332
|
+
children: options.map((option) => /* @__PURE__ */ jsx34(
|
|
3333
|
+
FormControlLabel2,
|
|
3168
3334
|
{
|
|
3169
3335
|
value: option.value,
|
|
3170
|
-
control: /* @__PURE__ */
|
|
3336
|
+
control: /* @__PURE__ */ jsx34(Radio, {}),
|
|
3171
3337
|
label: option.label
|
|
3172
3338
|
},
|
|
3173
3339
|
option.value
|
|
3174
3340
|
))
|
|
3175
3341
|
}
|
|
3176
3342
|
),
|
|
3177
|
-
isTouched && hasError && /* @__PURE__ */
|
|
3343
|
+
isTouched && hasError && /* @__PURE__ */ jsx34(FormHelperText2, { error: hasError, children: helperText })
|
|
3178
3344
|
] });
|
|
3179
3345
|
};
|
|
3346
|
+
|
|
3347
|
+
// src/components/form/FormSlider.tsx
|
|
3348
|
+
import { FormControl as FormControl3, FormHelperText as FormHelperText3, FormLabel as FormLabel2, Slider } from "@mui/material";
|
|
3349
|
+
import { jsx as jsx35, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3180
3350
|
var FormSlider = ({ label, ...props }) => {
|
|
3181
3351
|
const field = useFieldContext();
|
|
3182
3352
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
3183
|
-
return /* @__PURE__ */
|
|
3184
|
-
label && /* @__PURE__ */
|
|
3185
|
-
/* @__PURE__ */
|
|
3353
|
+
return /* @__PURE__ */ jsxs19(FormControl3, { component: "fieldset", children: [
|
|
3354
|
+
label && /* @__PURE__ */ jsx35(FormLabel2, { children: label }),
|
|
3355
|
+
/* @__PURE__ */ jsx35(
|
|
3186
3356
|
Slider,
|
|
3187
3357
|
{
|
|
3188
3358
|
name: field.name,
|
|
@@ -3193,9 +3363,13 @@ var FormSlider = ({ label, ...props }) => {
|
|
|
3193
3363
|
...props
|
|
3194
3364
|
}
|
|
3195
3365
|
),
|
|
3196
|
-
isTouched && hasError && /* @__PURE__ */
|
|
3366
|
+
isTouched && hasError && /* @__PURE__ */ jsx35(FormHelperText3, { error: hasError, children: helperText })
|
|
3197
3367
|
] });
|
|
3198
3368
|
};
|
|
3369
|
+
|
|
3370
|
+
// src/components/form/FormSubmitButton.tsx
|
|
3371
|
+
import { Button as Button3 } from "@mui/material";
|
|
3372
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
3199
3373
|
var FormSubmitButton = (props) => {
|
|
3200
3374
|
const form = useFormContext();
|
|
3201
3375
|
const handleClick = (event) => {
|
|
@@ -3203,8 +3377,8 @@ var FormSubmitButton = (props) => {
|
|
|
3203
3377
|
event.stopPropagation();
|
|
3204
3378
|
form.handleSubmit();
|
|
3205
3379
|
};
|
|
3206
|
-
return /* @__PURE__ */
|
|
3207
|
-
|
|
3380
|
+
return /* @__PURE__ */ jsx36(form.Subscribe, { selector: (state) => [state.canSubmit, state.isSubmitting], children: ([canSubmit, isSubmitting]) => /* @__PURE__ */ jsx36(
|
|
3381
|
+
Button3,
|
|
3208
3382
|
{
|
|
3209
3383
|
loading: isSubmitting,
|
|
3210
3384
|
disabled: !canSubmit,
|
|
@@ -3215,14 +3389,18 @@ var FormSubmitButton = (props) => {
|
|
|
3215
3389
|
}
|
|
3216
3390
|
) });
|
|
3217
3391
|
};
|
|
3392
|
+
|
|
3393
|
+
// src/components/form/FormSwitch.tsx
|
|
3394
|
+
import { FormControl as FormControl4, FormControlLabel as FormControlLabel3, FormHelperText as FormHelperText4, Switch } from "@mui/material";
|
|
3395
|
+
import { jsx as jsx37, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3218
3396
|
var FormSwitch = (props) => {
|
|
3219
3397
|
const field = useFieldContext();
|
|
3220
3398
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
3221
|
-
return /* @__PURE__ */
|
|
3222
|
-
/* @__PURE__ */
|
|
3223
|
-
|
|
3399
|
+
return /* @__PURE__ */ jsxs20(FormControl4, { component: "fieldset", children: [
|
|
3400
|
+
/* @__PURE__ */ jsx37(
|
|
3401
|
+
FormControlLabel3,
|
|
3224
3402
|
{
|
|
3225
|
-
control: /* @__PURE__ */
|
|
3403
|
+
control: /* @__PURE__ */ jsx37(
|
|
3226
3404
|
Switch,
|
|
3227
3405
|
{
|
|
3228
3406
|
name: field.name,
|
|
@@ -3236,14 +3414,18 @@ var FormSwitch = (props) => {
|
|
|
3236
3414
|
label: props.label ?? ""
|
|
3237
3415
|
}
|
|
3238
3416
|
),
|
|
3239
|
-
isTouched && hasError && /* @__PURE__ */
|
|
3417
|
+
isTouched && hasError && /* @__PURE__ */ jsx37(FormHelperText4, { error: hasError, children: helperText })
|
|
3240
3418
|
] });
|
|
3241
3419
|
};
|
|
3420
|
+
|
|
3421
|
+
// src/components/form/FormTextField.tsx
|
|
3422
|
+
import { TextField as TextField3 } from "@mui/material";
|
|
3423
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
3242
3424
|
var FormTextField = (props) => {
|
|
3243
3425
|
const field = useFieldContext();
|
|
3244
3426
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
3245
|
-
return /* @__PURE__ */
|
|
3246
|
-
|
|
3427
|
+
return /* @__PURE__ */ jsx38(
|
|
3428
|
+
TextField3,
|
|
3247
3429
|
{
|
|
3248
3430
|
name: field.name,
|
|
3249
3431
|
value: field.state.value ?? "",
|
|
@@ -3277,6 +3459,51 @@ var { useAppForm: useLayoutForm, withForm: withLayoutForm } = createFormHook({
|
|
|
3277
3459
|
fieldContext,
|
|
3278
3460
|
formContext
|
|
3279
3461
|
});
|
|
3462
|
+
|
|
3463
|
+
// src/index.ts
|
|
3464
|
+
import { default as default3 } from "use-local-storage-state";
|
|
3465
|
+
import { useTranslation as useTranslation7 } from "react-i18next";
|
|
3466
|
+
import { t } from "i18next";
|
|
3467
|
+
export {
|
|
3468
|
+
ChipInputCell,
|
|
3469
|
+
Dropzone,
|
|
3470
|
+
EditableColumnHeader,
|
|
3471
|
+
FileViewer,
|
|
3472
|
+
LayoutProvider,
|
|
3473
|
+
PageHeader,
|
|
3474
|
+
Platform,
|
|
3475
|
+
RouterButton,
|
|
3476
|
+
RouterError,
|
|
3477
|
+
RouterGridActionsCellItem,
|
|
3478
|
+
RouterIconButton,
|
|
3479
|
+
RouterLink,
|
|
3480
|
+
RouterListItemButton,
|
|
3481
|
+
RouterNotFound,
|
|
3482
|
+
RouterTab,
|
|
3483
|
+
TableContainer,
|
|
3484
|
+
TypographyWithIcon,
|
|
3485
|
+
rootRouteHead,
|
|
3486
|
+
setSSRLanguage,
|
|
3487
|
+
t,
|
|
3488
|
+
useDeleteFile,
|
|
3489
|
+
useDeleteFiles,
|
|
3490
|
+
useDialogs,
|
|
3491
|
+
useDownloadFile,
|
|
3492
|
+
useFieldContext,
|
|
3493
|
+
useFormContext,
|
|
3494
|
+
useGetFile,
|
|
3495
|
+
useGetFileMetas,
|
|
3496
|
+
useGetFileThumbnail,
|
|
3497
|
+
useLayoutForm,
|
|
3498
|
+
default3 as useLocalStorageState,
|
|
3499
|
+
useOpenFile,
|
|
3500
|
+
useTranslation7 as useTranslation,
|
|
3501
|
+
useUpdateFileMeta,
|
|
3502
|
+
useUploadFile,
|
|
3503
|
+
uuidv72 as uuidv7,
|
|
3504
|
+
wczApiClient,
|
|
3505
|
+
withLayoutForm
|
|
3506
|
+
};
|
|
3280
3507
|
/*! Bundled license information:
|
|
3281
3508
|
|
|
3282
3509
|
react-is/cjs/react-is.production.min.js:
|
|
@@ -3306,7 +3533,4 @@ object-assign/index.js:
|
|
|
3306
3533
|
@license MIT
|
|
3307
3534
|
*)
|
|
3308
3535
|
*/
|
|
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
3536
|
//# sourceMappingURL=index.js.map
|