wcz-test 4.0.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{index.d.cts → index.d.ts} +24 -24
- package/dist/{index.cjs → index.js} +794 -838
- package/dist/index.js.map +1 -0
- package/package.json +70 -75
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -8,10 +7,6 @@ var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
8
7
|
var __commonJS = (cb, mod) => function __require() {
|
|
9
8
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
9
|
};
|
|
11
|
-
var __export = (target, all) => {
|
|
12
|
-
for (var name in all)
|
|
13
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
14
|
-
};
|
|
15
10
|
var __copyProps = (to, from, except, desc) => {
|
|
16
11
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
12
|
for (let key of __getOwnPropNames(from))
|
|
@@ -28,11 +23,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
23
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
29
24
|
mod
|
|
30
25
|
));
|
|
31
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
26
|
|
|
33
27
|
// node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js
|
|
34
28
|
var require_react_is_production_min = __commonJS({
|
|
35
|
-
"node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js"(
|
|
29
|
+
"node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js"(exports) {
|
|
36
30
|
"use strict";
|
|
37
31
|
var b = "function" === typeof Symbol && Symbol.for;
|
|
38
32
|
var c = b ? Symbol.for("react.element") : 60103;
|
|
@@ -86,66 +80,66 @@ var require_react_is_production_min = __commonJS({
|
|
|
86
80
|
function A(a) {
|
|
87
81
|
return z2(a) === m;
|
|
88
82
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
83
|
+
exports.AsyncMode = l;
|
|
84
|
+
exports.ConcurrentMode = m;
|
|
85
|
+
exports.ContextConsumer = k;
|
|
86
|
+
exports.ContextProvider = h;
|
|
87
|
+
exports.Element = c;
|
|
88
|
+
exports.ForwardRef = n;
|
|
89
|
+
exports.Fragment = e;
|
|
90
|
+
exports.Lazy = t2;
|
|
91
|
+
exports.Memo = r;
|
|
92
|
+
exports.Portal = d;
|
|
93
|
+
exports.Profiler = g;
|
|
94
|
+
exports.StrictMode = f;
|
|
95
|
+
exports.Suspense = p;
|
|
96
|
+
exports.isAsyncMode = function(a) {
|
|
103
97
|
return A(a) || z2(a) === l;
|
|
104
98
|
};
|
|
105
|
-
|
|
106
|
-
|
|
99
|
+
exports.isConcurrentMode = A;
|
|
100
|
+
exports.isContextConsumer = function(a) {
|
|
107
101
|
return z2(a) === k;
|
|
108
102
|
};
|
|
109
|
-
|
|
103
|
+
exports.isContextProvider = function(a) {
|
|
110
104
|
return z2(a) === h;
|
|
111
105
|
};
|
|
112
|
-
|
|
106
|
+
exports.isElement = function(a) {
|
|
113
107
|
return "object" === typeof a && null !== a && a.$$typeof === c;
|
|
114
108
|
};
|
|
115
|
-
|
|
109
|
+
exports.isForwardRef = function(a) {
|
|
116
110
|
return z2(a) === n;
|
|
117
111
|
};
|
|
118
|
-
|
|
112
|
+
exports.isFragment = function(a) {
|
|
119
113
|
return z2(a) === e;
|
|
120
114
|
};
|
|
121
|
-
|
|
115
|
+
exports.isLazy = function(a) {
|
|
122
116
|
return z2(a) === t2;
|
|
123
117
|
};
|
|
124
|
-
|
|
118
|
+
exports.isMemo = function(a) {
|
|
125
119
|
return z2(a) === r;
|
|
126
120
|
};
|
|
127
|
-
|
|
121
|
+
exports.isPortal = function(a) {
|
|
128
122
|
return z2(a) === d;
|
|
129
123
|
};
|
|
130
|
-
|
|
124
|
+
exports.isProfiler = function(a) {
|
|
131
125
|
return z2(a) === g;
|
|
132
126
|
};
|
|
133
|
-
|
|
127
|
+
exports.isStrictMode = function(a) {
|
|
134
128
|
return z2(a) === f;
|
|
135
129
|
};
|
|
136
|
-
|
|
130
|
+
exports.isSuspense = function(a) {
|
|
137
131
|
return z2(a) === p;
|
|
138
132
|
};
|
|
139
|
-
|
|
133
|
+
exports.isValidElementType = function(a) {
|
|
140
134
|
return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t2 || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
|
|
141
135
|
};
|
|
142
|
-
|
|
136
|
+
exports.typeOf = z2;
|
|
143
137
|
}
|
|
144
138
|
});
|
|
145
139
|
|
|
146
140
|
// node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js
|
|
147
141
|
var require_react_is_development = __commonJS({
|
|
148
|
-
"node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js"(
|
|
142
|
+
"node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js"(exports) {
|
|
149
143
|
"use strict";
|
|
150
144
|
if (process.env.NODE_ENV !== "production") {
|
|
151
145
|
(function() {
|
|
@@ -265,34 +259,34 @@ var require_react_is_development = __commonJS({
|
|
|
265
259
|
function isSuspense(object) {
|
|
266
260
|
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
267
261
|
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
262
|
+
exports.AsyncMode = AsyncMode;
|
|
263
|
+
exports.ConcurrentMode = ConcurrentMode;
|
|
264
|
+
exports.ContextConsumer = ContextConsumer;
|
|
265
|
+
exports.ContextProvider = ContextProvider;
|
|
266
|
+
exports.Element = Element;
|
|
267
|
+
exports.ForwardRef = ForwardRef;
|
|
268
|
+
exports.Fragment = Fragment7;
|
|
269
|
+
exports.Lazy = Lazy;
|
|
270
|
+
exports.Memo = Memo;
|
|
271
|
+
exports.Portal = Portal;
|
|
272
|
+
exports.Profiler = Profiler;
|
|
273
|
+
exports.StrictMode = StrictMode;
|
|
274
|
+
exports.Suspense = Suspense;
|
|
275
|
+
exports.isAsyncMode = isAsyncMode;
|
|
276
|
+
exports.isConcurrentMode = isConcurrentMode;
|
|
277
|
+
exports.isContextConsumer = isContextConsumer;
|
|
278
|
+
exports.isContextProvider = isContextProvider;
|
|
279
|
+
exports.isElement = isElement;
|
|
280
|
+
exports.isForwardRef = isForwardRef;
|
|
281
|
+
exports.isFragment = isFragment;
|
|
282
|
+
exports.isLazy = isLazy;
|
|
283
|
+
exports.isMemo = isMemo;
|
|
284
|
+
exports.isPortal = isPortal;
|
|
285
|
+
exports.isProfiler = isProfiler;
|
|
286
|
+
exports.isStrictMode = isStrictMode;
|
|
287
|
+
exports.isSuspense = isSuspense;
|
|
288
|
+
exports.isValidElementType = isValidElementType;
|
|
289
|
+
exports.typeOf = typeOf;
|
|
296
290
|
})();
|
|
297
291
|
}
|
|
298
292
|
}
|
|
@@ -300,19 +294,19 @@ var require_react_is_development = __commonJS({
|
|
|
300
294
|
|
|
301
295
|
// node_modules/prop-types/node_modules/react-is/index.js
|
|
302
296
|
var require_react_is = __commonJS({
|
|
303
|
-
"node_modules/prop-types/node_modules/react-is/index.js"(
|
|
297
|
+
"node_modules/prop-types/node_modules/react-is/index.js"(exports, module) {
|
|
304
298
|
"use strict";
|
|
305
299
|
if (process.env.NODE_ENV === "production") {
|
|
306
|
-
|
|
300
|
+
module.exports = require_react_is_production_min();
|
|
307
301
|
} else {
|
|
308
|
-
|
|
302
|
+
module.exports = require_react_is_development();
|
|
309
303
|
}
|
|
310
304
|
}
|
|
311
305
|
});
|
|
312
306
|
|
|
313
307
|
// node_modules/object-assign/index.js
|
|
314
308
|
var require_object_assign = __commonJS({
|
|
315
|
-
"node_modules/object-assign/index.js"(
|
|
309
|
+
"node_modules/object-assign/index.js"(exports, module) {
|
|
316
310
|
"use strict";
|
|
317
311
|
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
318
312
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
@@ -355,7 +349,7 @@ var require_object_assign = __commonJS({
|
|
|
355
349
|
return false;
|
|
356
350
|
}
|
|
357
351
|
}
|
|
358
|
-
|
|
352
|
+
module.exports = shouldUseNative() ? Object.assign : function(target, source) {
|
|
359
353
|
var from;
|
|
360
354
|
var to = toObject(target);
|
|
361
355
|
var symbols;
|
|
@@ -382,24 +376,24 @@ var require_object_assign = __commonJS({
|
|
|
382
376
|
|
|
383
377
|
// node_modules/prop-types/lib/ReactPropTypesSecret.js
|
|
384
378
|
var require_ReactPropTypesSecret = __commonJS({
|
|
385
|
-
"node_modules/prop-types/lib/ReactPropTypesSecret.js"(
|
|
379
|
+
"node_modules/prop-types/lib/ReactPropTypesSecret.js"(exports, module) {
|
|
386
380
|
"use strict";
|
|
387
381
|
var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
388
|
-
|
|
382
|
+
module.exports = ReactPropTypesSecret;
|
|
389
383
|
}
|
|
390
384
|
});
|
|
391
385
|
|
|
392
386
|
// node_modules/prop-types/lib/has.js
|
|
393
387
|
var require_has = __commonJS({
|
|
394
|
-
"node_modules/prop-types/lib/has.js"(
|
|
388
|
+
"node_modules/prop-types/lib/has.js"(exports, module) {
|
|
395
389
|
"use strict";
|
|
396
|
-
|
|
390
|
+
module.exports = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
397
391
|
}
|
|
398
392
|
});
|
|
399
393
|
|
|
400
394
|
// node_modules/prop-types/checkPropTypes.js
|
|
401
395
|
var require_checkPropTypes = __commonJS({
|
|
402
|
-
"node_modules/prop-types/checkPropTypes.js"(
|
|
396
|
+
"node_modules/prop-types/checkPropTypes.js"(exports, module) {
|
|
403
397
|
"use strict";
|
|
404
398
|
var printWarning = function() {
|
|
405
399
|
};
|
|
@@ -459,13 +453,13 @@ var require_checkPropTypes = __commonJS({
|
|
|
459
453
|
loggedTypeFailures = {};
|
|
460
454
|
}
|
|
461
455
|
};
|
|
462
|
-
|
|
456
|
+
module.exports = checkPropTypes;
|
|
463
457
|
}
|
|
464
458
|
});
|
|
465
459
|
|
|
466
460
|
// node_modules/prop-types/factoryWithTypeCheckers.js
|
|
467
461
|
var require_factoryWithTypeCheckers = __commonJS({
|
|
468
|
-
"node_modules/prop-types/factoryWithTypeCheckers.js"(
|
|
462
|
+
"node_modules/prop-types/factoryWithTypeCheckers.js"(exports, module) {
|
|
469
463
|
"use strict";
|
|
470
464
|
var ReactIs = require_react_is();
|
|
471
465
|
var assign = require_object_assign();
|
|
@@ -489,7 +483,7 @@ var require_factoryWithTypeCheckers = __commonJS({
|
|
|
489
483
|
function emptyFunctionThatReturnsNull() {
|
|
490
484
|
return null;
|
|
491
485
|
}
|
|
492
|
-
|
|
486
|
+
module.exports = function(isValidElement, throwOnDirectAccess) {
|
|
493
487
|
var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
|
|
494
488
|
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
495
489
|
function getIteratorFn(maybeIterable) {
|
|
@@ -908,7 +902,7 @@ var require_factoryWithTypeCheckers = __commonJS({
|
|
|
908
902
|
|
|
909
903
|
// node_modules/prop-types/factoryWithThrowingShims.js
|
|
910
904
|
var require_factoryWithThrowingShims = __commonJS({
|
|
911
|
-
"node_modules/prop-types/factoryWithThrowingShims.js"(
|
|
905
|
+
"node_modules/prop-types/factoryWithThrowingShims.js"(exports, module) {
|
|
912
906
|
"use strict";
|
|
913
907
|
var ReactPropTypesSecret = require_ReactPropTypesSecret();
|
|
914
908
|
function emptyFunction() {
|
|
@@ -916,7 +910,7 @@ var require_factoryWithThrowingShims = __commonJS({
|
|
|
916
910
|
function emptyFunctionWithReset() {
|
|
917
911
|
}
|
|
918
912
|
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
919
|
-
|
|
913
|
+
module.exports = function() {
|
|
920
914
|
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
921
915
|
if (secret === ReactPropTypesSecret) {
|
|
922
916
|
return;
|
|
@@ -964,66 +958,23 @@ var require_factoryWithThrowingShims = __commonJS({
|
|
|
964
958
|
|
|
965
959
|
// node_modules/prop-types/index.js
|
|
966
960
|
var require_prop_types = __commonJS({
|
|
967
|
-
"node_modules/prop-types/index.js"(
|
|
961
|
+
"node_modules/prop-types/index.js"(exports, module) {
|
|
968
962
|
"use strict";
|
|
969
963
|
if (process.env.NODE_ENV !== "production") {
|
|
970
964
|
ReactIs = require_react_is();
|
|
971
965
|
throwOnDirectAccess = true;
|
|
972
|
-
|
|
966
|
+
module.exports = require_factoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
|
|
973
967
|
} else {
|
|
974
|
-
|
|
968
|
+
module.exports = require_factoryWithThrowingShims()();
|
|
975
969
|
}
|
|
976
970
|
var ReactIs;
|
|
977
971
|
var throwOnDirectAccess;
|
|
978
972
|
}
|
|
979
973
|
});
|
|
980
974
|
|
|
981
|
-
// src/index.ts
|
|
982
|
-
var index_exports = {};
|
|
983
|
-
__export(index_exports, {
|
|
984
|
-
ChipInputCell: () => ChipInputCell,
|
|
985
|
-
Dropzone: () => Dropzone,
|
|
986
|
-
EditableColumnHeader: () => EditableColumnHeader,
|
|
987
|
-
FileViewer: () => FileViewer,
|
|
988
|
-
LayoutProvider: () => LayoutProvider,
|
|
989
|
-
PageHeader: () => PageHeader,
|
|
990
|
-
Platform: () => Platform,
|
|
991
|
-
RouterButton: () => RouterButton,
|
|
992
|
-
RouterError: () => RouterError,
|
|
993
|
-
RouterGridActionsCellItem: () => RouterGridActionsCellItem,
|
|
994
|
-
RouterIconButton: () => RouterIconButton,
|
|
995
|
-
RouterLink: () => RouterLink,
|
|
996
|
-
RouterListItemButton: () => RouterListItemButton,
|
|
997
|
-
RouterNotFound: () => RouterNotFound,
|
|
998
|
-
RouterTab: () => RouterTab,
|
|
999
|
-
TableContainer: () => TableContainer,
|
|
1000
|
-
TypographyWithIcon: () => TypographyWithIcon,
|
|
1001
|
-
rootRouteHead: () => rootRouteHead,
|
|
1002
|
-
t: () => import_i18next3.t,
|
|
1003
|
-
useDeleteFile: () => useDeleteFile,
|
|
1004
|
-
useDeleteFiles: () => useDeleteFiles,
|
|
1005
|
-
useDialogs: () => useDialogs,
|
|
1006
|
-
useDownloadFile: () => useDownloadFile,
|
|
1007
|
-
useFieldContext: () => useFieldContext,
|
|
1008
|
-
useFormContext: () => useFormContext,
|
|
1009
|
-
useGetFile: () => useGetFile,
|
|
1010
|
-
useGetFileMetas: () => useGetFileMetas,
|
|
1011
|
-
useGetFileThumbnail: () => useGetFileThumbnail,
|
|
1012
|
-
useLayoutForm: () => useLayoutForm,
|
|
1013
|
-
useLocalStorageState: () => import_use_local_storage_state2.default,
|
|
1014
|
-
useOpenFile: () => useOpenFile,
|
|
1015
|
-
useTranslation: () => import_react_i18next9.useTranslation,
|
|
1016
|
-
useUpdateFileMeta: () => useUpdateFileMeta,
|
|
1017
|
-
useUploadFile: () => useUploadFile,
|
|
1018
|
-
uuidv7: () => import_uuidv72.uuidv7,
|
|
1019
|
-
wczApiClient: () => wczApiClient,
|
|
1020
|
-
withLayoutForm: () => withLayoutForm
|
|
1021
|
-
});
|
|
1022
|
-
module.exports = __toCommonJS(index_exports);
|
|
1023
|
-
|
|
1024
975
|
// src/components/core/TypographyWithIcon.tsx
|
|
1025
|
-
|
|
1026
|
-
|
|
976
|
+
import { Stack, Typography } from "@mui/material";
|
|
977
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
1027
978
|
var stackSxProps = [
|
|
1028
979
|
"margin",
|
|
1029
980
|
"marginTop",
|
|
@@ -1082,28 +1033,28 @@ var TypographyWithIcon = ({ startIcon, endIcon, children, sx, gutterBottom, ...p
|
|
|
1082
1033
|
}
|
|
1083
1034
|
}
|
|
1084
1035
|
}
|
|
1085
|
-
return /* @__PURE__ */
|
|
1036
|
+
return /* @__PURE__ */ jsxs(Stack, { direction: "row", alignItems: "center", gap: 1, sx: stackStyles, mb: gutterBottom ? 0.7 : void 0, children: [
|
|
1086
1037
|
startIcon,
|
|
1087
|
-
/* @__PURE__ */
|
|
1038
|
+
/* @__PURE__ */ jsx(Typography, { ...props, sx: sxCopy, children }),
|
|
1088
1039
|
endIcon
|
|
1089
1040
|
] });
|
|
1090
1041
|
};
|
|
1091
1042
|
|
|
1092
1043
|
// src/components/core/PageHeader.tsx
|
|
1093
|
-
|
|
1094
|
-
|
|
1044
|
+
import { CardHeader, Typography as Typography2 } from "@mui/material";
|
|
1045
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
1095
1046
|
var PageHeader = ({ title, action, sx }) => {
|
|
1096
|
-
return /* @__PURE__ */ (
|
|
1047
|
+
return /* @__PURE__ */ jsx2(CardHeader, { title: /* @__PURE__ */ jsx2(Typography2, { variant: "h4", fontWeight: 600, children: title }), action, sx: { px: 0, ...sx } });
|
|
1097
1048
|
};
|
|
1098
1049
|
|
|
1099
1050
|
// src/components/core/TableContainer.tsx
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1051
|
+
import { Box } from "@mui/material";
|
|
1052
|
+
import { useEffect, useRef, useState } from "react";
|
|
1053
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
1103
1054
|
var TableContainer = ({ children, sx, ...props }) => {
|
|
1104
|
-
const reference =
|
|
1105
|
-
const [height, setHeight] =
|
|
1106
|
-
|
|
1055
|
+
const reference = useRef(null);
|
|
1056
|
+
const [height, setHeight] = useState();
|
|
1057
|
+
useEffect(() => {
|
|
1107
1058
|
const element = reference.current;
|
|
1108
1059
|
if (!element) return;
|
|
1109
1060
|
const recompute = () => {
|
|
@@ -1123,8 +1074,8 @@ var TableContainer = ({ children, sx, ...props }) => {
|
|
|
1123
1074
|
ro.disconnect();
|
|
1124
1075
|
};
|
|
1125
1076
|
}, []);
|
|
1126
|
-
return /* @__PURE__ */ (
|
|
1127
|
-
|
|
1077
|
+
return /* @__PURE__ */ jsx3(
|
|
1078
|
+
Box,
|
|
1128
1079
|
{
|
|
1129
1080
|
ref: reference,
|
|
1130
1081
|
sx: {
|
|
@@ -1136,7 +1087,7 @@ var TableContainer = ({ children, sx, ...props }) => {
|
|
|
1136
1087
|
},
|
|
1137
1088
|
height,
|
|
1138
1089
|
...props,
|
|
1139
|
-
children: /* @__PURE__ */ (
|
|
1090
|
+
children: /* @__PURE__ */ jsx3(Box, { sx: (theme) => ({
|
|
1140
1091
|
flex: 1,
|
|
1141
1092
|
minHeight: 0,
|
|
1142
1093
|
height: "100%",
|
|
@@ -1164,11 +1115,11 @@ var TableContainer = ({ children, sx, ...props }) => {
|
|
|
1164
1115
|
};
|
|
1165
1116
|
|
|
1166
1117
|
// src/components/file/Dropzone.tsx
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1118
|
+
import CloudUpload from "@mui/icons-material/CloudUpload";
|
|
1119
|
+
import { Paper, Typography as Typography3, useTheme } from "@mui/material";
|
|
1120
|
+
import { useDropzone } from "react-dropzone";
|
|
1121
|
+
import { useTranslation } from "react-i18next";
|
|
1122
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1172
1123
|
var baseStyle = {
|
|
1173
1124
|
flex: 1,
|
|
1174
1125
|
display: "flex",
|
|
@@ -1183,63 +1134,142 @@ var baseStyle = {
|
|
|
1183
1134
|
cursor: "pointer"
|
|
1184
1135
|
};
|
|
1185
1136
|
var Dropzone = ({ sx, ...props }) => {
|
|
1186
|
-
const { getRootProps, getInputProps, isFocused, isDragAccept, isDragReject } =
|
|
1187
|
-
const { t: t2 } =
|
|
1188
|
-
const theme =
|
|
1137
|
+
const { getRootProps, getInputProps, isFocused, isDragAccept, isDragReject } = useDropzone(props);
|
|
1138
|
+
const { t: t2 } = useTranslation();
|
|
1139
|
+
const theme = useTheme();
|
|
1189
1140
|
const style = {
|
|
1190
1141
|
...baseStyle,
|
|
1191
1142
|
...isFocused ? { borderColor: theme.palette.primary.main } : {},
|
|
1192
1143
|
...isDragAccept ? { borderColor: theme.palette.success.main } : {},
|
|
1193
1144
|
...isDragReject ? { borderColor: theme.palette.error.main } : {}
|
|
1194
1145
|
};
|
|
1195
|
-
return /* @__PURE__ */ (
|
|
1196
|
-
/* @__PURE__ */ (
|
|
1197
|
-
/* @__PURE__ */ (
|
|
1198
|
-
/* @__PURE__ */ (
|
|
1146
|
+
return /* @__PURE__ */ jsxs2(Paper, { variant: "outlined", ...getRootProps({ style }), sx, children: [
|
|
1147
|
+
/* @__PURE__ */ jsx4("input", { ...getInputProps(), style: { display: "none" } }),
|
|
1148
|
+
/* @__PURE__ */ jsx4(CloudUpload, {}),
|
|
1149
|
+
/* @__PURE__ */ jsx4(Typography3, { children: t2("Layout.File.DragSomeFilesHereOrClickToSelectThem") })
|
|
1199
1150
|
] });
|
|
1200
1151
|
};
|
|
1201
1152
|
|
|
1202
1153
|
// src/components/file/FileViewer.tsx
|
|
1203
|
-
|
|
1154
|
+
import { useState as useState5 } from "react";
|
|
1155
|
+
|
|
1156
|
+
// src/components/file/fileViewer/FileViewerGrid.tsx
|
|
1157
|
+
import MoreVert from "@mui/icons-material/MoreVert";
|
|
1158
|
+
import { Box as Box2, IconButton, ImageListItem, ImageListItemBar, Stack as Stack3, Tooltip } from "@mui/material";
|
|
1159
|
+
import { grey } from "@mui/material/colors";
|
|
1160
|
+
import { Fragment, useEffect as useEffect3, useState as useState3 } from "react";
|
|
1161
|
+
|
|
1162
|
+
// src/components/file/fileViewer/common/ActionsMenu.tsx
|
|
1163
|
+
import Delete from "@mui/icons-material/Delete";
|
|
1164
|
+
import FileDownload from "@mui/icons-material/FileDownload";
|
|
1165
|
+
import { List, ListItemButton, ListItemIcon, ListItemText, Menu } from "@mui/material";
|
|
1166
|
+
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
1204
1167
|
|
|
1205
1168
|
// src/contexts/FileContext.ts
|
|
1206
|
-
|
|
1207
|
-
var FileContext =
|
|
1169
|
+
import { createContext, useContext } from "react";
|
|
1170
|
+
var FileContext = createContext(null);
|
|
1208
1171
|
var useFile = () => {
|
|
1209
|
-
const context =
|
|
1172
|
+
const context = useContext(FileContext);
|
|
1210
1173
|
if (!context) {
|
|
1211
1174
|
throw new Error("FileViewer components must be used within FileViewer");
|
|
1212
1175
|
}
|
|
1213
1176
|
return context;
|
|
1214
1177
|
};
|
|
1215
1178
|
|
|
1179
|
+
// src/hooks/DialogsHooks.tsx
|
|
1180
|
+
import Button from "@mui/material/Button";
|
|
1181
|
+
import Dialog from "@mui/material/Dialog";
|
|
1182
|
+
import DialogActions from "@mui/material/DialogActions";
|
|
1183
|
+
import DialogContent from "@mui/material/DialogContent";
|
|
1184
|
+
import DialogTitle from "@mui/material/DialogTitle";
|
|
1185
|
+
|
|
1186
|
+
// node_modules/@mui/utils/esm/useEventCallback/useEventCallback.js
|
|
1187
|
+
import * as React2 from "react";
|
|
1188
|
+
|
|
1189
|
+
// node_modules/@mui/utils/esm/useEnhancedEffect/useEnhancedEffect.js
|
|
1190
|
+
import * as React from "react";
|
|
1191
|
+
var useEnhancedEffect = typeof window !== "undefined" ? React.useLayoutEffect : React.useEffect;
|
|
1192
|
+
var useEnhancedEffect_default = useEnhancedEffect;
|
|
1193
|
+
|
|
1194
|
+
// node_modules/@mui/utils/esm/useEventCallback/useEventCallback.js
|
|
1195
|
+
function useEventCallback(fn) {
|
|
1196
|
+
const ref = React2.useRef(fn);
|
|
1197
|
+
useEnhancedEffect_default(() => {
|
|
1198
|
+
ref.current = fn;
|
|
1199
|
+
});
|
|
1200
|
+
return React2.useRef((...args) => (
|
|
1201
|
+
// @ts-expect-error hide `this`
|
|
1202
|
+
(0, ref.current)(...args)
|
|
1203
|
+
)).current;
|
|
1204
|
+
}
|
|
1205
|
+
var useEventCallback_default = useEventCallback;
|
|
1206
|
+
|
|
1207
|
+
// src/hooks/DialogsHooks.tsx
|
|
1208
|
+
import { useContext as useContext2, useMemo } from "react";
|
|
1209
|
+
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
1210
|
+
|
|
1211
|
+
// src/contexts/DialogsContext.ts
|
|
1212
|
+
import { createContext as createContext2 } from "react";
|
|
1213
|
+
var DialogsContext = createContext2({});
|
|
1214
|
+
|
|
1215
|
+
// src/hooks/DialogsHooks.tsx
|
|
1216
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1217
|
+
function AlertDialog({ open, payload, onClose }) {
|
|
1218
|
+
const { t: t2 } = useTranslation2();
|
|
1219
|
+
return /* @__PURE__ */ jsxs3(Dialog, { maxWidth: "xs", fullWidth: true, open, onClose: () => onClose(), children: [
|
|
1220
|
+
/* @__PURE__ */ jsx5(DialogTitle, { children: payload.title ?? t2("Layout.Dialog.Alert") }),
|
|
1221
|
+
/* @__PURE__ */ jsx5(DialogContent, { children: payload.message }),
|
|
1222
|
+
/* @__PURE__ */ jsx5(DialogActions, { children: /* @__PURE__ */ jsx5(Button, { disabled: !open, onClick: () => onClose(), children: t2("Layout.Dialog.Confirm") }) })
|
|
1223
|
+
] });
|
|
1224
|
+
}
|
|
1225
|
+
function ConfirmDialog({ open, payload, onClose }) {
|
|
1226
|
+
const { t: t2 } = useTranslation2();
|
|
1227
|
+
return /* @__PURE__ */ jsxs3(Dialog, { maxWidth: "xs", fullWidth: true, open, onClose: () => onClose(false), children: [
|
|
1228
|
+
/* @__PURE__ */ jsx5(DialogTitle, { children: payload.title ?? t2("Layout.Dialog.Confirm") }),
|
|
1229
|
+
/* @__PURE__ */ jsx5(DialogContent, { children: payload.message }),
|
|
1230
|
+
/* @__PURE__ */ jsxs3(DialogActions, { children: [
|
|
1231
|
+
/* @__PURE__ */ jsx5(Button, { autoFocus: true, disabled: !open, onClick: () => onClose(false), children: payload.cancelText ?? t2("Layout.Dialog.Cancel") }),
|
|
1232
|
+
/* @__PURE__ */ jsx5(Button, { disabled: !open, onClick: () => onClose(true), children: t2("Layout.Dialog.Confirm") })
|
|
1233
|
+
] })
|
|
1234
|
+
] });
|
|
1235
|
+
}
|
|
1236
|
+
function useDialogs() {
|
|
1237
|
+
const { open, close } = useContext2(DialogsContext);
|
|
1238
|
+
const alert = useEventCallback_default(
|
|
1239
|
+
(message, { ...options } = {}) => open(AlertDialog, { ...options, message })
|
|
1240
|
+
);
|
|
1241
|
+
const confirm = useEventCallback_default(
|
|
1242
|
+
(message, { ...options } = {}) => open(ConfirmDialog, { ...options, message })
|
|
1243
|
+
);
|
|
1244
|
+
return useMemo(() => ({ alert, confirm, open, close }), [alert, close, confirm, open]);
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1216
1247
|
// src/hooks/FileHooks.ts
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1248
|
+
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
1249
|
+
import saveAs from "file-saver";
|
|
1250
|
+
import { useState as useState2 } from "react";
|
|
1251
|
+
import { Upload as TusUpload } from "tus-js-client";
|
|
1252
|
+
import { uuidv7 } from "uuidv7";
|
|
1222
1253
|
|
|
1223
1254
|
// src/components/core/AppTitle.tsx
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
var import_meta = {};
|
|
1255
|
+
import { Chip, Stack as Stack2, Typography as Typography4 } from "@mui/material";
|
|
1256
|
+
import { useRouterState } from "@tanstack/react-router";
|
|
1257
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1228
1258
|
var AppTitle = () => {
|
|
1229
1259
|
const title = useAppTitle();
|
|
1230
|
-
return /* @__PURE__ */ (
|
|
1231
|
-
/* @__PURE__ */ (
|
|
1232
|
-
/* @__PURE__ */ (
|
|
1233
|
-
|
|
1260
|
+
return /* @__PURE__ */ jsxs4(Stack2, { direction: "row", alignItems: "center", spacing: 2, flexGrow: 1, children: [
|
|
1261
|
+
/* @__PURE__ */ jsx6("img", { src: "/favicon-32x32.png", alt: "app-logo", loading: "lazy" }),
|
|
1262
|
+
/* @__PURE__ */ jsx6(Typography4, { variant: "h6", children: title }),
|
|
1263
|
+
import.meta.env.DEV && /* @__PURE__ */ jsx6(Chip, { size: "small", label: "TEST", color: "info" })
|
|
1234
1264
|
] });
|
|
1235
1265
|
};
|
|
1236
1266
|
var useAppTitle = () => {
|
|
1237
|
-
const rootRouterState =
|
|
1267
|
+
const rootRouterState = useRouterState({ select: (s) => s.matches[0] });
|
|
1238
1268
|
return rootRouterState.meta?.find((meta) => meta?.title)?.title;
|
|
1239
1269
|
};
|
|
1240
1270
|
|
|
1241
1271
|
// src/utils/ClientUtils.ts
|
|
1242
|
-
|
|
1272
|
+
import axios from "axios";
|
|
1243
1273
|
var Platform = class {
|
|
1244
1274
|
static get isAndroid() {
|
|
1245
1275
|
return /android/i.test(this.userAgent);
|
|
@@ -1274,16 +1304,15 @@ var rootRouteHead = ({ title }) => () => ({
|
|
|
1274
1304
|
{ rel: "icon", href: "/favicon.ico" }
|
|
1275
1305
|
]
|
|
1276
1306
|
});
|
|
1277
|
-
var wczApiClient =
|
|
1307
|
+
var wczApiClient = axios.create();
|
|
1278
1308
|
|
|
1279
1309
|
// src/hooks/FileHooks.ts
|
|
1280
|
-
var
|
|
1281
|
-
var BASE_URL = import_meta2.env.VITE_FILE_API_BASE_URL;
|
|
1310
|
+
var BASE_URL = import.meta.env.VITE_FILE_API_BASE_URL;
|
|
1282
1311
|
var QUERY_KEY = "Files";
|
|
1283
1312
|
var HOUR = 1e3 * 60 * 60;
|
|
1284
1313
|
var useGetFileMetas = (subId, options) => {
|
|
1285
1314
|
const appTitle = useAppTitle();
|
|
1286
|
-
return
|
|
1315
|
+
return useQuery({
|
|
1287
1316
|
...options,
|
|
1288
1317
|
queryKey: [QUERY_KEY, "meta", subId, appTitle],
|
|
1289
1318
|
queryFn: ({ signal }) => wczApiClient.request({
|
|
@@ -1298,7 +1327,7 @@ var useGetFileMetas = (subId, options) => {
|
|
|
1298
1327
|
};
|
|
1299
1328
|
var useGetFileThumbnail = (meta, options) => {
|
|
1300
1329
|
const appTitle = useAppTitle();
|
|
1301
|
-
return
|
|
1330
|
+
return useQuery({
|
|
1302
1331
|
...options,
|
|
1303
1332
|
queryKey: [QUERY_KEY, "thumbnail", meta?.id, appTitle],
|
|
1304
1333
|
queryFn: ({ signal }) => wczApiClient.request({
|
|
@@ -1316,7 +1345,7 @@ var useGetFileThumbnail = (meta, options) => {
|
|
|
1316
1345
|
};
|
|
1317
1346
|
var useGetFile = (meta, options) => {
|
|
1318
1347
|
const appTitle = useAppTitle();
|
|
1319
|
-
return
|
|
1348
|
+
return useQuery({
|
|
1320
1349
|
...options,
|
|
1321
1350
|
queryKey: [QUERY_KEY, meta?.id, appTitle],
|
|
1322
1351
|
queryFn: ({ signal }) => wczApiClient.request({
|
|
@@ -1334,19 +1363,19 @@ var useGetFile = (meta, options) => {
|
|
|
1334
1363
|
};
|
|
1335
1364
|
var useDownloadFile = (options) => {
|
|
1336
1365
|
const appTitle = useAppTitle();
|
|
1337
|
-
return
|
|
1366
|
+
return useMutation({
|
|
1338
1367
|
...options,
|
|
1339
1368
|
mutationFn: (meta) => wczApiClient.request({
|
|
1340
1369
|
url: `${BASE_URL}/v1/download?appName=${appTitle}&id=${meta.id}`,
|
|
1341
1370
|
method: "GET",
|
|
1342
1371
|
responseType: "blob"
|
|
1343
1372
|
}),
|
|
1344
|
-
onSuccess: (data, variables) => (
|
|
1373
|
+
onSuccess: (data, variables) => saveAs(data, `${variables.fileName}.${variables.fileExtension}`)
|
|
1345
1374
|
});
|
|
1346
1375
|
};
|
|
1347
1376
|
var useOpenFile = (options) => {
|
|
1348
1377
|
const appTitle = useAppTitle();
|
|
1349
|
-
return
|
|
1378
|
+
return useMutation({
|
|
1350
1379
|
...options,
|
|
1351
1380
|
mutationFn: (meta) => wczApiClient.request({
|
|
1352
1381
|
url: `${BASE_URL}/v1?appName=${appTitle}&id=${meta.id}`,
|
|
@@ -1360,8 +1389,8 @@ var useOpenFile = (options) => {
|
|
|
1360
1389
|
};
|
|
1361
1390
|
var useUpdateFileMeta = (options) => {
|
|
1362
1391
|
const appTitle = useAppTitle();
|
|
1363
|
-
const queryClient =
|
|
1364
|
-
return
|
|
1392
|
+
const queryClient = useQueryClient();
|
|
1393
|
+
return useMutation({
|
|
1365
1394
|
...options,
|
|
1366
1395
|
mutationFn: (meta) => wczApiClient.request({
|
|
1367
1396
|
url: `${BASE_URL}/v1/meta?appName=${appTitle}&id=${meta.id}`,
|
|
@@ -1373,8 +1402,8 @@ var useUpdateFileMeta = (options) => {
|
|
|
1373
1402
|
};
|
|
1374
1403
|
var useDeleteFile = (options) => {
|
|
1375
1404
|
const appTitle = useAppTitle();
|
|
1376
|
-
const queryClient =
|
|
1377
|
-
return
|
|
1405
|
+
const queryClient = useQueryClient();
|
|
1406
|
+
return useMutation({
|
|
1378
1407
|
...options,
|
|
1379
1408
|
mutationFn: (meta) => wczApiClient.request({
|
|
1380
1409
|
url: `${BASE_URL}/v1?appName=${appTitle}&id=${meta.id}`,
|
|
@@ -1385,8 +1414,8 @@ var useDeleteFile = (options) => {
|
|
|
1385
1414
|
};
|
|
1386
1415
|
var useDeleteFiles = (options) => {
|
|
1387
1416
|
const appTitle = useAppTitle();
|
|
1388
|
-
const queryClient =
|
|
1389
|
-
return
|
|
1417
|
+
const queryClient = useQueryClient();
|
|
1418
|
+
return useMutation({
|
|
1390
1419
|
...options,
|
|
1391
1420
|
mutationFn: (subId) => wczApiClient.request({
|
|
1392
1421
|
url: `${BASE_URL}/v1?appName=${appTitle}&subId=${subId}`,
|
|
@@ -1397,18 +1426,18 @@ var useDeleteFiles = (options) => {
|
|
|
1397
1426
|
};
|
|
1398
1427
|
var useUploadFile = ({ subId, onSuccess, onError }) => {
|
|
1399
1428
|
const appTitle = useAppTitle();
|
|
1400
|
-
const [progress, setProgress] = (0
|
|
1401
|
-
const queryClient =
|
|
1429
|
+
const [progress, setProgress] = useState2(0);
|
|
1430
|
+
const queryClient = useQueryClient();
|
|
1402
1431
|
const mutate = async (file) => {
|
|
1403
1432
|
if (!subId) throw new Error("subId is required for file upload");
|
|
1404
1433
|
if (!appTitle) throw new Error("appTitle is required for file upload");
|
|
1405
1434
|
const metadata = {
|
|
1406
|
-
id:
|
|
1435
|
+
id: uuidv7(),
|
|
1407
1436
|
appName: appTitle,
|
|
1408
1437
|
subId,
|
|
1409
1438
|
fileName: file.name
|
|
1410
1439
|
};
|
|
1411
|
-
const upload = new
|
|
1440
|
+
const upload = new TusUpload(file, {
|
|
1412
1441
|
endpoint: `${BASE_URL}/v1/upload`,
|
|
1413
1442
|
chunkSize: 1048576,
|
|
1414
1443
|
// 1 MB
|
|
@@ -1419,7 +1448,7 @@ var useUploadFile = ({ subId, onSuccess, onError }) => {
|
|
|
1419
1448
|
fileName: metadata.fileName,
|
|
1420
1449
|
fileExtension: file.type
|
|
1421
1450
|
},
|
|
1422
|
-
//headers: { "Authorization": `Bearer ${await getToken()}` }, //TODO: implement token retrieval
|
|
1451
|
+
// headers: { "Authorization": `Bearer ${await getToken()}` }, //TODO: implement token retrieval
|
|
1423
1452
|
onError: (error) => {
|
|
1424
1453
|
setProgress(0);
|
|
1425
1454
|
onError?.(error);
|
|
@@ -1442,90 +1471,10 @@ var useUploadFile = ({ subId, onSuccess, onError }) => {
|
|
|
1442
1471
|
return { mutate, progress };
|
|
1443
1472
|
};
|
|
1444
1473
|
|
|
1445
|
-
// src/components/file/fileViewer/FileViewerGrid.tsx
|
|
1446
|
-
var import_MoreVert = __toESM(require("@mui/icons-material/MoreVert"), 1);
|
|
1447
|
-
var import_material7 = require("@mui/material");
|
|
1448
|
-
var import_colors = require("@mui/material/colors");
|
|
1449
|
-
var import_react6 = require("react");
|
|
1450
|
-
|
|
1451
|
-
// src/components/file/fileViewer/common/ActionsMenu.tsx
|
|
1452
|
-
var import_Delete = __toESM(require("@mui/icons-material/Delete"), 1);
|
|
1453
|
-
var import_FileDownload = __toESM(require("@mui/icons-material/FileDownload"), 1);
|
|
1454
|
-
var import_material6 = require("@mui/material");
|
|
1455
|
-
var import_react_i18next3 = require("react-i18next");
|
|
1456
|
-
|
|
1457
|
-
// src/hooks/DialogsHooks.tsx
|
|
1458
|
-
var import_Button = __toESM(require("@mui/material/Button"), 1);
|
|
1459
|
-
var import_Dialog = __toESM(require("@mui/material/Dialog"), 1);
|
|
1460
|
-
var import_DialogActions = __toESM(require("@mui/material/DialogActions"), 1);
|
|
1461
|
-
var import_DialogContent = __toESM(require("@mui/material/DialogContent"), 1);
|
|
1462
|
-
var import_DialogTitle = __toESM(require("@mui/material/DialogTitle"), 1);
|
|
1463
|
-
|
|
1464
|
-
// node_modules/@mui/utils/esm/useEventCallback/useEventCallback.js
|
|
1465
|
-
var React2 = __toESM(require("react"), 1);
|
|
1466
|
-
|
|
1467
|
-
// node_modules/@mui/utils/esm/useEnhancedEffect/useEnhancedEffect.js
|
|
1468
|
-
var React = __toESM(require("react"), 1);
|
|
1469
|
-
var useEnhancedEffect = typeof window !== "undefined" ? React.useLayoutEffect : React.useEffect;
|
|
1470
|
-
var useEnhancedEffect_default = useEnhancedEffect;
|
|
1471
|
-
|
|
1472
|
-
// node_modules/@mui/utils/esm/useEventCallback/useEventCallback.js
|
|
1473
|
-
function useEventCallback(fn) {
|
|
1474
|
-
const ref = React2.useRef(fn);
|
|
1475
|
-
useEnhancedEffect_default(() => {
|
|
1476
|
-
ref.current = fn;
|
|
1477
|
-
});
|
|
1478
|
-
return React2.useRef((...args) => (
|
|
1479
|
-
// @ts-expect-error hide `this`
|
|
1480
|
-
(0, ref.current)(...args)
|
|
1481
|
-
)).current;
|
|
1482
|
-
}
|
|
1483
|
-
var useEventCallback_default = useEventCallback;
|
|
1484
|
-
|
|
1485
|
-
// src/hooks/DialogsHooks.tsx
|
|
1486
|
-
var import_react5 = require("react");
|
|
1487
|
-
var import_react_i18next2 = require("react-i18next");
|
|
1488
|
-
|
|
1489
|
-
// src/contexts/DialogsContext.ts
|
|
1490
|
-
var import_react4 = require("react");
|
|
1491
|
-
var DialogsContext = (0, import_react4.createContext)({});
|
|
1492
|
-
|
|
1493
|
-
// src/hooks/DialogsHooks.tsx
|
|
1494
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1495
|
-
function AlertDialog({ open, payload, onClose }) {
|
|
1496
|
-
const { t: t2 } = (0, import_react_i18next2.useTranslation)();
|
|
1497
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Dialog.default, { maxWidth: "xs", fullWidth: true, open, onClose: () => onClose(), children: [
|
|
1498
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_DialogTitle.default, { children: payload.title ?? t2("Layout.Dialog.Alert") }),
|
|
1499
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_DialogContent.default, { children: payload.message }),
|
|
1500
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_DialogActions.default, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Button.default, { disabled: !open, onClick: () => onClose(), children: t2("Layout.Dialog.Confirm") }) })
|
|
1501
|
-
] });
|
|
1502
|
-
}
|
|
1503
|
-
function ConfirmDialog({ open, payload, onClose }) {
|
|
1504
|
-
const { t: t2 } = (0, import_react_i18next2.useTranslation)();
|
|
1505
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Dialog.default, { maxWidth: "xs", fullWidth: true, open, onClose: () => onClose(false), children: [
|
|
1506
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_DialogTitle.default, { children: payload.title ?? t2("Layout.Dialog.Confirm") }),
|
|
1507
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_DialogContent.default, { children: payload.message }),
|
|
1508
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_DialogActions.default, { children: [
|
|
1509
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Button.default, { autoFocus: true, disabled: !open, onClick: () => onClose(false), children: payload.cancelText ?? t2("Layout.Dialog.Cancel") }),
|
|
1510
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Button.default, { disabled: !open, onClick: () => onClose(true), children: t2("Layout.Dialog.Confirm") })
|
|
1511
|
-
] })
|
|
1512
|
-
] });
|
|
1513
|
-
}
|
|
1514
|
-
function useDialogs() {
|
|
1515
|
-
const { open, close } = (0, import_react5.useContext)(DialogsContext);
|
|
1516
|
-
const alert = useEventCallback_default(
|
|
1517
|
-
(message, { ...options } = {}) => open(AlertDialog, { ...options, message })
|
|
1518
|
-
);
|
|
1519
|
-
const confirm = useEventCallback_default(
|
|
1520
|
-
(message, { ...options } = {}) => open(ConfirmDialog, { ...options, message })
|
|
1521
|
-
);
|
|
1522
|
-
return (0, import_react5.useMemo)(() => ({ alert, confirm, open, close }), [alert, close, confirm, open]);
|
|
1523
|
-
}
|
|
1524
|
-
|
|
1525
1474
|
// src/components/file/fileViewer/common/ActionsMenu.tsx
|
|
1526
|
-
|
|
1475
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1527
1476
|
var ActionsMenu = ({ meta, menu, setMenu }) => {
|
|
1528
|
-
const { t: t2 } = (
|
|
1477
|
+
const { t: t2 } = useTranslation3();
|
|
1529
1478
|
const { fileMetas, onDelete, actions } = useFile();
|
|
1530
1479
|
const { confirm } = useDialogs();
|
|
1531
1480
|
const handleMenuClose = () => {
|
|
@@ -1547,22 +1496,22 @@ var ActionsMenu = ({ meta, menu, setMenu }) => {
|
|
|
1547
1496
|
onDelete({ remainingFileMetas, deletedFileMeta: meta });
|
|
1548
1497
|
}
|
|
1549
1498
|
};
|
|
1550
|
-
return /* @__PURE__ */ (
|
|
1551
|
-
|
|
1499
|
+
return /* @__PURE__ */ jsx7(
|
|
1500
|
+
Menu,
|
|
1552
1501
|
{
|
|
1553
1502
|
open: menu !== null,
|
|
1554
1503
|
onClose: handleMenuClose,
|
|
1555
1504
|
anchorReference: "anchorPosition",
|
|
1556
1505
|
variant: "menu",
|
|
1557
1506
|
anchorPosition: menu === null ? void 0 : { top: menu.mouseY, left: menu.mouseX },
|
|
1558
|
-
children: /* @__PURE__ */ (
|
|
1559
|
-
actions?.download !== false && /* @__PURE__ */ (
|
|
1560
|
-
/* @__PURE__ */ (
|
|
1561
|
-
/* @__PURE__ */ (
|
|
1507
|
+
children: /* @__PURE__ */ jsxs5(List, { disablePadding: true, children: [
|
|
1508
|
+
actions?.download !== false && /* @__PURE__ */ jsxs5(ListItemButton, { onClick: handleOnDownload, disabled: isDownloading, children: [
|
|
1509
|
+
/* @__PURE__ */ jsx7(ListItemIcon, { children: /* @__PURE__ */ jsx7(FileDownload, {}) }),
|
|
1510
|
+
/* @__PURE__ */ jsx7(ListItemText, { children: t2("Layout.File.Download") })
|
|
1562
1511
|
] }),
|
|
1563
|
-
actions?.delete !== false && /* @__PURE__ */ (
|
|
1564
|
-
/* @__PURE__ */ (
|
|
1565
|
-
/* @__PURE__ */ (
|
|
1512
|
+
actions?.delete !== false && /* @__PURE__ */ jsxs5(ListItemButton, { onClick: handleOnDelete, disabled: isDeleting, children: [
|
|
1513
|
+
/* @__PURE__ */ jsx7(ListItemIcon, { children: /* @__PURE__ */ jsx7(Delete, {}) }),
|
|
1514
|
+
/* @__PURE__ */ jsx7(ListItemText, { children: t2("Layout.File.Delete") })
|
|
1566
1515
|
] })
|
|
1567
1516
|
] })
|
|
1568
1517
|
}
|
|
@@ -1570,11 +1519,11 @@ var ActionsMenu = ({ meta, menu, setMenu }) => {
|
|
|
1570
1519
|
};
|
|
1571
1520
|
|
|
1572
1521
|
// src/components/file/fileViewer/FileViewerGrid.tsx
|
|
1573
|
-
|
|
1522
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1574
1523
|
var IMAGE_SIZE = 150;
|
|
1575
1524
|
var FileViewerGrid = ({ sx, size, itemBar }) => {
|
|
1576
1525
|
const { fileMetas } = useFile();
|
|
1577
|
-
return /* @__PURE__ */ (
|
|
1526
|
+
return /* @__PURE__ */ jsx8(Stack3, { direction: "row", spacing: 1, sx: { overflow: "auto", ...sx }, children: fileMetas.map((fileMeta) => /* @__PURE__ */ jsx8(
|
|
1578
1527
|
GridFileViewerItem,
|
|
1579
1528
|
{
|
|
1580
1529
|
meta: fileMeta,
|
|
@@ -1586,9 +1535,9 @@ var FileViewerGrid = ({ sx, size, itemBar }) => {
|
|
|
1586
1535
|
};
|
|
1587
1536
|
var GridFileViewerItem = ({ meta, size, itemBar }) => {
|
|
1588
1537
|
const { setImageId, actions } = useFile();
|
|
1589
|
-
const [showItemBar, setShowItemBar] = (
|
|
1590
|
-
const [menu, setMenu] = (
|
|
1591
|
-
(
|
|
1538
|
+
const [showItemBar, setShowItemBar] = useState3(itemBar === "always");
|
|
1539
|
+
const [menu, setMenu] = useState3(null);
|
|
1540
|
+
useEffect3(() => {
|
|
1592
1541
|
setShowItemBar(itemBar === "always");
|
|
1593
1542
|
}, [itemBar]);
|
|
1594
1543
|
const { data: source } = useGetFileThumbnail(meta);
|
|
@@ -1616,10 +1565,10 @@ var GridFileViewerItem = ({ meta, size, itemBar }) => {
|
|
|
1616
1565
|
}
|
|
1617
1566
|
}
|
|
1618
1567
|
};
|
|
1619
|
-
return /* @__PURE__ */ (
|
|
1620
|
-
/* @__PURE__ */ (
|
|
1621
|
-
/* @__PURE__ */ (
|
|
1622
|
-
|
|
1568
|
+
return /* @__PURE__ */ jsxs6(Fragment, { children: [
|
|
1569
|
+
/* @__PURE__ */ jsxs6(ImageListItem, { sx: { width: size ?? IMAGE_SIZE, height: size ?? IMAGE_SIZE }, onMouseEnter: handleOnMouseEnter, onMouseLeave: handleOnMouseLeave, children: [
|
|
1570
|
+
/* @__PURE__ */ jsx8(
|
|
1571
|
+
Box2,
|
|
1623
1572
|
{
|
|
1624
1573
|
component: "img",
|
|
1625
1574
|
src: source,
|
|
@@ -1629,30 +1578,30 @@ var GridFileViewerItem = ({ meta, size, itemBar }) => {
|
|
|
1629
1578
|
sx: { cursor: "pointer", objectFit: "contain", width: size ?? IMAGE_SIZE, height: size ?? IMAGE_SIZE }
|
|
1630
1579
|
}
|
|
1631
1580
|
),
|
|
1632
|
-
itemBar !== "hidden" && showItemBar && /* @__PURE__ */ (
|
|
1633
|
-
|
|
1581
|
+
itemBar !== "hidden" && showItemBar && /* @__PURE__ */ jsx8(
|
|
1582
|
+
ImageListItemBar,
|
|
1634
1583
|
{
|
|
1635
|
-
title: /* @__PURE__ */ (
|
|
1636
|
-
actionIcon: (actions?.download !== false || actions?.delete !== false) && /* @__PURE__ */ (
|
|
1584
|
+
title: /* @__PURE__ */ jsx8(Tooltip, { title: meta.fileName, children: /* @__PURE__ */ jsx8(Box2, { children: meta.fileName }) }),
|
|
1585
|
+
actionIcon: (actions?.download !== false || actions?.delete !== false) && /* @__PURE__ */ jsx8(IconButton, { sx: { color: grey[100] }, onClick: openMenu, children: /* @__PURE__ */ jsx8(MoreVert, {}) })
|
|
1637
1586
|
}
|
|
1638
1587
|
)
|
|
1639
1588
|
] }),
|
|
1640
|
-
(actions?.download !== false || actions?.delete !== false) && /* @__PURE__ */ (
|
|
1589
|
+
(actions?.download !== false || actions?.delete !== false) && /* @__PURE__ */ jsx8(ActionsMenu, { meta, menu, setMenu })
|
|
1641
1590
|
] });
|
|
1642
1591
|
};
|
|
1643
1592
|
|
|
1644
1593
|
// src/components/file/fileViewer/FileViewerList.tsx
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1594
|
+
import AttachFile from "@mui/icons-material/AttachFile";
|
|
1595
|
+
import Image from "@mui/icons-material/Image";
|
|
1596
|
+
import MoreVert2 from "@mui/icons-material/MoreVert";
|
|
1597
|
+
import SmartDisplay from "@mui/icons-material/SmartDisplay";
|
|
1598
|
+
import { IconButton as IconButton2, List as List2, ListItemButton as ListItemButton2, ListItemIcon as ListItemIcon2, ListItemText as ListItemText2 } from "@mui/material";
|
|
1599
|
+
import { Fragment as Fragment2, useState as useState4 } from "react";
|
|
1600
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1652
1601
|
var FileViewerList = ({ sx }) => {
|
|
1653
1602
|
const { fileMetas } = useFile();
|
|
1654
|
-
return /* @__PURE__ */ (
|
|
1655
|
-
(fileMeta) => /* @__PURE__ */ (
|
|
1603
|
+
return /* @__PURE__ */ jsx9(List2, { dense: true, sx, children: fileMetas.map(
|
|
1604
|
+
(fileMeta) => /* @__PURE__ */ jsx9(
|
|
1656
1605
|
ListFileViewerItem,
|
|
1657
1606
|
{
|
|
1658
1607
|
meta: fileMeta
|
|
@@ -1663,7 +1612,7 @@ var FileViewerList = ({ sx }) => {
|
|
|
1663
1612
|
};
|
|
1664
1613
|
var ListFileViewerItem = ({ meta }) => {
|
|
1665
1614
|
const { setImageId, actions } = useFile();
|
|
1666
|
-
const [menu, setMenu] = (
|
|
1615
|
+
const [menu, setMenu] = useState4(null);
|
|
1667
1616
|
const openMenu = (event) => {
|
|
1668
1617
|
event.stopPropagation();
|
|
1669
1618
|
setMenu(menu === null ? { mouseX: event.clientX, mouseY: event.clientY } : null);
|
|
@@ -1689,37 +1638,37 @@ var ListFileViewerItem = ({ meta }) => {
|
|
|
1689
1638
|
const icon = () => {
|
|
1690
1639
|
switch (meta.mediaType) {
|
|
1691
1640
|
case "image": {
|
|
1692
|
-
return /* @__PURE__ */ (
|
|
1641
|
+
return /* @__PURE__ */ jsx9(Image, {});
|
|
1693
1642
|
}
|
|
1694
1643
|
case "video": {
|
|
1695
|
-
return /* @__PURE__ */ (
|
|
1644
|
+
return /* @__PURE__ */ jsx9(SmartDisplay, {});
|
|
1696
1645
|
}
|
|
1697
1646
|
default: {
|
|
1698
|
-
return /* @__PURE__ */ (
|
|
1647
|
+
return /* @__PURE__ */ jsx9(AttachFile, {});
|
|
1699
1648
|
}
|
|
1700
1649
|
}
|
|
1701
1650
|
};
|
|
1702
|
-
return /* @__PURE__ */ (
|
|
1703
|
-
/* @__PURE__ */ (
|
|
1704
|
-
/* @__PURE__ */ (
|
|
1705
|
-
/* @__PURE__ */ (
|
|
1706
|
-
(actions?.download !== false || actions?.delete !== false) && /* @__PURE__ */ (
|
|
1651
|
+
return /* @__PURE__ */ jsxs7(Fragment2, { children: [
|
|
1652
|
+
/* @__PURE__ */ jsxs7(ListItemButton2, { onClick, children: [
|
|
1653
|
+
/* @__PURE__ */ jsx9(ListItemIcon2, { children: icon() }),
|
|
1654
|
+
/* @__PURE__ */ jsx9(ListItemText2, { primary: `${meta.fileName}.${meta.fileExtension}` }),
|
|
1655
|
+
(actions?.download !== false || actions?.delete !== false) && /* @__PURE__ */ jsx9(IconButton2, { edge: "end", onClick: openMenu, children: /* @__PURE__ */ jsx9(MoreVert2, {}) })
|
|
1707
1656
|
] }, meta.id),
|
|
1708
|
-
(actions?.download !== false || actions?.delete !== false) && /* @__PURE__ */ (
|
|
1657
|
+
(actions?.download !== false || actions?.delete !== false) && /* @__PURE__ */ jsx9(ActionsMenu, { meta, menu, setMenu })
|
|
1709
1658
|
] });
|
|
1710
1659
|
};
|
|
1711
1660
|
|
|
1712
1661
|
// src/components/file/fileViewer/ImageViewer.tsx
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1662
|
+
import Close from "@mui/icons-material/Close";
|
|
1663
|
+
import { Box as Box3, Dialog as Dialog2, Fab } from "@mui/material";
|
|
1664
|
+
import { useEffect as useEffect4 } from "react";
|
|
1665
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1717
1666
|
var ImageViewer = ({ metaId }) => {
|
|
1718
1667
|
const { fileMetas, setImageId } = useFile();
|
|
1719
1668
|
const meta = fileMetas.find((m) => m.id === metaId);
|
|
1720
1669
|
const { data: source } = useGetFile(meta);
|
|
1721
|
-
(
|
|
1722
|
-
if (
|
|
1670
|
+
useEffect4(() => {
|
|
1671
|
+
if (metaId)
|
|
1723
1672
|
globalThis.addEventListener("keydown", handleOnKeydown);
|
|
1724
1673
|
return () => {
|
|
1725
1674
|
globalThis.removeEventListener("keydown", handleOnKeydown);
|
|
@@ -1756,28 +1705,28 @@ var ImageViewer = ({ metaId }) => {
|
|
|
1756
1705
|
};
|
|
1757
1706
|
const onClose = () => setImageId("");
|
|
1758
1707
|
if (!metaId) return null;
|
|
1759
|
-
return /* @__PURE__ */ (
|
|
1760
|
-
/* @__PURE__ */ (
|
|
1761
|
-
/* @__PURE__ */ (
|
|
1708
|
+
return /* @__PURE__ */ jsxs8(Dialog2, { open: true, onClose, maxWidth: "xl", children: [
|
|
1709
|
+
/* @__PURE__ */ jsx10(Box3, { component: "img", src: source, alt: metaId, sx: { maxWidth: "100vw", maxHeight: { xs: "calc(100vh - 56px)", sm: "calc(100vh - 64px)" } } }),
|
|
1710
|
+
/* @__PURE__ */ jsx10(Fab, { size: "medium", onClick: onClose, sx: { position: "fixed", top: 8, right: 8 }, children: /* @__PURE__ */ jsx10(Close, {}) })
|
|
1762
1711
|
] });
|
|
1763
1712
|
};
|
|
1764
1713
|
|
|
1765
1714
|
// src/components/file/FileViewer.tsx
|
|
1766
|
-
|
|
1715
|
+
import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1767
1716
|
var FileViewer = ({ subId, onDelete, actions, children }) => {
|
|
1768
1717
|
const { data: fileMetas = [] } = useGetFileMetas(subId, { enabled: !!subId });
|
|
1769
|
-
const [imageId, setImageId] = (
|
|
1718
|
+
const [imageId, setImageId] = useState5("");
|
|
1770
1719
|
const components = { Grid: FileViewerGrid, List: FileViewerList };
|
|
1771
1720
|
if (fileMetas.length === 0) return null;
|
|
1772
|
-
return /* @__PURE__ */ (
|
|
1721
|
+
return /* @__PURE__ */ jsxs9(FileContext.Provider, { value: { fileMetas, onDelete, actions, setImageId }, children: [
|
|
1773
1722
|
children(components),
|
|
1774
|
-
/* @__PURE__ */ (
|
|
1723
|
+
/* @__PURE__ */ jsx11(ImageViewer, { metaId: imageId })
|
|
1775
1724
|
] });
|
|
1776
1725
|
};
|
|
1777
1726
|
|
|
1778
1727
|
// src/components/data-grid/ChipInputCell.tsx
|
|
1779
|
-
|
|
1780
|
-
|
|
1728
|
+
import { Chip as Chip2, Stack as Stack4 } from "@mui/material";
|
|
1729
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
1781
1730
|
var isArray = (value) => Array.isArray(value);
|
|
1782
1731
|
var ChipInputCell = ({ params, slotProps, getLabel }) => {
|
|
1783
1732
|
if (!params.value) return null;
|
|
@@ -1786,120 +1735,120 @@ var ChipInputCell = ({ params, slotProps, getLabel }) => {
|
|
|
1786
1735
|
return value;
|
|
1787
1736
|
};
|
|
1788
1737
|
if (isArray(params.value))
|
|
1789
|
-
return /* @__PURE__ */ (
|
|
1790
|
-
(value, index) => /* @__PURE__ */ (
|
|
1738
|
+
return /* @__PURE__ */ jsx12(Stack4, { direction: "row", alignItems: "center", gap: 1, sx: { overflowX: "auto", height: "100%", width: params.colDef.computedWidth }, children: params.value.map(
|
|
1739
|
+
(value, index) => /* @__PURE__ */ jsx12(Chip2, { label: getLabelValue(value), ...slotProps }, `${index + 1}-chip-input-cell`)
|
|
1791
1740
|
) });
|
|
1792
|
-
return /* @__PURE__ */ (
|
|
1741
|
+
return /* @__PURE__ */ jsx12(Chip2, { label: getLabelValue(params.value), ...slotProps });
|
|
1793
1742
|
};
|
|
1794
1743
|
|
|
1795
1744
|
// src/components/data-grid/EditableColumnHeader.tsx
|
|
1796
|
-
|
|
1797
|
-
|
|
1745
|
+
import Edit from "@mui/icons-material/Edit";
|
|
1746
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1798
1747
|
var EditableColumnHeader = ({ colDef }) => {
|
|
1799
|
-
return /* @__PURE__ */ (
|
|
1748
|
+
return /* @__PURE__ */ jsx13(TypographyWithIcon, { endIcon: /* @__PURE__ */ jsx13(Edit, { color: "disabled", fontSize: "small" }), variant: "body2", className: "MuiDataGrid-columnHeaderTitle", children: colDef.headerName });
|
|
1800
1749
|
};
|
|
1801
1750
|
|
|
1802
1751
|
// src/components/router/RouterButton.tsx
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
var Component =
|
|
1808
|
-
return /* @__PURE__ */ (
|
|
1752
|
+
import { Button as Button2 } from "@mui/material";
|
|
1753
|
+
import { createLink } from "@tanstack/react-router";
|
|
1754
|
+
import React5 from "react";
|
|
1755
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
1756
|
+
var Component = React5.forwardRef(function ButtonComponent(props, reference) {
|
|
1757
|
+
return /* @__PURE__ */ jsx14(Button2, { ref: reference, component: "a", ...props });
|
|
1809
1758
|
});
|
|
1810
|
-
var CreatedComponent =
|
|
1759
|
+
var CreatedComponent = createLink(Component);
|
|
1811
1760
|
var RouterButton = (props) => {
|
|
1812
|
-
return /* @__PURE__ */ (
|
|
1761
|
+
return /* @__PURE__ */ jsx14(CreatedComponent, { ...props });
|
|
1813
1762
|
};
|
|
1814
1763
|
|
|
1815
1764
|
// src/components/router/RouterGridActionsCellItem.tsx
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
var Component2 =
|
|
1765
|
+
import { GridActionsCellItem } from "@mui/x-data-grid-premium";
|
|
1766
|
+
import { createLink as createLink2 } from "@tanstack/react-router";
|
|
1767
|
+
import React6 from "react";
|
|
1768
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1769
|
+
var Component2 = React6.forwardRef(
|
|
1821
1770
|
function GridActionsCellItemComponent(props, reference) {
|
|
1822
|
-
return /* @__PURE__ */ (
|
|
1771
|
+
return /* @__PURE__ */ jsx15(GridActionsCellItem, { ref: reference, component: "a", ...props });
|
|
1823
1772
|
}
|
|
1824
1773
|
);
|
|
1825
|
-
var CreatedComponent2 = (
|
|
1774
|
+
var CreatedComponent2 = createLink2(Component2);
|
|
1826
1775
|
var RouterGridActionsCellItem = (props) => {
|
|
1827
|
-
return /* @__PURE__ */ (
|
|
1776
|
+
return /* @__PURE__ */ jsx15(CreatedComponent2, { ...props });
|
|
1828
1777
|
};
|
|
1829
1778
|
|
|
1830
1779
|
// src/components/router/RouterIconButton.tsx
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
var Component3 =
|
|
1836
|
-
return /* @__PURE__ */ (
|
|
1780
|
+
import { IconButton as IconButton3 } from "@mui/material";
|
|
1781
|
+
import { createLink as createLink3 } from "@tanstack/react-router";
|
|
1782
|
+
import React7 from "react";
|
|
1783
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1784
|
+
var Component3 = React7.forwardRef(function IconButtonComponent(props, reference) {
|
|
1785
|
+
return /* @__PURE__ */ jsx16(IconButton3, { ref: reference, component: "a", ...props });
|
|
1837
1786
|
});
|
|
1838
|
-
var CreatedComponent3 = (
|
|
1787
|
+
var CreatedComponent3 = createLink3(Component3);
|
|
1839
1788
|
var RouterIconButton = (props) => {
|
|
1840
|
-
return /* @__PURE__ */ (
|
|
1789
|
+
return /* @__PURE__ */ jsx16(CreatedComponent3, { ...props });
|
|
1841
1790
|
};
|
|
1842
1791
|
|
|
1843
1792
|
// src/components/router/RouterLink.tsx
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
var Component4 =
|
|
1849
|
-
return /* @__PURE__ */ (
|
|
1793
|
+
import { Link } from "@mui/material";
|
|
1794
|
+
import { createLink as createLink4 } from "@tanstack/react-router";
|
|
1795
|
+
import React8 from "react";
|
|
1796
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1797
|
+
var Component4 = React8.forwardRef(function LinkComponent(props, reference) {
|
|
1798
|
+
return /* @__PURE__ */ jsx17(Link, { ref: reference, ...props });
|
|
1850
1799
|
});
|
|
1851
|
-
var CreatedComponent4 = (
|
|
1800
|
+
var CreatedComponent4 = createLink4(Component4);
|
|
1852
1801
|
var RouterLink = (props) => {
|
|
1853
|
-
return /* @__PURE__ */ (
|
|
1802
|
+
return /* @__PURE__ */ jsx17(CreatedComponent4, { ...props });
|
|
1854
1803
|
};
|
|
1855
1804
|
|
|
1856
1805
|
// src/components/router/RouterTab.tsx
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
var Component5 =
|
|
1862
|
-
return /* @__PURE__ */ (
|
|
1806
|
+
import { Tab } from "@mui/material";
|
|
1807
|
+
import { createLink as createLink5 } from "@tanstack/react-router";
|
|
1808
|
+
import React9 from "react";
|
|
1809
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1810
|
+
var Component5 = React9.forwardRef(function TabComponent(props, reference) {
|
|
1811
|
+
return /* @__PURE__ */ jsx18(Tab, { ref: reference, component: "a", ...props });
|
|
1863
1812
|
});
|
|
1864
|
-
var CreatedComponent5 = (
|
|
1813
|
+
var CreatedComponent5 = createLink5(Component5);
|
|
1865
1814
|
var RouterTab = (props) => {
|
|
1866
|
-
return /* @__PURE__ */ (
|
|
1815
|
+
return /* @__PURE__ */ jsx18(CreatedComponent5, { ...props });
|
|
1867
1816
|
};
|
|
1868
1817
|
|
|
1869
1818
|
// src/components/router/RouterListItemButton.tsx
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
var Component6 =
|
|
1875
|
-
return /* @__PURE__ */ (
|
|
1819
|
+
import { ListItemButton as ListItemButton3 } from "@mui/material";
|
|
1820
|
+
import { createLink as createLink6 } from "@tanstack/react-router";
|
|
1821
|
+
import React10 from "react";
|
|
1822
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1823
|
+
var Component6 = React10.forwardRef(function ButtonComponent2(props, reference) {
|
|
1824
|
+
return /* @__PURE__ */ jsx19(ListItemButton3, { ref: reference, component: "a", ...props });
|
|
1876
1825
|
});
|
|
1877
|
-
var CreatedComponent6 = (
|
|
1826
|
+
var CreatedComponent6 = createLink6(Component6);
|
|
1878
1827
|
var RouterListItemButton = (props) => {
|
|
1879
|
-
return /* @__PURE__ */ (
|
|
1828
|
+
return /* @__PURE__ */ jsx19(CreatedComponent6, { ...props });
|
|
1880
1829
|
};
|
|
1881
1830
|
|
|
1882
1831
|
// src/components/router/RouterNotFound.tsx
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1832
|
+
import { Box as Box4, Divider, Typography as Typography5 } from "@mui/material";
|
|
1833
|
+
import { useTranslation as useTranslation4 } from "react-i18next";
|
|
1834
|
+
import { jsx as jsx20, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1886
1835
|
function RouterNotFound() {
|
|
1887
|
-
const { t: t2 } = (
|
|
1888
|
-
return /* @__PURE__ */ (
|
|
1889
|
-
/* @__PURE__ */ (
|
|
1890
|
-
/* @__PURE__ */ (
|
|
1891
|
-
/* @__PURE__ */ (
|
|
1836
|
+
const { t: t2 } = useTranslation4();
|
|
1837
|
+
return /* @__PURE__ */ jsx20(Box4, { height: "100vh", display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", textAlign: "center", px: 2, children: /* @__PURE__ */ jsxs10(Box4, { display: "flex", alignItems: "center", mb: 4, children: [
|
|
1838
|
+
/* @__PURE__ */ jsx20(Typography5, { variant: "h3", component: "span", fontWeight: 500, sx: { lineHeight: 1 }, children: "404" }),
|
|
1839
|
+
/* @__PURE__ */ jsx20(Divider, { orientation: "vertical", flexItem: true, sx: { mx: 3 } }),
|
|
1840
|
+
/* @__PURE__ */ jsx20(Typography5, { variant: "h5", component: "span", children: t2("Layout.ThisPageCouldNotBeFound") })
|
|
1892
1841
|
] }) });
|
|
1893
1842
|
}
|
|
1894
1843
|
|
|
1895
1844
|
// src/components/router/RouterError.tsx
|
|
1896
|
-
|
|
1897
|
-
|
|
1845
|
+
import { Box as Box5, Divider as Divider2, Typography as Typography6 } from "@mui/material";
|
|
1846
|
+
import { jsx as jsx21, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1898
1847
|
var RouterError = ({ error }) => {
|
|
1899
|
-
return /* @__PURE__ */ (
|
|
1900
|
-
/* @__PURE__ */ (
|
|
1901
|
-
/* @__PURE__ */ (
|
|
1902
|
-
/* @__PURE__ */ (
|
|
1848
|
+
return /* @__PURE__ */ jsx21(Box5, { height: "100vh", display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", textAlign: "center", px: 2, children: /* @__PURE__ */ jsxs11(Box5, { display: "flex", alignItems: "center", mb: 4, children: [
|
|
1849
|
+
/* @__PURE__ */ jsx21(Typography6, { variant: "h3", component: "span", fontWeight: 500, sx: { lineHeight: 1 }, children: error.name || "500" }),
|
|
1850
|
+
/* @__PURE__ */ jsx21(Divider2, { orientation: "vertical", flexItem: true, sx: { mx: 3 } }),
|
|
1851
|
+
/* @__PURE__ */ jsx21(Typography6, { variant: "h5", component: "span", children: error.message })
|
|
1903
1852
|
] }) });
|
|
1904
1853
|
};
|
|
1905
1854
|
|
|
@@ -1926,10 +1875,10 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
1926
1875
|
}
|
|
1927
1876
|
|
|
1928
1877
|
// node_modules/@mui/x-date-pickers/esm/LocalizationProvider/LocalizationProvider.js
|
|
1929
|
-
var React11 = __toESM(require("react"), 1);
|
|
1930
1878
|
var import_prop_types = __toESM(require_prop_types(), 1);
|
|
1931
|
-
|
|
1932
|
-
|
|
1879
|
+
import * as React11 from "react";
|
|
1880
|
+
import { useThemeProps } from "@mui/material/styles";
|
|
1881
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1933
1882
|
var _excluded = ["localeText"];
|
|
1934
1883
|
var PickerAdapterContext = /* @__PURE__ */ React11.createContext(null);
|
|
1935
1884
|
if (process.env.NODE_ENV !== "production") PickerAdapterContext.displayName = "PickerAdapterContext";
|
|
@@ -1945,7 +1894,7 @@ var LocalizationProvider = function LocalizationProvider2(inProps) {
|
|
|
1945
1894
|
adapter: void 0,
|
|
1946
1895
|
localeText: void 0
|
|
1947
1896
|
};
|
|
1948
|
-
const props =
|
|
1897
|
+
const props = useThemeProps({
|
|
1949
1898
|
// We don't want to pass the `localeText` prop to the theme, that way it will always return the theme value,
|
|
1950
1899
|
// We will then merge this theme value with our value manually
|
|
1951
1900
|
props: otherInProps,
|
|
@@ -1995,7 +1944,7 @@ var LocalizationProvider = function LocalizationProvider2(inProps) {
|
|
|
1995
1944
|
localeText
|
|
1996
1945
|
};
|
|
1997
1946
|
}, [defaultDates, adapter, localeText]);
|
|
1998
|
-
return /* @__PURE__ */ (
|
|
1947
|
+
return /* @__PURE__ */ _jsx(PickerAdapterContext.Provider, {
|
|
1999
1948
|
value: contextValue,
|
|
2000
1949
|
children
|
|
2001
1950
|
});
|
|
@@ -2073,16 +2022,16 @@ function warnOnce(message, gravity = "warning") {
|
|
|
2073
2022
|
}
|
|
2074
2023
|
|
|
2075
2024
|
// node_modules/@mui/x-date-pickers/esm/AdapterDayjs/AdapterDayjs.js
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2025
|
+
import dayjs from "dayjs";
|
|
2026
|
+
import weekOfYearPlugin from "dayjs/plugin/weekOfYear.js";
|
|
2027
|
+
import customParseFormatPlugin from "dayjs/plugin/customParseFormat.js";
|
|
2028
|
+
import localizedFormatPlugin from "dayjs/plugin/localizedFormat.js";
|
|
2029
|
+
import isBetweenPlugin from "dayjs/plugin/isBetween.js";
|
|
2030
|
+
import advancedFormatPlugin from "dayjs/plugin/advancedFormat.js";
|
|
2031
|
+
dayjs.extend(localizedFormatPlugin);
|
|
2032
|
+
dayjs.extend(weekOfYearPlugin);
|
|
2033
|
+
dayjs.extend(isBetweenPlugin);
|
|
2034
|
+
dayjs.extend(advancedFormatPlugin);
|
|
2086
2035
|
var formatTokenMap = {
|
|
2087
2036
|
// Year
|
|
2088
2037
|
YY: "year",
|
|
@@ -2206,7 +2155,7 @@ var AdapterDayjs = class {
|
|
|
2206
2155
|
} = {}) {
|
|
2207
2156
|
this.locale = locale;
|
|
2208
2157
|
this.formats = _extends({}, defaultFormats, formats);
|
|
2209
|
-
|
|
2158
|
+
dayjs.extend(customParseFormatPlugin);
|
|
2210
2159
|
}
|
|
2211
2160
|
setLocaleToValue = (value) => {
|
|
2212
2161
|
const expectedLocale = this.getCurrentLocaleCode();
|
|
@@ -2215,8 +2164,8 @@ var AdapterDayjs = class {
|
|
|
2215
2164
|
}
|
|
2216
2165
|
return value.locale(expectedLocale);
|
|
2217
2166
|
};
|
|
2218
|
-
hasUTCPlugin = () => typeof
|
|
2219
|
-
hasTimezonePlugin = () => typeof
|
|
2167
|
+
hasUTCPlugin = () => typeof dayjs.utc !== "undefined";
|
|
2168
|
+
hasTimezonePlugin = () => typeof dayjs.tz !== "undefined";
|
|
2220
2169
|
isSame = (value, comparing, comparisonTemplate) => {
|
|
2221
2170
|
const comparingInValueTimezone = this.setTimezone(comparing, this.getTimezone(value));
|
|
2222
2171
|
return value.format(comparisonTemplate) === comparingInValueTimezone.format(comparisonTemplate);
|
|
@@ -2230,7 +2179,7 @@ var AdapterDayjs = class {
|
|
|
2230
2179
|
return void 0;
|
|
2231
2180
|
}
|
|
2232
2181
|
case "system": {
|
|
2233
|
-
return
|
|
2182
|
+
return dayjs.tz.guess();
|
|
2234
2183
|
}
|
|
2235
2184
|
default: {
|
|
2236
2185
|
return timezone;
|
|
@@ -2240,14 +2189,14 @@ var AdapterDayjs = class {
|
|
|
2240
2189
|
createSystemDate = (value) => {
|
|
2241
2190
|
let date;
|
|
2242
2191
|
if (this.hasUTCPlugin() && this.hasTimezonePlugin()) {
|
|
2243
|
-
const timezone =
|
|
2192
|
+
const timezone = dayjs.tz.guess();
|
|
2244
2193
|
if (timezone === "UTC") {
|
|
2245
|
-
date = (
|
|
2194
|
+
date = dayjs(value);
|
|
2246
2195
|
} else {
|
|
2247
|
-
date =
|
|
2196
|
+
date = dayjs.tz(value, timezone);
|
|
2248
2197
|
}
|
|
2249
2198
|
} else {
|
|
2250
|
-
date = (
|
|
2199
|
+
date = dayjs(value);
|
|
2251
2200
|
}
|
|
2252
2201
|
return this.setLocaleToValue(date);
|
|
2253
2202
|
};
|
|
@@ -2255,7 +2204,7 @@ var AdapterDayjs = class {
|
|
|
2255
2204
|
if (!this.hasUTCPlugin()) {
|
|
2256
2205
|
throw new Error(MISSING_UTC_PLUGIN);
|
|
2257
2206
|
}
|
|
2258
|
-
return this.setLocaleToValue(
|
|
2207
|
+
return this.setLocaleToValue(dayjs.utc(value));
|
|
2259
2208
|
};
|
|
2260
2209
|
createTZDate = (value, timezone) => {
|
|
2261
2210
|
if (!this.hasUTCPlugin()) {
|
|
@@ -2265,10 +2214,10 @@ var AdapterDayjs = class {
|
|
|
2265
2214
|
throw new Error(MISSING_TIMEZONE_PLUGIN);
|
|
2266
2215
|
}
|
|
2267
2216
|
const keepLocalTime = value !== void 0 && !value.endsWith("Z");
|
|
2268
|
-
return this.setLocaleToValue((
|
|
2217
|
+
return this.setLocaleToValue(dayjs(value).tz(this.cleanTimezone(timezone), keepLocalTime));
|
|
2269
2218
|
};
|
|
2270
2219
|
getLocaleFormats = () => {
|
|
2271
|
-
const locales =
|
|
2220
|
+
const locales = dayjs.Ls;
|
|
2272
2221
|
const locale = this.locale || "en";
|
|
2273
2222
|
let localeObject = locales[locale];
|
|
2274
2223
|
if (localeObject === void 0) {
|
|
@@ -2311,7 +2260,7 @@ var AdapterDayjs = class {
|
|
|
2311
2260
|
}
|
|
2312
2261
|
return this.createTZDate(value, timezone);
|
|
2313
2262
|
};
|
|
2314
|
-
getInvalidDate = () => (
|
|
2263
|
+
getInvalidDate = () => dayjs(/* @__PURE__ */ new Date("Invalid date"));
|
|
2315
2264
|
getTimezone = (value) => {
|
|
2316
2265
|
if (this.hasTimezonePlugin()) {
|
|
2317
2266
|
const zone = value.$x?.$timezone;
|
|
@@ -2343,7 +2292,7 @@ var AdapterDayjs = class {
|
|
|
2343
2292
|
}
|
|
2344
2293
|
throw new Error(MISSING_TIMEZONE_PLUGIN);
|
|
2345
2294
|
}
|
|
2346
|
-
return this.setLocaleToValue(
|
|
2295
|
+
return this.setLocaleToValue(dayjs.tz(value, this.cleanTimezone(timezone)));
|
|
2347
2296
|
};
|
|
2348
2297
|
toJsDate = (value) => {
|
|
2349
2298
|
return value.toDate();
|
|
@@ -2352,7 +2301,7 @@ var AdapterDayjs = class {
|
|
|
2352
2301
|
if (value === "") {
|
|
2353
2302
|
return null;
|
|
2354
2303
|
}
|
|
2355
|
-
return (
|
|
2304
|
+
return dayjs(value, format, this.locale, true);
|
|
2356
2305
|
};
|
|
2357
2306
|
getCurrentLocaleCode = () => {
|
|
2358
2307
|
return this.locale || "en";
|
|
@@ -2562,116 +2511,143 @@ var AdapterDayjs = class {
|
|
|
2562
2511
|
};
|
|
2563
2512
|
|
|
2564
2513
|
// src/providers/LayoutProvider.tsx
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2514
|
+
import { useEffect as useEffect6, useState as useState10 } from "react";
|
|
2515
|
+
import { I18nextProvider, useTranslation as useTranslation7 } from "react-i18next";
|
|
2516
|
+
import * as z from "zod";
|
|
2517
|
+
import { cs, en } from "zod/locales";
|
|
2569
2518
|
|
|
2570
|
-
// src/
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2519
|
+
// src/providers/DialogsProvider.tsx
|
|
2520
|
+
import { useCallback, useId, useMemo as useMemo3, useRef as useRef3, useState as useState6 } from "react";
|
|
2521
|
+
import { jsx as jsx22, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2522
|
+
function DialogsProvider({ children, unmountAfter = 1e3 }) {
|
|
2523
|
+
const [stack, setStack] = useState6([]);
|
|
2524
|
+
const keyPrefix = useId();
|
|
2525
|
+
const nextId = useRef3(0);
|
|
2526
|
+
const dialogMetadata = useRef3(/* @__PURE__ */ new WeakMap());
|
|
2527
|
+
const requestDialog = useEventCallback_default(function open(Component7, payload, options = {}) {
|
|
2528
|
+
const { onClose = async () => {
|
|
2529
|
+
} } = options;
|
|
2530
|
+
let resolve;
|
|
2531
|
+
const promise = new Promise((resolveImpl) => {
|
|
2532
|
+
resolve = resolveImpl;
|
|
2533
|
+
});
|
|
2534
|
+
const key = `${keyPrefix}-${nextId.current}`;
|
|
2535
|
+
nextId.current += 1;
|
|
2536
|
+
const newEntry = {
|
|
2537
|
+
key,
|
|
2538
|
+
open: true,
|
|
2539
|
+
promise,
|
|
2540
|
+
Component: Component7,
|
|
2541
|
+
payload,
|
|
2542
|
+
onClose,
|
|
2543
|
+
resolve
|
|
2544
|
+
};
|
|
2545
|
+
dialogMetadata.current.set(promise, newEntry);
|
|
2546
|
+
setStack((previousStack) => [...previousStack, newEntry]);
|
|
2547
|
+
return promise;
|
|
2548
|
+
});
|
|
2549
|
+
const removeDialogFromStack = useCallback((dialog) => {
|
|
2550
|
+
setStack((previousStack) => previousStack.filter((entry) => entry.promise !== dialog));
|
|
2551
|
+
dialogMetadata.current.delete(dialog);
|
|
2552
|
+
}, []);
|
|
2553
|
+
const closeDialogUi = useEventCallback_default(function closeDialogUi2(dialog) {
|
|
2554
|
+
setStack(
|
|
2555
|
+
(previousStack) => previousStack.map((entry) => entry.promise === dialog ? { ...entry, open: false } : entry)
|
|
2556
|
+
);
|
|
2557
|
+
setTimeout(() => removeDialogFromStack(dialog), unmountAfter);
|
|
2558
|
+
});
|
|
2559
|
+
const closeDialog = useEventCallback_default(async function closeDialog2(dialog, result) {
|
|
2560
|
+
const entryToClose = dialogMetadata.current.get(dialog);
|
|
2561
|
+
if (!entryToClose) {
|
|
2562
|
+
throw new Error("Dialog not found in stack");
|
|
2563
|
+
}
|
|
2564
|
+
try {
|
|
2565
|
+
await entryToClose.onClose(result);
|
|
2566
|
+
} finally {
|
|
2567
|
+
entryToClose.resolve(result);
|
|
2568
|
+
closeDialogUi(dialog);
|
|
2569
|
+
}
|
|
2570
|
+
return dialog;
|
|
2571
|
+
});
|
|
2572
|
+
const contextValue = useMemo3(() => ({ open: requestDialog, close: closeDialog }), [requestDialog, closeDialog]);
|
|
2573
|
+
return /* @__PURE__ */ jsxs12(DialogsContext.Provider, { value: contextValue, children: [
|
|
2574
|
+
children,
|
|
2575
|
+
stack.map(({ key, open, Component: Component7, payload, promise }) => /* @__PURE__ */ jsx22(
|
|
2576
|
+
Component7,
|
|
2577
|
+
{
|
|
2578
|
+
payload,
|
|
2579
|
+
open,
|
|
2580
|
+
onClose: async (result) => {
|
|
2581
|
+
await closeDialog(promise, result);
|
|
2582
|
+
}
|
|
2608
2583
|
},
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
};
|
|
2584
|
+
key
|
|
2585
|
+
))
|
|
2586
|
+
] });
|
|
2587
|
+
}
|
|
2588
|
+
|
|
2589
|
+
// src/utils/i18n.ts
|
|
2590
|
+
import { createIsomorphicFn } from "@tanstack/react-start";
|
|
2591
|
+
import { getCookie } from "@tanstack/react-start/server";
|
|
2592
|
+
import i18n from "i18next";
|
|
2593
|
+
import LanguageDetector from "i18next-browser-languagedetector";
|
|
2594
|
+
import HttpBackend from "i18next-http-backend";
|
|
2595
|
+
import { initReactI18next } from "react-i18next";
|
|
2596
|
+
import { default as default2 } from "i18next";
|
|
2597
|
+
var i18nCookieName = "i18nextLng";
|
|
2598
|
+
i18n.use(HttpBackend).use(LanguageDetector).use(initReactI18next).init({
|
|
2599
|
+
fallbackLng: "en",
|
|
2600
|
+
detection: {
|
|
2601
|
+
order: ["cookie"],
|
|
2602
|
+
lookupCookie: i18nCookieName,
|
|
2603
|
+
caches: ["cookie"],
|
|
2604
|
+
cookieMinutes: 60 * 24 * 365
|
|
2605
|
+
},
|
|
2606
|
+
interpolation: { escapeValue: false }
|
|
2607
|
+
});
|
|
2608
|
+
var setupRouterSsrI18nIntegration = createIsomorphicFn().server(async () => {
|
|
2609
|
+
const language = getCookie(i18nCookieName);
|
|
2610
|
+
await i18n.changeLanguage(language || "en");
|
|
2611
|
+
});
|
|
2612
|
+
|
|
2613
|
+
// src/components/core/Layout.tsx
|
|
2614
|
+
import Menu3 from "@mui/icons-material/Menu";
|
|
2615
|
+
import MenuOpen from "@mui/icons-material/MenuOpen";
|
|
2616
|
+
import { AppBar, Box as Box9, CssBaseline, IconButton as IconButton5, InitColorSchemeScript, LinearProgress, Toolbar } from "@mui/material";
|
|
2617
|
+
import { ThemeProvider, styled as styled2 } from "@mui/material/styles";
|
|
2618
|
+
import { useIsFetching, useIsMutating } from "@tanstack/react-query";
|
|
2619
|
+
import useLocalStorageState from "use-local-storage-state";
|
|
2644
2620
|
|
|
2645
2621
|
// src/components/core/navigation/NavigationRail.tsx
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2622
|
+
import { useMediaQuery } from "@mui/material";
|
|
2623
|
+
import Box7 from "@mui/material/Box";
|
|
2624
|
+
import Drawer from "@mui/material/Drawer";
|
|
2625
|
+
import { useTheme as useTheme2 } from "@mui/material/styles";
|
|
2626
|
+
import { useNavigate, useRouterState as useRouterState2 } from "@tanstack/react-router";
|
|
2651
2627
|
|
|
2652
2628
|
// src/components/core/navigation/NavigationList.tsx
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2629
|
+
import Divider3 from "@mui/material/Divider";
|
|
2630
|
+
import List3 from "@mui/material/List";
|
|
2631
|
+
import ListSubheader from "@mui/material/ListSubheader";
|
|
2632
|
+
import { Fragment as Fragment5, useEffect as useEffect5, useState as useState8 } from "react";
|
|
2657
2633
|
|
|
2658
2634
|
// src/components/core/navigation/NavigationListItem.tsx
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2635
|
+
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
|
|
2636
|
+
import Avatar from "@mui/material/Avatar";
|
|
2637
|
+
import Box6 from "@mui/material/Box";
|
|
2638
|
+
import Popper from "@mui/material/Popper";
|
|
2639
|
+
import ListItem from "@mui/material/ListItem";
|
|
2640
|
+
import ListItemButton4 from "@mui/material/ListItemButton";
|
|
2641
|
+
import ListItemIcon3 from "@mui/material/ListItemIcon";
|
|
2642
|
+
import ListItemText3 from "@mui/material/ListItemText";
|
|
2643
|
+
import Paper2 from "@mui/material/Paper";
|
|
2644
|
+
import { styled } from "@mui/material/styles";
|
|
2645
|
+
import Typography7 from "@mui/material/Typography";
|
|
2646
|
+
import { Fragment as Fragment3, useMemo as useMemo4, useState as useState7 } from "react";
|
|
2647
|
+
import { Collapse } from "@mui/material";
|
|
2648
|
+
import { Fragment as Fragment4, jsx as jsx23, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2673
2649
|
var ICON_SIZE = 34;
|
|
2674
|
-
var StyledNavButton =
|
|
2650
|
+
var StyledNavButton = styled(ListItemButton4)(({ theme }) => ({
|
|
2675
2651
|
borderRadius: 8,
|
|
2676
2652
|
"&.Mui-selected": {
|
|
2677
2653
|
"& .MuiListItemIcon-root, & .MuiTypography-root, & .MuiSvgIcon-root": {
|
|
@@ -2691,7 +2667,7 @@ var StyledNavButton = (0, import_styles2.styled)(import_ListItemButton.default)(
|
|
|
2691
2667
|
backgroundColor: (theme.vars ?? theme).palette.action.active
|
|
2692
2668
|
}
|
|
2693
2669
|
}));
|
|
2694
|
-
var StyledRouterButton =
|
|
2670
|
+
var StyledRouterButton = styled(RouterListItemButton)(({ theme }) => ({
|
|
2695
2671
|
borderRadius: 8,
|
|
2696
2672
|
"&.Mui-selected": {
|
|
2697
2673
|
"& .MuiListItemIcon-root, & .MuiTypography-root, & .MuiSvgIcon-root": {
|
|
@@ -2713,13 +2689,13 @@ var StyledRouterButton = (0, import_styles2.styled)(RouterListItemButton)(({ the
|
|
|
2713
2689
|
}));
|
|
2714
2690
|
var IconOrAvatar = ({ item, collapsed }) => {
|
|
2715
2691
|
if (item.icon || collapsed) {
|
|
2716
|
-
return /* @__PURE__ */ (
|
|
2717
|
-
/* @__PURE__ */ (
|
|
2692
|
+
return /* @__PURE__ */ jsxs13(Box6, { sx: collapsed ? { position: "absolute", left: "50%", top: "calc(50% - 6px)", transform: "translate(-50%, -50%)" } : {}, children: [
|
|
2693
|
+
/* @__PURE__ */ jsxs13(ListItemIcon3, { sx: { display: "flex", alignItems: "center", justifyContent: "center", minWidth: ICON_SIZE }, children: [
|
|
2718
2694
|
item.icon ?? null,
|
|
2719
|
-
!item.icon && collapsed ? /* @__PURE__ */ (
|
|
2695
|
+
!item.icon && collapsed ? /* @__PURE__ */ jsx23(Avatar, { sx: { width: ICON_SIZE - 7, height: ICON_SIZE - 7, fontSize: 12 }, children: item.title }) : null
|
|
2720
2696
|
] }),
|
|
2721
|
-
collapsed ? /* @__PURE__ */ (
|
|
2722
|
-
|
|
2697
|
+
collapsed ? /* @__PURE__ */ jsx23(
|
|
2698
|
+
Typography7,
|
|
2723
2699
|
{
|
|
2724
2700
|
variant: "caption",
|
|
2725
2701
|
sx: {
|
|
@@ -2742,8 +2718,8 @@ var IconOrAvatar = ({ item, collapsed }) => {
|
|
|
2742
2718
|
}
|
|
2743
2719
|
return null;
|
|
2744
2720
|
};
|
|
2745
|
-
var MiniPopover = ({ open, anchorEl, children }) => /* @__PURE__ */ (
|
|
2746
|
-
|
|
2721
|
+
var MiniPopover = ({ open, anchorEl, children }) => /* @__PURE__ */ jsx23(
|
|
2722
|
+
Popper,
|
|
2747
2723
|
{
|
|
2748
2724
|
open,
|
|
2749
2725
|
anchorEl,
|
|
@@ -2753,8 +2729,8 @@ var MiniPopover = ({ open, anchorEl, children }) => /* @__PURE__ */ (0, import_j
|
|
|
2753
2729
|
{ name: "preventOverflow", options: { padding: 8 } },
|
|
2754
2730
|
{ name: "flip", options: { fallbackPlacements: ["right-end", "left-start"] } }
|
|
2755
2731
|
],
|
|
2756
|
-
children: /* @__PURE__ */ (
|
|
2757
|
-
|
|
2732
|
+
children: /* @__PURE__ */ jsx23(
|
|
2733
|
+
Paper2,
|
|
2758
2734
|
{
|
|
2759
2735
|
sx: {
|
|
2760
2736
|
pt: 0.5,
|
|
@@ -2769,9 +2745,9 @@ var MiniPopover = ({ open, anchorEl, children }) => /* @__PURE__ */ (0, import_j
|
|
|
2769
2745
|
}
|
|
2770
2746
|
);
|
|
2771
2747
|
var NavigationListItem = ({ item, isOpen, selected, disabled, collapsed, isSidebarFullyExpanded = true, isSidebarFullyCollapsed, onClick, renderNested }) => {
|
|
2772
|
-
const [hoveredPopoverItem, setHoveredPopoverItem] = (
|
|
2773
|
-
const [anchorElement, setAnchorElement] = (
|
|
2774
|
-
const chevronSx = (
|
|
2748
|
+
const [hoveredPopoverItem, setHoveredPopoverItem] = useState7(null);
|
|
2749
|
+
const [anchorElement, setAnchorElement] = useState7(null);
|
|
2750
|
+
const chevronSx = useMemo4(() => {
|
|
2775
2751
|
if (collapsed && isSidebarFullyCollapsed && item.children) {
|
|
2776
2752
|
return {
|
|
2777
2753
|
fontSize: 18,
|
|
@@ -2795,20 +2771,20 @@ var NavigationListItem = ({ item, isOpen, selected, disabled, collapsed, isSideb
|
|
|
2795
2771
|
disabled,
|
|
2796
2772
|
sx: { px: 1.4, height: collapsed ? 60 : 48 }
|
|
2797
2773
|
};
|
|
2798
|
-
const buttonContent = /* @__PURE__ */ (
|
|
2799
|
-
/* @__PURE__ */ (
|
|
2800
|
-
!collapsed && /* @__PURE__ */ (
|
|
2801
|
-
|
|
2774
|
+
const buttonContent = /* @__PURE__ */ jsxs13(Fragment4, { children: [
|
|
2775
|
+
/* @__PURE__ */ jsx23(IconOrAvatar, { item, collapsed }),
|
|
2776
|
+
!collapsed && /* @__PURE__ */ jsx23(
|
|
2777
|
+
ListItemText3,
|
|
2802
2778
|
{
|
|
2803
2779
|
primary: item.title,
|
|
2804
2780
|
slotProps: { primary: { noWrap: true, title: item.title } },
|
|
2805
2781
|
sx: { ml: 1.2, flex: 1, minWidth: 0, "& .MuiTypography-root": { whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" } }
|
|
2806
2782
|
}
|
|
2807
2783
|
),
|
|
2808
|
-
item.children ? /* @__PURE__ */ (
|
|
2784
|
+
item.children ? /* @__PURE__ */ jsx23(ExpandMoreIcon, { sx: chevronSx }) : null
|
|
2809
2785
|
] });
|
|
2810
|
-
const listItem = /* @__PURE__ */ (
|
|
2811
|
-
|
|
2786
|
+
const listItem = /* @__PURE__ */ jsxs13(
|
|
2787
|
+
ListItem,
|
|
2812
2788
|
{
|
|
2813
2789
|
...item.children && collapsed ? {
|
|
2814
2790
|
onMouseEnter: (event) => {
|
|
@@ -2821,7 +2797,7 @@ var NavigationListItem = ({ item, isOpen, selected, disabled, collapsed, isSideb
|
|
|
2821
2797
|
} : {},
|
|
2822
2798
|
sx: { py: 0, px: 1, overflowX: "hidden" },
|
|
2823
2799
|
children: [
|
|
2824
|
-
shouldJustExpand ? /* @__PURE__ */ (
|
|
2800
|
+
shouldJustExpand ? /* @__PURE__ */ jsx23(StyledNavButton, { ...buttonProps, onClick: () => onClick?.(item), children: buttonContent }) : /* @__PURE__ */ jsx23(
|
|
2825
2801
|
StyledRouterButton,
|
|
2826
2802
|
{
|
|
2827
2803
|
...buttonProps,
|
|
@@ -2832,28 +2808,28 @@ var NavigationListItem = ({ item, isOpen, selected, disabled, collapsed, isSideb
|
|
|
2832
2808
|
children: buttonContent
|
|
2833
2809
|
}
|
|
2834
2810
|
),
|
|
2835
|
-
item.children && collapsed ? /* @__PURE__ */ (
|
|
2811
|
+
item.children && collapsed ? /* @__PURE__ */ jsx23(MiniPopover, { open: item.title === hoveredPopoverItem, anchorEl: anchorElement, children: renderNested?.(item.children) }) : null
|
|
2836
2812
|
]
|
|
2837
2813
|
}
|
|
2838
2814
|
);
|
|
2839
|
-
return /* @__PURE__ */ (
|
|
2815
|
+
return /* @__PURE__ */ jsxs13(Fragment3, { children: [
|
|
2840
2816
|
listItem,
|
|
2841
|
-
item.children && !collapsed ? /* @__PURE__ */ (
|
|
2817
|
+
item.children && !collapsed ? /* @__PURE__ */ jsx23(Collapse, { in: isOpen, timeout: "auto", unmountOnExit: true, children: renderNested?.(item.children) }) : null
|
|
2842
2818
|
] }, item.to);
|
|
2843
2819
|
};
|
|
2844
2820
|
|
|
2845
2821
|
// src/components/core/navigation/NavigationList.tsx
|
|
2846
|
-
|
|
2822
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
2847
2823
|
var isPageItem = (item) => !("kind" in item);
|
|
2848
2824
|
var isDivider = (item) => "kind" in item && item.kind === "divider";
|
|
2849
2825
|
var isHeader = (item) => "kind" in item && item.kind === "header";
|
|
2850
2826
|
var NavigationList = ({ subNavigation, depth = 0, collapsed, isPopover, isSidebarFullyExpanded = true, isSidebarFullyCollapsed, expandedWidth, renderItem, activePath, onNavigate }) => {
|
|
2851
|
-
const [openKeys, setOpenKeys] = (
|
|
2852
|
-
(
|
|
2827
|
+
const [openKeys, setOpenKeys] = useState8([]);
|
|
2828
|
+
useEffect5(() => {
|
|
2853
2829
|
if (collapsed) setOpenKeys([]);
|
|
2854
2830
|
}, [collapsed]);
|
|
2855
2831
|
const toggleKey = (key) => setOpenKeys((previous) => previous.includes(key) ? previous.filter((k) => k !== key) : [...previous, key]);
|
|
2856
|
-
const renderNested = (children) => /* @__PURE__ */ (
|
|
2832
|
+
const renderNested = (children) => /* @__PURE__ */ jsx24(
|
|
2857
2833
|
NavigationList,
|
|
2858
2834
|
{
|
|
2859
2835
|
subNavigation: children,
|
|
@@ -2865,8 +2841,8 @@ var NavigationList = ({ subNavigation, depth = 0, collapsed, isPopover, isSideba
|
|
|
2865
2841
|
}
|
|
2866
2842
|
);
|
|
2867
2843
|
const filteredNavigation = subNavigation.filter((nav) => !nav.hidden);
|
|
2868
|
-
return /* @__PURE__ */ (
|
|
2869
|
-
|
|
2844
|
+
return /* @__PURE__ */ jsx24(
|
|
2845
|
+
List3,
|
|
2870
2846
|
{
|
|
2871
2847
|
sx: {
|
|
2872
2848
|
padding: 0,
|
|
@@ -2878,8 +2854,8 @@ var NavigationList = ({ subNavigation, depth = 0, collapsed, isPopover, isSideba
|
|
|
2878
2854
|
},
|
|
2879
2855
|
children: filteredNavigation.map((navItem, index) => {
|
|
2880
2856
|
if (isHeader(navItem)) {
|
|
2881
|
-
return /* @__PURE__ */ (
|
|
2882
|
-
|
|
2857
|
+
return /* @__PURE__ */ jsx24(
|
|
2858
|
+
ListSubheader,
|
|
2883
2859
|
{
|
|
2884
2860
|
sx: {
|
|
2885
2861
|
fontSize: 12,
|
|
@@ -2901,13 +2877,13 @@ var NavigationList = ({ subNavigation, depth = 0, collapsed, isPopover, isSideba
|
|
|
2901
2877
|
}
|
|
2902
2878
|
if (isDivider(navItem)) {
|
|
2903
2879
|
const nextItem = filteredNavigation[index + 1];
|
|
2904
|
-
return /* @__PURE__ */ (
|
|
2880
|
+
return /* @__PURE__ */ jsx24("li", { children: /* @__PURE__ */ jsx24(Divider3, { sx: { mx: 1, mt: 1, mb: isHeader(nextItem) && !collapsed ? 0 : 1 } }) }, `divider-${depth}-${index}`);
|
|
2905
2881
|
}
|
|
2906
2882
|
if (!isPageItem(navItem)) return null;
|
|
2907
2883
|
const key = `item-${depth}-${index}`;
|
|
2908
2884
|
const uniqueItemKey = `${depth}-${index}-${navItem.title}`;
|
|
2909
|
-
if (renderItem) return /* @__PURE__ */ (
|
|
2910
|
-
return /* @__PURE__ */ (
|
|
2885
|
+
if (renderItem) return /* @__PURE__ */ jsx24(Fragment5, { children: renderItem(navItem, { collapsed: !!collapsed }) }, key);
|
|
2886
|
+
return /* @__PURE__ */ jsx24(
|
|
2911
2887
|
NavigationListItem,
|
|
2912
2888
|
{
|
|
2913
2889
|
item: navItem,
|
|
@@ -2927,17 +2903,17 @@ var NavigationList = ({ subNavigation, depth = 0, collapsed, isPopover, isSideba
|
|
|
2927
2903
|
};
|
|
2928
2904
|
|
|
2929
2905
|
// src/components/core/navigation/NavigationRail.tsx
|
|
2930
|
-
|
|
2906
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
2931
2907
|
var MINI_WIDTH = 84;
|
|
2932
2908
|
var EXPANDED_WIDTH = 320;
|
|
2933
2909
|
var TOOLBAR_HEIGHT = 65;
|
|
2934
2910
|
var NavigationRail = ({ navigation, expanded, setExpanded }) => {
|
|
2935
|
-
const navigate =
|
|
2936
|
-
const routerState = (
|
|
2937
|
-
const theme = (
|
|
2938
|
-
const showPermanent =
|
|
2939
|
-
const drawerContent = (collapsed) => /* @__PURE__ */ (
|
|
2940
|
-
|
|
2911
|
+
const navigate = useNavigate();
|
|
2912
|
+
const routerState = useRouterState2();
|
|
2913
|
+
const theme = useTheme2();
|
|
2914
|
+
const showPermanent = useMediaQuery(theme.breakpoints.up("sm"));
|
|
2915
|
+
const drawerContent = (collapsed) => /* @__PURE__ */ jsx25(
|
|
2916
|
+
Box7,
|
|
2941
2917
|
{
|
|
2942
2918
|
component: "nav",
|
|
2943
2919
|
sx: {
|
|
@@ -2950,7 +2926,7 @@ var NavigationRail = ({ navigation, expanded, setExpanded }) => {
|
|
|
2950
2926
|
overflowX: "hidden",
|
|
2951
2927
|
pt: navigation[0] && isHeader(navigation[0]) && !collapsed ? 0 : 2
|
|
2952
2928
|
},
|
|
2953
|
-
children: /* @__PURE__ */ (
|
|
2929
|
+
children: /* @__PURE__ */ jsx25(
|
|
2954
2930
|
NavigationList,
|
|
2955
2931
|
{
|
|
2956
2932
|
subNavigation: navigation,
|
|
@@ -2965,8 +2941,8 @@ var NavigationRail = ({ navigation, expanded, setExpanded }) => {
|
|
|
2965
2941
|
}
|
|
2966
2942
|
);
|
|
2967
2943
|
if (showPermanent)
|
|
2968
|
-
return /* @__PURE__ */ (
|
|
2969
|
-
|
|
2944
|
+
return /* @__PURE__ */ jsx25(
|
|
2945
|
+
Drawer,
|
|
2970
2946
|
{
|
|
2971
2947
|
variant: "permanent",
|
|
2972
2948
|
sx: {
|
|
@@ -2981,50 +2957,49 @@ var NavigationRail = ({ navigation, expanded, setExpanded }) => {
|
|
|
2981
2957
|
children: drawerContent(!expanded)
|
|
2982
2958
|
}
|
|
2983
2959
|
);
|
|
2984
|
-
return /* @__PURE__ */ (
|
|
2960
|
+
return /* @__PURE__ */ jsx25(Drawer, { open: expanded, onClose: () => setExpanded(false), children: drawerContent(!expanded) });
|
|
2985
2961
|
};
|
|
2986
2962
|
|
|
2987
2963
|
// src/components/core/ToolbarAccount.tsx
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
2964
|
+
import AccountCircle from "@mui/icons-material/AccountCircle";
|
|
2965
|
+
import ArrowBack from "@mui/icons-material/ArrowBack";
|
|
2966
|
+
import Brightness4 from "@mui/icons-material/Brightness4";
|
|
2967
|
+
import ChevronRight from "@mui/icons-material/ChevronRight";
|
|
2968
|
+
import DarkMode from "@mui/icons-material/DarkMode";
|
|
2969
|
+
import LightMode from "@mui/icons-material/LightMode";
|
|
2970
|
+
import Login from "@mui/icons-material/Login";
|
|
2971
|
+
import Logout from "@mui/icons-material/Logout";
|
|
2972
|
+
import SettingsBrightness from "@mui/icons-material/SettingsBrightness";
|
|
2973
|
+
import Translate from "@mui/icons-material/Translate";
|
|
2974
|
+
import { Avatar as Avatar2, Box as Box8, IconButton as IconButton4, List as List4, ListItem as ListItem2, ListItemButton as ListItemButton5, ListItemIcon as ListItemIcon4, ListItemText as ListItemText4, ListSubheader as ListSubheader2, Menu as Menu2, Typography as Typography8, useColorScheme } from "@mui/material";
|
|
2975
|
+
import { Fragment as Fragment6, useState as useState9 } from "react";
|
|
2976
|
+
import { useTranslation as useTranslation5 } from "react-i18next";
|
|
3001
2977
|
|
|
3002
2978
|
// src/auth-test/keycloak.ts
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
var import_meta3 = {};
|
|
2979
|
+
import { useRouter } from "@tanstack/react-router";
|
|
2980
|
+
import Keycloak from "keycloak-js";
|
|
3006
2981
|
var keycloakConfig = {
|
|
3007
|
-
url:
|
|
3008
|
-
realm:
|
|
3009
|
-
clientId:
|
|
3010
|
-
idpHint:
|
|
3011
|
-
confidentialClientId:
|
|
3012
|
-
confidentialClientSecret:
|
|
2982
|
+
url: import.meta.env.VITE_KEYCLOAK_URL,
|
|
2983
|
+
realm: import.meta.env.VITE_KEYCLOAK_REALM,
|
|
2984
|
+
clientId: import.meta.env.VITE_KEYCLOAK_CLIENT_ID,
|
|
2985
|
+
idpHint: import.meta.env.VITE_KEYCLOAK_IDP_HINT,
|
|
2986
|
+
confidentialClientId: import.meta.env.VITE_KEYCLOAK_CONFIDENTIAL_CLIENT_ID,
|
|
2987
|
+
confidentialClientSecret: import.meta.env.VITE_KEYCLOAK_CONFIDENTIAL_CLIENT_SECRET
|
|
3013
2988
|
};
|
|
3014
2989
|
function useKeycloak() {
|
|
3015
|
-
const routerContext =
|
|
2990
|
+
const routerContext = useRouter();
|
|
3016
2991
|
const keycloak = routerContext.options.context.keycloak;
|
|
3017
2992
|
return keycloak;
|
|
3018
2993
|
}
|
|
3019
2994
|
|
|
3020
2995
|
// src/components/core/ToolbarAccount.tsx
|
|
3021
|
-
|
|
2996
|
+
import { jsx as jsx26, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3022
2997
|
var ToolbarAccount = () => {
|
|
3023
|
-
const [anchorElement, setAnchorElement] = (
|
|
3024
|
-
const [tab, setTab] = (
|
|
2998
|
+
const [anchorElement, setAnchorElement] = useState9();
|
|
2999
|
+
const [tab, setTab] = useState9("settings");
|
|
3025
3000
|
const open = Boolean(anchorElement);
|
|
3026
|
-
const { t: t2, i18n: i18n2 } = (
|
|
3027
|
-
const { mode, setMode } =
|
|
3001
|
+
const { t: t2, i18n: i18n2 } = useTranslation5();
|
|
3002
|
+
const { mode, setMode } = useColorScheme();
|
|
3028
3003
|
const changeLanguage = (newLanguage) => () => {
|
|
3029
3004
|
i18n2.changeLanguage(newLanguage).finally(() => closeMenu());
|
|
3030
3005
|
};
|
|
@@ -3058,60 +3033,60 @@ var ToolbarAccount = () => {
|
|
|
3058
3033
|
setTimeout(() => setTab("settings"), 300);
|
|
3059
3034
|
};
|
|
3060
3035
|
const changeTab = (newTab) => () => setTab(newTab);
|
|
3061
|
-
const settings = /* @__PURE__ */ (
|
|
3062
|
-
/* @__PURE__ */ (
|
|
3063
|
-
/* @__PURE__ */ (
|
|
3064
|
-
/* @__PURE__ */ (
|
|
3065
|
-
/* @__PURE__ */ (
|
|
3036
|
+
const settings = /* @__PURE__ */ jsxs14(List4, { component: "nav", subheader: /* @__PURE__ */ jsx26(ListSubheader2, { sx: { backgroundColor: "transparent" }, children: t2("Layout.Settings") }), children: [
|
|
3037
|
+
/* @__PURE__ */ jsxs14(ListItemButton5, { onClick: changeTab("theme"), sx: { py: 0.3 }, children: [
|
|
3038
|
+
/* @__PURE__ */ jsx26(ListItemIcon4, { children: /* @__PURE__ */ jsx26(Brightness4, {}) }),
|
|
3039
|
+
/* @__PURE__ */ jsx26(ListItemText4, { primary: t2("Layout.Appearance"), secondary: getModeText() }),
|
|
3040
|
+
/* @__PURE__ */ jsx26(ChevronRight, {})
|
|
3066
3041
|
] }),
|
|
3067
|
-
/* @__PURE__ */ (
|
|
3068
|
-
/* @__PURE__ */ (
|
|
3069
|
-
/* @__PURE__ */ (
|
|
3070
|
-
/* @__PURE__ */ (
|
|
3042
|
+
/* @__PURE__ */ jsxs14(ListItemButton5, { onClick: changeTab("language"), sx: { py: 0.3 }, children: [
|
|
3043
|
+
/* @__PURE__ */ jsx26(ListItemIcon4, { children: /* @__PURE__ */ jsx26(Translate, {}) }),
|
|
3044
|
+
/* @__PURE__ */ jsx26(ListItemText4, { primary: t2("Layout.Language"), secondary: i18n2.resolvedLanguage === "en" ? "English" : "\u010Ce\u0161tina" }),
|
|
3045
|
+
/* @__PURE__ */ jsx26(ChevronRight, {})
|
|
3071
3046
|
] })
|
|
3072
3047
|
] });
|
|
3073
|
-
const theme = /* @__PURE__ */ (
|
|
3074
|
-
/* @__PURE__ */ (
|
|
3048
|
+
const theme = /* @__PURE__ */ jsxs14(List4, { subheader: /* @__PURE__ */ jsxs14(ListSubheader2, { onClick: changeTab("settings"), sx: { backgroundColor: "transparent", display: "flex", alignItems: "center", px: 1, cursor: "pointer" }, children: [
|
|
3049
|
+
/* @__PURE__ */ jsx26(IconButton4, { size: "small", sx: { mr: 0.5 }, children: /* @__PURE__ */ jsx26(ArrowBack, { fontSize: "small" }) }),
|
|
3075
3050
|
" ",
|
|
3076
3051
|
t2("Layout.Appearance")
|
|
3077
3052
|
] }), children: [
|
|
3078
|
-
/* @__PURE__ */ (
|
|
3079
|
-
/* @__PURE__ */ (
|
|
3080
|
-
/* @__PURE__ */ (
|
|
3053
|
+
/* @__PURE__ */ jsxs14(ListItemButton5, { onClick: changeMode("light"), disabled: mode === "light", children: [
|
|
3054
|
+
/* @__PURE__ */ jsx26(ListItemIcon4, { children: /* @__PURE__ */ jsx26(LightMode, {}) }),
|
|
3055
|
+
/* @__PURE__ */ jsx26(ListItemText4, { primary: t2("Layout.Light") })
|
|
3081
3056
|
] }),
|
|
3082
|
-
/* @__PURE__ */ (
|
|
3083
|
-
/* @__PURE__ */ (
|
|
3084
|
-
/* @__PURE__ */ (
|
|
3057
|
+
/* @__PURE__ */ jsxs14(ListItemButton5, { onClick: changeMode("dark"), disabled: mode === "dark", children: [
|
|
3058
|
+
/* @__PURE__ */ jsx26(ListItemIcon4, { children: /* @__PURE__ */ jsx26(DarkMode, {}) }),
|
|
3059
|
+
/* @__PURE__ */ jsx26(ListItemText4, { primary: t2("Layout.Dark") })
|
|
3085
3060
|
] }),
|
|
3086
|
-
/* @__PURE__ */ (
|
|
3087
|
-
/* @__PURE__ */ (
|
|
3088
|
-
/* @__PURE__ */ (
|
|
3061
|
+
/* @__PURE__ */ jsxs14(ListItemButton5, { onClick: changeMode("system"), disabled: mode === "system", children: [
|
|
3062
|
+
/* @__PURE__ */ jsx26(ListItemIcon4, { children: /* @__PURE__ */ jsx26(SettingsBrightness, {}) }),
|
|
3063
|
+
/* @__PURE__ */ jsx26(ListItemText4, { primary: t2("Layout.System") })
|
|
3089
3064
|
] })
|
|
3090
3065
|
] });
|
|
3091
|
-
const language = /* @__PURE__ */ (
|
|
3092
|
-
/* @__PURE__ */ (
|
|
3066
|
+
const language = /* @__PURE__ */ jsxs14(List4, { subheader: /* @__PURE__ */ jsxs14(ListSubheader2, { onClick: changeTab("settings"), sx: { backgroundColor: "transparent", display: "flex", alignItems: "center", px: 1, cursor: "pointer" }, children: [
|
|
3067
|
+
/* @__PURE__ */ jsx26(IconButton4, { size: "small", sx: { mr: 0.5 }, children: /* @__PURE__ */ jsx26(ArrowBack, { fontSize: "small" }) }),
|
|
3093
3068
|
" ",
|
|
3094
3069
|
t2("Layout.Language")
|
|
3095
3070
|
] }), children: [
|
|
3096
|
-
/* @__PURE__ */ (
|
|
3097
|
-
/* @__PURE__ */ (
|
|
3071
|
+
/* @__PURE__ */ jsx26(ListItemButton5, { onClick: changeLanguage("en"), disabled: i18n2.resolvedLanguage === "en", children: /* @__PURE__ */ jsx26(ListItemText4, { primary: "English" }) }),
|
|
3072
|
+
/* @__PURE__ */ jsx26(ListItemButton5, { onClick: changeLanguage("cs"), disabled: i18n2.resolvedLanguage === "cs", children: /* @__PURE__ */ jsx26(ListItemText4, { primary: "\u010Ce\u0161tina" }) })
|
|
3098
3073
|
] });
|
|
3099
|
-
return /* @__PURE__ */ (
|
|
3100
|
-
/* @__PURE__ */ (
|
|
3101
|
-
/* @__PURE__ */ (
|
|
3102
|
-
/* @__PURE__ */ (
|
|
3103
|
-
/* @__PURE__ */ (
|
|
3104
|
-
/* @__PURE__ */ (
|
|
3105
|
-
/* @__PURE__ */ (
|
|
3106
|
-
/* @__PURE__ */ (
|
|
3074
|
+
return /* @__PURE__ */ jsxs14(Fragment6, { children: [
|
|
3075
|
+
/* @__PURE__ */ jsx26(IconButton4, { size: "small", edge: "end", onClick: openMenu, children: user?.name ? /* @__PURE__ */ jsx26(Avatar2, { sx: { width: { xs: 32, sm: 40 }, height: { xs: 32, sm: 40 }, bgcolor: "primary.main" }, children: /* @__PURE__ */ jsx26(Typography8, { variant: "subtitle2", sx: { fontWeight: "bold", lineHeight: 0 }, children: usernameInitials() }) }) : /* @__PURE__ */ jsx26(AccountCircle, { fontSize: "large" }) }),
|
|
3076
|
+
/* @__PURE__ */ jsx26(Menu2, { anchorEl: anchorElement, open, onClose: closeMenu, children: /* @__PURE__ */ jsxs14(Box8, { sx: { width: 240 }, children: [
|
|
3077
|
+
/* @__PURE__ */ jsx26(List4, { children: user?.name ? /* @__PURE__ */ jsxs14(Fragment6, { children: [
|
|
3078
|
+
/* @__PURE__ */ jsx26(ListItem2, { children: /* @__PURE__ */ jsx26(ListItemText4, { primary: user.name, secondary: /* @__PURE__ */ jsxs14("span", { children: [
|
|
3079
|
+
/* @__PURE__ */ jsx26("span", { children: user.employeeId }),
|
|
3080
|
+
/* @__PURE__ */ jsx26("br", {}),
|
|
3081
|
+
/* @__PURE__ */ jsx26("span", { children: user.department })
|
|
3107
3082
|
] }) }) }),
|
|
3108
|
-
/* @__PURE__ */ (
|
|
3109
|
-
/* @__PURE__ */ (
|
|
3110
|
-
/* @__PURE__ */ (
|
|
3083
|
+
/* @__PURE__ */ jsxs14(ListItemButton5, { onClick: () => keycloak.logout(), children: [
|
|
3084
|
+
/* @__PURE__ */ jsx26(ListItemIcon4, { children: /* @__PURE__ */ jsx26(Logout, { color: "error" }) }),
|
|
3085
|
+
/* @__PURE__ */ jsx26(ListItemText4, { primary: t2("Layout.Logout") })
|
|
3111
3086
|
] })
|
|
3112
|
-
] }) : /* @__PURE__ */ (
|
|
3113
|
-
/* @__PURE__ */ (
|
|
3114
|
-
/* @__PURE__ */ (
|
|
3087
|
+
] }) : /* @__PURE__ */ jsxs14(ListItemButton5, { onClick: () => keycloak.login(), children: [
|
|
3088
|
+
/* @__PURE__ */ jsx26(ListItemIcon4, { children: /* @__PURE__ */ jsx26(Login, { color: "success" }) }),
|
|
3089
|
+
/* @__PURE__ */ jsx26(ListItemText4, { primary: t2("Layout.LogIn") })
|
|
3115
3090
|
] }) }),
|
|
3116
3091
|
tab === "settings" && settings,
|
|
3117
3092
|
tab === "theme" && theme,
|
|
@@ -3120,9 +3095,76 @@ var ToolbarAccount = () => {
|
|
|
3120
3095
|
] });
|
|
3121
3096
|
};
|
|
3122
3097
|
|
|
3098
|
+
// src/hooks/ThemeHook.ts
|
|
3099
|
+
import { createTheme, darken, lighten } from "@mui/material";
|
|
3100
|
+
import { grey as grey2 } from "@mui/material/colors";
|
|
3101
|
+
import { csCZ, enUS } from "@mui/material/locale";
|
|
3102
|
+
import { csCZ as dataGridCsCz, enUS as dataGridEnUs } from "@mui/x-data-grid-premium/locales";
|
|
3103
|
+
import { csCZ as datePickersCsCz, enUS as datePickersEnUs } from "@mui/x-date-pickers-pro/locales";
|
|
3104
|
+
import { useTranslation as useTranslation6 } from "react-i18next";
|
|
3105
|
+
var WISTRON_PRIMARY_COLOR = "#00506E";
|
|
3106
|
+
var WISTRON_SECONDARY_COLOR = "#64DC00";
|
|
3107
|
+
var useGetTheme = (theme) => {
|
|
3108
|
+
const { i18n: i18n2 } = useTranslation6();
|
|
3109
|
+
return createTheme(
|
|
3110
|
+
{
|
|
3111
|
+
cssVariables: {
|
|
3112
|
+
colorSchemeSelector: "data-mui-color-scheme"
|
|
3113
|
+
},
|
|
3114
|
+
colorSchemes: {
|
|
3115
|
+
light: {
|
|
3116
|
+
palette: {
|
|
3117
|
+
primary: { main: WISTRON_PRIMARY_COLOR },
|
|
3118
|
+
secondary: { main: WISTRON_SECONDARY_COLOR }
|
|
3119
|
+
}
|
|
3120
|
+
},
|
|
3121
|
+
dark: {
|
|
3122
|
+
palette: {
|
|
3123
|
+
primary: { main: lighten(WISTRON_PRIMARY_COLOR, 0.5) },
|
|
3124
|
+
secondary: { main: darken(WISTRON_SECONDARY_COLOR, 0.5) }
|
|
3125
|
+
}
|
|
3126
|
+
},
|
|
3127
|
+
...theme?.colorSchemes
|
|
3128
|
+
},
|
|
3129
|
+
components: {
|
|
3130
|
+
MuiCssBaseline: {
|
|
3131
|
+
styleOverrides: (theme2) => {
|
|
3132
|
+
return {
|
|
3133
|
+
body: {
|
|
3134
|
+
"&::-webkit-scrollbar, & *::-webkit-scrollbar": {
|
|
3135
|
+
width: "0.7em",
|
|
3136
|
+
height: "0.7em"
|
|
3137
|
+
},
|
|
3138
|
+
"&::-webkit-scrollbar-track, & *::-webkit-scrollbar-track": {
|
|
3139
|
+
backgroundColor: theme2.palette.mode === "dark" ? grey2[900] : grey2[200],
|
|
3140
|
+
borderRadius: "5px"
|
|
3141
|
+
},
|
|
3142
|
+
"&::-webkit-scrollbar-thumb, & *::-webkit-scrollbar-thumb": {
|
|
3143
|
+
backgroundColor: theme2.palette.mode === "dark" ? grey2[800] : grey2[400],
|
|
3144
|
+
borderRadius: "10px"
|
|
3145
|
+
},
|
|
3146
|
+
"&::-webkit-scrollbar-thumb:hover, & *::-webkit-scrollbar-thumb:hover": {
|
|
3147
|
+
backgroundColor: theme2.palette.mode === "dark" ? grey2[700] : grey2[500]
|
|
3148
|
+
},
|
|
3149
|
+
"&::-webkit-scrollbar-corner, & *::-webkit-scrollbar-corner": {
|
|
3150
|
+
backgroundColor: "transparent"
|
|
3151
|
+
}
|
|
3152
|
+
}
|
|
3153
|
+
};
|
|
3154
|
+
}
|
|
3155
|
+
},
|
|
3156
|
+
...theme?.components
|
|
3157
|
+
}
|
|
3158
|
+
},
|
|
3159
|
+
i18n2.resolvedLanguage === "cs" ? datePickersCsCz : datePickersEnUs,
|
|
3160
|
+
i18n2.resolvedLanguage === "cs" ? dataGridCsCz : dataGridEnUs,
|
|
3161
|
+
i18n2.resolvedLanguage === "cs" ? csCZ : enUS
|
|
3162
|
+
);
|
|
3163
|
+
};
|
|
3164
|
+
|
|
3123
3165
|
// src/components/core/Layout.tsx
|
|
3124
|
-
|
|
3125
|
-
var DrawerHeader = (
|
|
3166
|
+
import { jsx as jsx27, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3167
|
+
var DrawerHeader = styled2("div")(({ theme }) => ({
|
|
3126
3168
|
display: "flex",
|
|
3127
3169
|
alignItems: "center",
|
|
3128
3170
|
justifyContent: "flex-end",
|
|
@@ -3131,15 +3173,15 @@ var DrawerHeader = (0, import_styles4.styled)("div")(({ theme }) => ({
|
|
|
3131
3173
|
}));
|
|
3132
3174
|
var Layout = (props) => {
|
|
3133
3175
|
const theme = useGetTheme(props.theme);
|
|
3134
|
-
const [navigationOpen, setNavigationOpen] = (
|
|
3135
|
-
const isFetching = !!
|
|
3136
|
-
const isMutating = !!
|
|
3137
|
-
return /* @__PURE__ */ (
|
|
3138
|
-
/* @__PURE__ */ (
|
|
3139
|
-
/* @__PURE__ */ (
|
|
3140
|
-
/* @__PURE__ */ (
|
|
3141
|
-
/* @__PURE__ */ (
|
|
3142
|
-
|
|
3176
|
+
const [navigationOpen, setNavigationOpen] = useLocalStorageState("navigationOpen", { defaultServerValue: false });
|
|
3177
|
+
const isFetching = !!useIsFetching();
|
|
3178
|
+
const isMutating = !!useIsMutating();
|
|
3179
|
+
return /* @__PURE__ */ jsxs15(ThemeProvider, { theme, children: [
|
|
3180
|
+
/* @__PURE__ */ jsx27(InitColorSchemeScript, {}),
|
|
3181
|
+
/* @__PURE__ */ jsx27(CssBaseline, {}),
|
|
3182
|
+
/* @__PURE__ */ jsxs15(Box9, { sx: { display: "flex", height: "100dvh", maxHeight: "100dvh", overflow: "hidden", width: "100%" }, children: [
|
|
3183
|
+
/* @__PURE__ */ jsx27(
|
|
3184
|
+
AppBar,
|
|
3143
3185
|
{
|
|
3144
3186
|
color: "transparent",
|
|
3145
3187
|
position: "fixed",
|
|
@@ -3148,160 +3190,74 @@ var Layout = (props) => {
|
|
|
3148
3190
|
borderColor: theme.vars?.palette.divider,
|
|
3149
3191
|
boxShadow: "none"
|
|
3150
3192
|
},
|
|
3151
|
-
children: /* @__PURE__ */ (
|
|
3152
|
-
props.navigation && /* @__PURE__ */ (
|
|
3153
|
-
|
|
3193
|
+
children: /* @__PURE__ */ jsxs15(Toolbar, { children: [
|
|
3194
|
+
props.navigation && /* @__PURE__ */ jsx27(
|
|
3195
|
+
IconButton5,
|
|
3154
3196
|
{
|
|
3155
3197
|
onClick: () => setNavigationOpen((previous) => !previous),
|
|
3156
3198
|
sx: { marginRight: 2 },
|
|
3157
|
-
children: navigationOpen ? /* @__PURE__ */ (
|
|
3199
|
+
children: navigationOpen ? /* @__PURE__ */ jsx27(MenuOpen, {}) : /* @__PURE__ */ jsx27(Menu3, {})
|
|
3158
3200
|
}
|
|
3159
3201
|
),
|
|
3160
|
-
/* @__PURE__ */ (
|
|
3161
|
-
/* @__PURE__ */ (
|
|
3202
|
+
/* @__PURE__ */ jsx27(AppTitle, {}),
|
|
3203
|
+
/* @__PURE__ */ jsx27(ToolbarAccount, {})
|
|
3162
3204
|
] })
|
|
3163
3205
|
}
|
|
3164
3206
|
),
|
|
3165
|
-
props.navigation && /* @__PURE__ */ (
|
|
3166
|
-
/* @__PURE__ */ (
|
|
3167
|
-
/* @__PURE__ */ (
|
|
3168
|
-
/* @__PURE__ */ (
|
|
3207
|
+
props.navigation && /* @__PURE__ */ jsx27(NavigationRail, { navigation: props.navigation, expanded: navigationOpen ?? false, setExpanded: setNavigationOpen }),
|
|
3208
|
+
/* @__PURE__ */ jsxs15(Box9, { component: "main", sx: { flexGrow: 1, display: "flex", flexDirection: "column", minWidth: 0, height: "100%", overflow: "hidden" }, children: [
|
|
3209
|
+
/* @__PURE__ */ jsx27(DrawerHeader, {}),
|
|
3210
|
+
/* @__PURE__ */ jsx27(Box9, { sx: { flex: 1, overflow: "auto", position: "relative" }, children: props.children })
|
|
3169
3211
|
] })
|
|
3170
3212
|
] }),
|
|
3171
|
-
(isFetching || isMutating) && /* @__PURE__ */ (
|
|
3213
|
+
(isFetching || isMutating) && /* @__PURE__ */ jsx27(LinearProgress, { sx: { position: "fixed", top: { xs: 56, sm: 64 }, left: 0, right: 0 } })
|
|
3172
3214
|
] });
|
|
3173
3215
|
};
|
|
3174
3216
|
|
|
3175
3217
|
// src/contexts/LayoutContext.ts
|
|
3176
|
-
|
|
3177
|
-
var LayoutContext = (
|
|
3178
|
-
|
|
3179
|
-
// src/utils/i18n.ts
|
|
3180
|
-
var import_i18next = __toESM(require("i18next"), 1);
|
|
3181
|
-
var import_i18next_browser_languagedetector = __toESM(require("i18next-browser-languagedetector"), 1);
|
|
3182
|
-
var import_i18next_http_backend = __toESM(require("i18next-http-backend"), 1);
|
|
3183
|
-
var import_react_i18next7 = require("react-i18next");
|
|
3184
|
-
var import_i18next2 = __toESM(require("i18next"), 1);
|
|
3185
|
-
import_i18next.default.use(import_i18next_http_backend.default).use(import_i18next_browser_languagedetector.default).use(import_react_i18next7.initReactI18next).init({
|
|
3186
|
-
fallbackLng: "en",
|
|
3187
|
-
interpolation: {
|
|
3188
|
-
escapeValue: false
|
|
3189
|
-
},
|
|
3190
|
-
react: {
|
|
3191
|
-
useSuspense: false
|
|
3192
|
-
}
|
|
3193
|
-
});
|
|
3194
|
-
|
|
3195
|
-
// src/providers/DialogsProvider.tsx
|
|
3196
|
-
var import_react20 = require("react");
|
|
3197
|
-
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
3198
|
-
function DialogsProvider({ children, unmountAfter = 1e3 }) {
|
|
3199
|
-
const [stack, setStack] = (0, import_react20.useState)([]);
|
|
3200
|
-
const keyPrefix = (0, import_react20.useId)();
|
|
3201
|
-
const nextId = (0, import_react20.useRef)(0);
|
|
3202
|
-
const dialogMetadata = (0, import_react20.useRef)(/* @__PURE__ */ new WeakMap());
|
|
3203
|
-
const requestDialog = useEventCallback_default(function open(Component7, payload, options = {}) {
|
|
3204
|
-
const { onClose = async () => {
|
|
3205
|
-
} } = options;
|
|
3206
|
-
let resolve;
|
|
3207
|
-
const promise = new Promise((resolveImpl) => {
|
|
3208
|
-
resolve = resolveImpl;
|
|
3209
|
-
});
|
|
3210
|
-
const key = `${keyPrefix}-${nextId.current}`;
|
|
3211
|
-
nextId.current += 1;
|
|
3212
|
-
const newEntry = {
|
|
3213
|
-
key,
|
|
3214
|
-
open: true,
|
|
3215
|
-
promise,
|
|
3216
|
-
Component: Component7,
|
|
3217
|
-
payload,
|
|
3218
|
-
onClose,
|
|
3219
|
-
resolve
|
|
3220
|
-
};
|
|
3221
|
-
dialogMetadata.current.set(promise, newEntry);
|
|
3222
|
-
setStack((previousStack) => [...previousStack, newEntry]);
|
|
3223
|
-
return promise;
|
|
3224
|
-
});
|
|
3225
|
-
const removeDialogFromStack = (0, import_react20.useCallback)((dialog) => {
|
|
3226
|
-
setStack((previousStack) => previousStack.filter((entry) => entry.promise !== dialog));
|
|
3227
|
-
dialogMetadata.current.delete(dialog);
|
|
3228
|
-
}, []);
|
|
3229
|
-
const closeDialogUi = useEventCallback_default(function closeDialogUi2(dialog) {
|
|
3230
|
-
setStack(
|
|
3231
|
-
(previousStack) => previousStack.map((entry) => entry.promise === dialog ? { ...entry, open: false } : entry)
|
|
3232
|
-
);
|
|
3233
|
-
setTimeout(() => removeDialogFromStack(dialog), unmountAfter);
|
|
3234
|
-
});
|
|
3235
|
-
const closeDialog = useEventCallback_default(async function closeDialog2(dialog, result) {
|
|
3236
|
-
const entryToClose = dialogMetadata.current.get(dialog);
|
|
3237
|
-
if (!entryToClose) {
|
|
3238
|
-
throw new Error("Dialog not found in stack");
|
|
3239
|
-
}
|
|
3240
|
-
try {
|
|
3241
|
-
await entryToClose.onClose(result);
|
|
3242
|
-
} finally {
|
|
3243
|
-
entryToClose.resolve(result);
|
|
3244
|
-
closeDialogUi(dialog);
|
|
3245
|
-
}
|
|
3246
|
-
return dialog;
|
|
3247
|
-
});
|
|
3248
|
-
const contextValue = (0, import_react20.useMemo)(() => ({ open: requestDialog, close: closeDialog }), [requestDialog, closeDialog]);
|
|
3249
|
-
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(DialogsContext.Provider, { value: contextValue, children: [
|
|
3250
|
-
children,
|
|
3251
|
-
stack.map(({ key, open, Component: Component7, payload, promise }) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
3252
|
-
Component7,
|
|
3253
|
-
{
|
|
3254
|
-
payload,
|
|
3255
|
-
open,
|
|
3256
|
-
onClose: async (result) => {
|
|
3257
|
-
await closeDialog(promise, result);
|
|
3258
|
-
}
|
|
3259
|
-
},
|
|
3260
|
-
key
|
|
3261
|
-
))
|
|
3262
|
-
] });
|
|
3263
|
-
}
|
|
3218
|
+
import { createContext as createContext4, useContext as useContext4 } from "react";
|
|
3219
|
+
var LayoutContext = createContext4(null);
|
|
3264
3220
|
|
|
3265
3221
|
// src/providers/LayoutProvider.tsx
|
|
3266
|
-
|
|
3222
|
+
import { jsx as jsx28, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3267
3223
|
var LayoutProvider = (props) => {
|
|
3268
|
-
const [user, setUser] = (
|
|
3269
|
-
const { t: t2 } = (
|
|
3224
|
+
const [user, setUser] = useState10({ employeeId: "", name: "Unknown", department: "", company: "", category: "" });
|
|
3225
|
+
const { t: t2 } = useTranslation7();
|
|
3270
3226
|
const navigation = props.getNavigation?.({ user, t: t2 });
|
|
3271
|
-
(
|
|
3272
|
-
z.config(
|
|
3227
|
+
useEffect6(() => {
|
|
3228
|
+
z.config(default2.resolvedLanguage === "cs" ? cs() : en());
|
|
3273
3229
|
}, []);
|
|
3274
|
-
return /* @__PURE__ */ (
|
|
3230
|
+
return /* @__PURE__ */ jsx28(I18nextProvider, { i18n: default2, children: /* @__PURE__ */ jsx28(LocalizationProvider, { dateAdapter: AdapterDayjs, adapterLocale: default2.resolvedLanguage, children: /* @__PURE__ */ jsx28(LayoutContext.Provider, { value: { user: { get: user, set: setUser } }, children: /* @__PURE__ */ jsxs16(Layout, { navigation, theme: props.theme, children: [
|
|
3275
3231
|
"\xA8",
|
|
3276
|
-
/* @__PURE__ */ (
|
|
3232
|
+
/* @__PURE__ */ jsx28(DialogsProvider, { children: props.children })
|
|
3277
3233
|
] }) }) }) });
|
|
3278
3234
|
};
|
|
3279
3235
|
|
|
3280
3236
|
// src/index.ts
|
|
3281
|
-
|
|
3237
|
+
import { uuidv7 as uuidv72 } from "uuidv7";
|
|
3282
3238
|
|
|
3283
3239
|
// src/hooks/FormHooks.ts
|
|
3284
|
-
|
|
3240
|
+
import { createFormHook, createFormHookContexts } from "@tanstack/react-form";
|
|
3285
3241
|
|
|
3286
3242
|
// src/components/form/FormAutocomplete.tsx
|
|
3287
|
-
|
|
3243
|
+
import { Autocomplete, TextField } from "@mui/material";
|
|
3288
3244
|
|
|
3289
3245
|
// src/utils/FormUtils.ts
|
|
3290
3246
|
var getFieldStatus = (field) => {
|
|
3291
3247
|
const { meta } = field.state;
|
|
3292
3248
|
const isTouched = meta.isTouched;
|
|
3293
|
-
const hasError = !!meta.errors
|
|
3294
|
-
const helperText = meta.errors
|
|
3249
|
+
const hasError = !!meta.errors.length;
|
|
3250
|
+
const helperText = meta.errors[0]?.message;
|
|
3295
3251
|
return { isTouched, hasError, helperText };
|
|
3296
3252
|
};
|
|
3297
3253
|
|
|
3298
3254
|
// src/components/form/FormAutocomplete.tsx
|
|
3299
|
-
|
|
3255
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
3300
3256
|
var FormAutocomplete = ({ textFieldProps, ...autocompleteProps }) => {
|
|
3301
3257
|
const field = useFieldContext();
|
|
3302
3258
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
3303
|
-
return /* @__PURE__ */ (
|
|
3304
|
-
|
|
3259
|
+
return /* @__PURE__ */ jsx29(
|
|
3260
|
+
Autocomplete,
|
|
3305
3261
|
{
|
|
3306
3262
|
value: field.state.value,
|
|
3307
3263
|
onChange: (_, value) => !autocompleteProps.freeSolo && field.handleChange(value),
|
|
@@ -3309,8 +3265,8 @@ var FormAutocomplete = ({ textFieldProps, ...autocompleteProps }) => {
|
|
|
3309
3265
|
onBlur: field.handleBlur,
|
|
3310
3266
|
"aria-label": field.name,
|
|
3311
3267
|
...autocompleteProps,
|
|
3312
|
-
renderInput: (parameters) => /* @__PURE__ */ (
|
|
3313
|
-
|
|
3268
|
+
renderInput: (parameters) => /* @__PURE__ */ jsx29(
|
|
3269
|
+
TextField,
|
|
3314
3270
|
{
|
|
3315
3271
|
...parameters,
|
|
3316
3272
|
name: field.name,
|
|
@@ -3324,17 +3280,17 @@ var FormAutocomplete = ({ textFieldProps, ...autocompleteProps }) => {
|
|
|
3324
3280
|
};
|
|
3325
3281
|
|
|
3326
3282
|
// src/components/form/FormCheckbox.tsx
|
|
3327
|
-
|
|
3328
|
-
|
|
3283
|
+
import { Checkbox, FormControl, FormControlLabel, FormHelperText } from "@mui/material";
|
|
3284
|
+
import { jsx as jsx30, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3329
3285
|
var FormCheckbox = (props) => {
|
|
3330
3286
|
const field = useFieldContext();
|
|
3331
3287
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
3332
|
-
return /* @__PURE__ */ (
|
|
3333
|
-
/* @__PURE__ */ (
|
|
3334
|
-
|
|
3288
|
+
return /* @__PURE__ */ jsxs17(FormControl, { component: "fieldset", children: [
|
|
3289
|
+
/* @__PURE__ */ jsx30(
|
|
3290
|
+
FormControlLabel,
|
|
3335
3291
|
{
|
|
3336
|
-
control: /* @__PURE__ */ (
|
|
3337
|
-
|
|
3292
|
+
control: /* @__PURE__ */ jsx30(
|
|
3293
|
+
Checkbox,
|
|
3338
3294
|
{
|
|
3339
3295
|
name: field.name,
|
|
3340
3296
|
checked: Boolean(field.state.value),
|
|
@@ -3347,22 +3303,22 @@ var FormCheckbox = (props) => {
|
|
|
3347
3303
|
label: props.label ?? ""
|
|
3348
3304
|
}
|
|
3349
3305
|
),
|
|
3350
|
-
isTouched && hasError && /* @__PURE__ */ (
|
|
3306
|
+
isTouched && hasError && /* @__PURE__ */ jsx30(FormHelperText, { error: hasError, children: helperText })
|
|
3351
3307
|
] });
|
|
3352
3308
|
};
|
|
3353
3309
|
|
|
3354
3310
|
// src/components/form/FormDatePicker.tsx
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3311
|
+
import { DatePicker } from "@mui/x-date-pickers-pro";
|
|
3312
|
+
import dayjs2 from "dayjs";
|
|
3313
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
3358
3314
|
var FormDatePicker = (props) => {
|
|
3359
3315
|
const field = useFieldContext();
|
|
3360
3316
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
3361
|
-
return /* @__PURE__ */ (
|
|
3362
|
-
|
|
3317
|
+
return /* @__PURE__ */ jsx31(
|
|
3318
|
+
DatePicker,
|
|
3363
3319
|
{
|
|
3364
3320
|
name: field.name,
|
|
3365
|
-
value: field.state.value ? (
|
|
3321
|
+
value: field.state.value ? dayjs2(field.state.value) : null,
|
|
3366
3322
|
onChange: (value) => field.handleChange(value ? value.format() : null),
|
|
3367
3323
|
slotProps: {
|
|
3368
3324
|
textField: {
|
|
@@ -3380,17 +3336,17 @@ var FormDatePicker = (props) => {
|
|
|
3380
3336
|
};
|
|
3381
3337
|
|
|
3382
3338
|
// src/components/form/FormDateTimePicker.tsx
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3339
|
+
import { DateTimePicker } from "@mui/x-date-pickers-pro";
|
|
3340
|
+
import dayjs3 from "dayjs";
|
|
3341
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
3386
3342
|
var FormDateTimePicker = (props) => {
|
|
3387
3343
|
const field = useFieldContext();
|
|
3388
3344
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
3389
|
-
return /* @__PURE__ */ (
|
|
3390
|
-
|
|
3345
|
+
return /* @__PURE__ */ jsx32(
|
|
3346
|
+
DateTimePicker,
|
|
3391
3347
|
{
|
|
3392
3348
|
name: field.name,
|
|
3393
|
-
value: field.state.value ? (
|
|
3349
|
+
value: field.state.value ? dayjs3(field.state.value) : null,
|
|
3394
3350
|
onChange: (value) => field.handleChange(value ? value.format() : null),
|
|
3395
3351
|
slotProps: {
|
|
3396
3352
|
textField: {
|
|
@@ -3408,16 +3364,16 @@ var FormDateTimePicker = (props) => {
|
|
|
3408
3364
|
};
|
|
3409
3365
|
|
|
3410
3366
|
// src/components/form/FormNumberField.tsx
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3367
|
+
import { TextField as TextField2 } from "@mui/material";
|
|
3368
|
+
import { NumericFormat } from "react-number-format";
|
|
3369
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
3414
3370
|
var FormNumberField = ({ options, ...props }) => {
|
|
3415
3371
|
const field = useFieldContext();
|
|
3416
3372
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
3417
|
-
return /* @__PURE__ */ (
|
|
3418
|
-
|
|
3373
|
+
return /* @__PURE__ */ jsx33(
|
|
3374
|
+
NumericFormat,
|
|
3419
3375
|
{
|
|
3420
|
-
customInput:
|
|
3376
|
+
customInput: TextField2,
|
|
3421
3377
|
name: field.name,
|
|
3422
3378
|
value: field.state.value ?? "",
|
|
3423
3379
|
onValueChange: ({ floatValue }) => field.handleChange(floatValue),
|
|
@@ -3432,15 +3388,15 @@ var FormNumberField = ({ options, ...props }) => {
|
|
|
3432
3388
|
};
|
|
3433
3389
|
|
|
3434
3390
|
// src/components/form/FormRadioGroup.tsx
|
|
3435
|
-
|
|
3436
|
-
|
|
3391
|
+
import { FormControl as FormControl2, FormControlLabel as FormControlLabel2, FormHelperText as FormHelperText2, FormLabel, Radio, RadioGroup } from "@mui/material";
|
|
3392
|
+
import { jsx as jsx34, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3437
3393
|
var FormRadioGroup = ({ label, options, ...props }) => {
|
|
3438
3394
|
const field = useFieldContext();
|
|
3439
3395
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
3440
|
-
return /* @__PURE__ */ (
|
|
3441
|
-
label && /* @__PURE__ */ (
|
|
3442
|
-
/* @__PURE__ */ (
|
|
3443
|
-
|
|
3396
|
+
return /* @__PURE__ */ jsxs18(FormControl2, { component: "fieldset", children: [
|
|
3397
|
+
label && /* @__PURE__ */ jsx34(FormLabel, { component: "legend", children: label }),
|
|
3398
|
+
/* @__PURE__ */ jsx34(
|
|
3399
|
+
RadioGroup,
|
|
3444
3400
|
{
|
|
3445
3401
|
name: field.name,
|
|
3446
3402
|
value: field.state.value ?? "",
|
|
@@ -3448,31 +3404,31 @@ var FormRadioGroup = ({ label, options, ...props }) => {
|
|
|
3448
3404
|
onBlur: field.handleBlur,
|
|
3449
3405
|
"aria-label": field.name,
|
|
3450
3406
|
...props,
|
|
3451
|
-
children: options.map((option) => /* @__PURE__ */ (
|
|
3452
|
-
|
|
3407
|
+
children: options.map((option) => /* @__PURE__ */ jsx34(
|
|
3408
|
+
FormControlLabel2,
|
|
3453
3409
|
{
|
|
3454
3410
|
value: option.value,
|
|
3455
|
-
control: /* @__PURE__ */ (
|
|
3411
|
+
control: /* @__PURE__ */ jsx34(Radio, {}),
|
|
3456
3412
|
label: option.label
|
|
3457
3413
|
},
|
|
3458
3414
|
option.value
|
|
3459
3415
|
))
|
|
3460
3416
|
}
|
|
3461
3417
|
),
|
|
3462
|
-
isTouched && hasError && /* @__PURE__ */ (
|
|
3418
|
+
isTouched && hasError && /* @__PURE__ */ jsx34(FormHelperText2, { error: hasError, children: helperText })
|
|
3463
3419
|
] });
|
|
3464
3420
|
};
|
|
3465
3421
|
|
|
3466
3422
|
// src/components/form/FormSlider.tsx
|
|
3467
|
-
|
|
3468
|
-
|
|
3423
|
+
import { FormControl as FormControl3, FormHelperText as FormHelperText3, FormLabel as FormLabel2, Slider } from "@mui/material";
|
|
3424
|
+
import { jsx as jsx35, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3469
3425
|
var FormSlider = ({ label, ...props }) => {
|
|
3470
3426
|
const field = useFieldContext();
|
|
3471
3427
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
3472
|
-
return /* @__PURE__ */ (
|
|
3473
|
-
label && /* @__PURE__ */ (
|
|
3474
|
-
/* @__PURE__ */ (
|
|
3475
|
-
|
|
3428
|
+
return /* @__PURE__ */ jsxs19(FormControl3, { component: "fieldset", children: [
|
|
3429
|
+
label && /* @__PURE__ */ jsx35(FormLabel2, { children: label }),
|
|
3430
|
+
/* @__PURE__ */ jsx35(
|
|
3431
|
+
Slider,
|
|
3476
3432
|
{
|
|
3477
3433
|
name: field.name,
|
|
3478
3434
|
value: field.state.value ?? 0,
|
|
@@ -3482,13 +3438,13 @@ var FormSlider = ({ label, ...props }) => {
|
|
|
3482
3438
|
...props
|
|
3483
3439
|
}
|
|
3484
3440
|
),
|
|
3485
|
-
isTouched && hasError && /* @__PURE__ */ (
|
|
3441
|
+
isTouched && hasError && /* @__PURE__ */ jsx35(FormHelperText3, { error: hasError, children: helperText })
|
|
3486
3442
|
] });
|
|
3487
3443
|
};
|
|
3488
3444
|
|
|
3489
3445
|
// src/components/form/FormSubmitButton.tsx
|
|
3490
|
-
|
|
3491
|
-
|
|
3446
|
+
import { Button as Button3 } from "@mui/material";
|
|
3447
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
3492
3448
|
var FormSubmitButton = (props) => {
|
|
3493
3449
|
const form = useFormContext();
|
|
3494
3450
|
const handleClick = (event) => {
|
|
@@ -3496,8 +3452,8 @@ var FormSubmitButton = (props) => {
|
|
|
3496
3452
|
event.stopPropagation();
|
|
3497
3453
|
form.handleSubmit();
|
|
3498
3454
|
};
|
|
3499
|
-
return /* @__PURE__ */ (
|
|
3500
|
-
|
|
3455
|
+
return /* @__PURE__ */ jsx36(form.Subscribe, { selector: (state) => [state.canSubmit, state.isSubmitting], children: ([canSubmit, isSubmitting]) => /* @__PURE__ */ jsx36(
|
|
3456
|
+
Button3,
|
|
3501
3457
|
{
|
|
3502
3458
|
loading: isSubmitting,
|
|
3503
3459
|
disabled: !canSubmit,
|
|
@@ -3510,17 +3466,17 @@ var FormSubmitButton = (props) => {
|
|
|
3510
3466
|
};
|
|
3511
3467
|
|
|
3512
3468
|
// src/components/form/FormSwitch.tsx
|
|
3513
|
-
|
|
3514
|
-
|
|
3469
|
+
import { FormControl as FormControl4, FormControlLabel as FormControlLabel3, FormHelperText as FormHelperText4, Switch } from "@mui/material";
|
|
3470
|
+
import { jsx as jsx37, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3515
3471
|
var FormSwitch = (props) => {
|
|
3516
3472
|
const field = useFieldContext();
|
|
3517
3473
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
3518
|
-
return /* @__PURE__ */ (
|
|
3519
|
-
/* @__PURE__ */ (
|
|
3520
|
-
|
|
3474
|
+
return /* @__PURE__ */ jsxs20(FormControl4, { component: "fieldset", children: [
|
|
3475
|
+
/* @__PURE__ */ jsx37(
|
|
3476
|
+
FormControlLabel3,
|
|
3521
3477
|
{
|
|
3522
|
-
control: /* @__PURE__ */ (
|
|
3523
|
-
|
|
3478
|
+
control: /* @__PURE__ */ jsx37(
|
|
3479
|
+
Switch,
|
|
3524
3480
|
{
|
|
3525
3481
|
name: field.name,
|
|
3526
3482
|
checked: Boolean(field.state.value),
|
|
@@ -3533,18 +3489,18 @@ var FormSwitch = (props) => {
|
|
|
3533
3489
|
label: props.label ?? ""
|
|
3534
3490
|
}
|
|
3535
3491
|
),
|
|
3536
|
-
isTouched && hasError && /* @__PURE__ */ (
|
|
3492
|
+
isTouched && hasError && /* @__PURE__ */ jsx37(FormHelperText4, { error: hasError, children: helperText })
|
|
3537
3493
|
] });
|
|
3538
3494
|
};
|
|
3539
3495
|
|
|
3540
3496
|
// src/components/form/FormTextField.tsx
|
|
3541
|
-
|
|
3542
|
-
|
|
3497
|
+
import { TextField as TextField3 } from "@mui/material";
|
|
3498
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
3543
3499
|
var FormTextField = (props) => {
|
|
3544
3500
|
const field = useFieldContext();
|
|
3545
3501
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
3546
|
-
return /* @__PURE__ */ (
|
|
3547
|
-
|
|
3502
|
+
return /* @__PURE__ */ jsx38(
|
|
3503
|
+
TextField3,
|
|
3548
3504
|
{
|
|
3549
3505
|
name: field.name,
|
|
3550
3506
|
value: field.state.value ?? "",
|
|
@@ -3559,8 +3515,8 @@ var FormTextField = (props) => {
|
|
|
3559
3515
|
};
|
|
3560
3516
|
|
|
3561
3517
|
// src/hooks/FormHooks.ts
|
|
3562
|
-
var { fieldContext, useFieldContext, formContext, useFormContext } =
|
|
3563
|
-
var { useAppForm: useLayoutForm, withForm: withLayoutForm } =
|
|
3518
|
+
var { fieldContext, useFieldContext, formContext, useFormContext } = createFormHookContexts();
|
|
3519
|
+
var { useAppForm: useLayoutForm, withForm: withLayoutForm } = createFormHook({
|
|
3564
3520
|
fieldComponents: {
|
|
3565
3521
|
TextField: FormTextField,
|
|
3566
3522
|
NumberField: FormNumberField,
|
|
@@ -3580,11 +3536,10 @@ var { useAppForm: useLayoutForm, withForm: withLayoutForm } = (0, import_react_f
|
|
|
3580
3536
|
});
|
|
3581
3537
|
|
|
3582
3538
|
// src/index.ts
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
0 && (module.exports = {
|
|
3539
|
+
import { default as default3 } from "use-local-storage-state";
|
|
3540
|
+
import { useTranslation as useTranslation8 } from "react-i18next";
|
|
3541
|
+
import { t } from "i18next";
|
|
3542
|
+
export {
|
|
3588
3543
|
ChipInputCell,
|
|
3589
3544
|
Dropzone,
|
|
3590
3545
|
EditableColumnHeader,
|
|
@@ -3614,15 +3569,15 @@ var import_i18next3 = require("i18next");
|
|
|
3614
3569
|
useGetFileMetas,
|
|
3615
3570
|
useGetFileThumbnail,
|
|
3616
3571
|
useLayoutForm,
|
|
3617
|
-
useLocalStorageState,
|
|
3572
|
+
default3 as useLocalStorageState,
|
|
3618
3573
|
useOpenFile,
|
|
3619
|
-
useTranslation,
|
|
3574
|
+
useTranslation8 as useTranslation,
|
|
3620
3575
|
useUpdateFileMeta,
|
|
3621
3576
|
useUploadFile,
|
|
3622
|
-
uuidv7,
|
|
3577
|
+
uuidv72 as uuidv7,
|
|
3623
3578
|
wczApiClient,
|
|
3624
3579
|
withLayoutForm
|
|
3625
|
-
}
|
|
3580
|
+
};
|
|
3626
3581
|
/*! Bundled license information:
|
|
3627
3582
|
|
|
3628
3583
|
react-is/cjs/react-is.production.min.js:
|
|
@@ -3652,3 +3607,4 @@ object-assign/index.js:
|
|
|
3652
3607
|
@license MIT
|
|
3653
3608
|
*)
|
|
3654
3609
|
*/
|
|
3610
|
+
//# sourceMappingURL=index.js.map
|