wcz-layout 10.1.2 → 10.1.7
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/{AggregatedCell-C7nAQyMO.mjs → AggregatedCell-CqGptV6i.mjs} +199 -150
- package/dist/AggregatedCell-CqGptV6i.mjs.map +1 -0
- package/dist/Approval-DoD-GRRH.mjs.map +1 -1
- package/dist/DialogsContext-DLqA8RJ_.mjs.map +1 -1
- package/dist/Email-BzQQkbe9.mjs.map +1 -1
- package/dist/FileMeta-DDqUju1Y.mjs.map +1 -1
- package/dist/{LayoutTable-DX9IaO8V.d.mts → LayoutTable-CRo43iWr.d.mts} +7 -3
- package/dist/{RouterListItemButton-ULMlaQh6.mjs → RouterListItemButton-ke6iPKkL.mjs} +9 -9
- package/dist/RouterListItemButton-ke6iPKkL.mjs.map +1 -0
- package/dist/{approval-DiNOXd4B.mjs → approval-L09uPzTU.mjs} +2 -2
- package/dist/approval-L09uPzTU.mjs.map +1 -0
- package/dist/auth.d.mts +1 -0
- package/dist/auth.mjs +15 -12
- package/dist/auth.mjs.map +1 -1
- package/dist/components.d.mts +1 -1
- package/dist/components.mjs +594 -361
- package/dist/components.mjs.map +1 -1
- package/dist/{createApi-DGJJ4I_R.mjs → createApi-BhNkG4jz.mjs} +3 -3
- package/dist/createApi-BhNkG4jz.mjs.map +1 -0
- package/dist/data/client.mjs +3 -3
- package/dist/data/client.mjs.map +1 -1
- package/dist/data/server.mjs +4 -4
- package/dist/data/server.mjs.map +1 -1
- package/dist/{file-C14fhUeg.mjs → file-Chlljz3o.mjs} +4 -4
- package/dist/file-Chlljz3o.mjs.map +1 -0
- package/dist/{file-C5BOj1q8.mjs → file-Dl8JCcqy.mjs} +4 -4
- package/dist/file-Dl8JCcqy.mjs.map +1 -0
- package/dist/hooks.d.mts +2 -1
- package/dist/hooks.mjs +541 -591
- package/dist/hooks.mjs.map +1 -1
- package/dist/index.d.mts +9 -0
- package/dist/index.mjs +438 -428
- package/dist/index.mjs.map +1 -1
- package/dist/middleware.mjs +2 -2
- package/dist/middleware.mjs.map +1 -1
- package/dist/models.mjs.map +1 -1
- package/dist/{peoplesoft-BkJMCcHb.mjs → peoplesoft-BhintHQz.mjs} +3 -3
- package/dist/peoplesoft-BhintHQz.mjs.map +1 -0
- package/dist/{providers-DrairEO2.mjs → providers-BvuZWkpD.mjs} +2 -2
- package/dist/providers-BvuZWkpD.mjs.map +1 -0
- package/dist/{tokens-BLRreL1j.mjs → tokens-XuFhVbh5.mjs} +9 -6
- package/dist/tokens-XuFhVbh5.mjs.map +1 -0
- package/dist/{utils-BUpDoqme.mjs → utils-CaeVFWF-.mjs} +18 -7
- package/dist/utils-CaeVFWF-.mjs.map +1 -0
- package/dist/utils.mjs +1 -1
- package/dist/vite.mjs +11 -0
- package/dist/vite.mjs.map +1 -1
- package/package.json +131 -130
- package/skills/client-db/SKILL.md +136 -136
- package/skills/db-schema/SKILL.md +98 -98
- package/skills/dialogs/SKILL.md +74 -74
- package/skills/forms/SKILL.md +122 -122
- package/skills/general/SKILL.md +127 -127
- package/skills/general/references/exports.md +6 -1
- package/skills/migrations/SKILL.md +57 -57
- package/skills/migrations/versions/migrate-v10-to-v11.md +2 -1
- package/skills/migrations/versions/migrate-v9-to-v10.md +582 -582
- package/skills/routing/SKILL.md +87 -87
- package/skills/server-functions/SKILL.md +95 -95
- package/skills/services/SKILL.md +34 -34
- package/skills/services/docs/email.md +32 -32
- package/skills/services/docs/file.md +108 -108
- package/skills/services/docs/peoplesoft.md +114 -114
- package/skills/start/SKILL.md +52 -52
- package/skills/start/steps/01-git-setup.md +10 -10
- package/skills/start/steps/02-project-name-setup.md +19 -19
- package/skills/start/steps/03-apm-setup.md +97 -208
- package/skills/start/steps/04-wicop-setup.md +105 -105
- package/skills/start/steps/05-database-setup.md +52 -52
- package/skills/start/steps/06-entra-setup.md +96 -96
- package/skills/start/steps/07-vault-setup.md +115 -115
- package/skills/start/steps/08-generate-favicon.md +8 -8
- package/skills/start/steps/09-gitlab-ci.md +25 -25
- package/skills/start/steps/10-commit.md +15 -15
- package/skills/table/SKILL.md +266 -264
- package/dist/AggregatedCell-C7nAQyMO.mjs.map +0 -1
- package/dist/RouterListItemButton-ULMlaQh6.mjs.map +0 -1
- package/dist/approval-DiNOXd4B.mjs.map +0 -1
- package/dist/createApi-DGJJ4I_R.mjs.map +0 -1
- package/dist/file-C14fhUeg.mjs.map +0 -1
- package/dist/file-C5BOj1q8.mjs.map +0 -1
- package/dist/peoplesoft-BkJMCcHb.mjs.map +0 -1
- package/dist/providers-DrairEO2.mjs.map +0 -1
- package/dist/tokens-BLRreL1j.mjs.map +0 -1
- package/dist/utils-BUpDoqme.mjs.map +0 -1
package/dist/components.mjs
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { d as sanitizeReturnTo, m as loginProvidersQueryOptions } from "./utils-
|
|
2
|
-
import { n as RouterIconButton, t as RouterListItemButton } from "./RouterListItemButton-
|
|
3
|
-
import { a as fileQueryOptions, i as fileMetasQueryOptions, n as deleteFileMutationOptions, o as fileThumbnailQueryOptions, r as downloadFileMutationOptions, s as openFileMutationOptions } from "./file-
|
|
4
|
-
import {
|
|
1
|
+
import { d as sanitizeReturnTo, m as loginProvidersQueryOptions } from "./utils-CaeVFWF-.mjs";
|
|
2
|
+
import { n as RouterIconButton, t as RouterListItemButton } from "./RouterListItemButton-ke6iPKkL.mjs";
|
|
3
|
+
import { a as fileQueryOptions, i as fileMetasQueryOptions, n as deleteFileMutationOptions, o as fileThumbnailQueryOptions, r as downloadFileMutationOptions, s as openFileMutationOptions } from "./file-Chlljz3o.mjs";
|
|
4
|
+
import { S as useDialogs, a as columnFlex, c as lookaheadRange, f as toClipboardText, i as columnAlign, p as DEFAULT_PAGE_SIZE_OPTIONS, r as cellSelectionSx, s as hasColumnLabel, t as AggregatedCell, u as pinnedSx } from "./AggregatedCell-CqGptV6i.mjs";
|
|
5
5
|
import { c } from "react/compiler-runtime";
|
|
6
|
-
import { Box, Button, Card, CardContent, CircularProgress, Dialog, Divider, Fab, IconButton, ImageListItem, ImageListItemBar, Link, List, ListItemButton, ListItemIcon, ListItemText, Menu, Paper, Skeleton, Stack, Tab, Table, TableBody, TableCell, TableContainer, TableFooter, TableHead, TableRow, Tooltip, Typography, alpha, useTheme } from "@mui/material";
|
|
6
|
+
import { Box, Button, ButtonBase, Card, CardContent, CircularProgress, Dialog, Divider, Fab, IconButton, ImageListItem, ImageListItemBar, Link, List, ListItem, ListItemButton, ListItemIcon, ListItemText, Menu, MenuItem, Paper, Skeleton, Stack, Tab, Table, TableBody, TableCell, TableContainer, TableFooter, TableHead, TableRow, Tooltip, Typography, alpha, useTheme } from "@mui/material";
|
|
7
7
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
8
8
|
import React, { Fragment, createContext, useContext, useEffect, useEffectEvent, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
9
9
|
import { useTranslation } from "react-i18next";
|
|
10
10
|
import { manifest } from "virtual:wcz-layout";
|
|
11
11
|
import { createLink, rootRouteId, useLocation, useMatch } from "@tanstack/react-router";
|
|
12
|
+
import ChevronRight from "@mui/icons-material/ChevronRight";
|
|
12
13
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
13
14
|
import Close from "@mui/icons-material/Close";
|
|
14
15
|
import CloudQueue from "@mui/icons-material/CloudQueue";
|
|
@@ -23,6 +24,7 @@ import FileDownload from "@mui/icons-material/FileDownload";
|
|
|
23
24
|
import AttachFile from "@mui/icons-material/AttachFile";
|
|
24
25
|
import Image from "@mui/icons-material/Image";
|
|
25
26
|
import SmartDisplay from "@mui/icons-material/SmartDisplay";
|
|
27
|
+
import ChevronLeft from "@mui/icons-material/ChevronLeft";
|
|
26
28
|
import { useHotkeys } from "@tanstack/react-hotkeys";
|
|
27
29
|
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
28
30
|
//#region src/components/core/account/LoginForm.tsx
|
|
@@ -37,9 +39,9 @@ const PROVIDER_ICON = {
|
|
|
37
39
|
*/
|
|
38
40
|
const LoginForm = () => {
|
|
39
41
|
const $ = c(36);
|
|
40
|
-
if ($[0] !== "
|
|
42
|
+
if ($[0] !== "5f14f2dd7f994bdd88840e3f375e9ee4b049c4d266a9eaf4b3e2533ff17cc7c6") {
|
|
41
43
|
for (let $i = 0; $i < 36; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
42
|
-
$[0] = "
|
|
44
|
+
$[0] = "5f14f2dd7f994bdd88840e3f375e9ee4b049c4d266a9eaf4b3e2533ff17cc7c6";
|
|
43
45
|
}
|
|
44
46
|
const { data: t0 } = useQuery(loginProvidersQueryOptions);
|
|
45
47
|
let t1;
|
|
@@ -51,7 +53,7 @@ const LoginForm = () => {
|
|
|
51
53
|
const providers = t1;
|
|
52
54
|
let t2;
|
|
53
55
|
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
54
|
-
t2 = { select: _temp$
|
|
56
|
+
t2 = { select: _temp$2 };
|
|
55
57
|
$[3] = t2;
|
|
56
58
|
} else t2 = $[3];
|
|
57
59
|
const search = useLocation(t2);
|
|
@@ -119,7 +121,7 @@ const LoginForm = () => {
|
|
|
119
121
|
t11 = /* @__PURE__ */ jsx(Box, {
|
|
120
122
|
component: "img",
|
|
121
123
|
src: "/android-chrome-192x192.png",
|
|
122
|
-
alt:
|
|
124
|
+
alt: "",
|
|
123
125
|
width: 48,
|
|
124
126
|
height: 48
|
|
125
127
|
});
|
|
@@ -160,6 +162,7 @@ const LoginForm = () => {
|
|
|
160
162
|
spacing: .25,
|
|
161
163
|
children: [t12, /* @__PURE__ */ jsx(Typography, {
|
|
162
164
|
variant: "h5",
|
|
165
|
+
component: "h1",
|
|
163
166
|
sx: t13,
|
|
164
167
|
children: t14
|
|
165
168
|
})]
|
|
@@ -240,7 +243,7 @@ const LoginForm = () => {
|
|
|
240
243
|
} else t19 = $[35];
|
|
241
244
|
return t19;
|
|
242
245
|
};
|
|
243
|
-
function _temp$
|
|
246
|
+
function _temp$2(location) {
|
|
244
247
|
return location.search;
|
|
245
248
|
}
|
|
246
249
|
function _temp2(theme) {
|
|
@@ -260,11 +263,25 @@ function _temp3(theme_0) {
|
|
|
260
263
|
}
|
|
261
264
|
//#endregion
|
|
262
265
|
//#region src/components/core/Fullscreen.tsx
|
|
266
|
+
const isScrollContainer = (element) => /auto|scroll|overlay/.test(getComputedStyle(element).overflowY);
|
|
267
|
+
/** Ancestors up to and including the nearest scroll container (or the root element). */
|
|
268
|
+
const getAncestors = (element) => {
|
|
269
|
+
const ancestors = [];
|
|
270
|
+
let parent = element.parentElement;
|
|
271
|
+
while (parent && parent !== document.body && parent !== document.documentElement) {
|
|
272
|
+
ancestors.push(parent);
|
|
273
|
+
if (isScrollContainer(parent)) return ancestors;
|
|
274
|
+
parent = parent.parentElement;
|
|
275
|
+
}
|
|
276
|
+
ancestors.push(document.documentElement);
|
|
277
|
+
return ancestors;
|
|
278
|
+
};
|
|
279
|
+
const px = (value) => Number.parseFloat(value) || 0;
|
|
263
280
|
const Fullscreen = (t0) => {
|
|
264
281
|
const $ = c(16);
|
|
265
|
-
if ($[0] !== "
|
|
282
|
+
if ($[0] !== "8cbf7a32d40cad26f487ed7c5e0b8451044a6d7e404e9591bd3919c6daa7488f") {
|
|
266
283
|
for (let $i = 0; $i < 16; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
267
|
-
$[0] = "
|
|
284
|
+
$[0] = "8cbf7a32d40cad26f487ed7c5e0b8451044a6d7e404e9591bd3919c6daa7488f";
|
|
268
285
|
}
|
|
269
286
|
let children;
|
|
270
287
|
let props;
|
|
@@ -285,11 +302,22 @@ const Fullscreen = (t0) => {
|
|
|
285
302
|
let t1;
|
|
286
303
|
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
287
304
|
t1 = () => {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
const
|
|
291
|
-
const
|
|
292
|
-
|
|
305
|
+
const element = reference.current;
|
|
306
|
+
if (!element) return;
|
|
307
|
+
const ancestors = getAncestors(element);
|
|
308
|
+
const container = ancestors.at(-1);
|
|
309
|
+
const isRoot = container === document.documentElement;
|
|
310
|
+
const top = element.getBoundingClientRect().top;
|
|
311
|
+
const offsetTop = isRoot ? top + window.scrollY : top - container.getBoundingClientRect().top - container.clientTop + container.scrollTop;
|
|
312
|
+
const containerHeight = isRoot ? window.visualViewport?.height ?? window.innerHeight : container.clientHeight;
|
|
313
|
+
let trailing = px(getComputedStyle(element).marginBottom);
|
|
314
|
+
for (const ancestor of ancestors) {
|
|
315
|
+
const style = getComputedStyle(ancestor);
|
|
316
|
+
trailing = trailing + px(style.paddingBottom);
|
|
317
|
+
if (ancestor === container) break;
|
|
318
|
+
trailing = trailing + (px(style.borderBottomWidth) + px(style.marginBottom));
|
|
319
|
+
}
|
|
320
|
+
setHeight(Math.max(0, Math.floor(containerHeight - offsetTop - trailing)));
|
|
293
321
|
};
|
|
294
322
|
$[5] = t1;
|
|
295
323
|
} else t1 = $[5];
|
|
@@ -297,16 +325,17 @@ const Fullscreen = (t0) => {
|
|
|
297
325
|
let t2;
|
|
298
326
|
if ($[6] !== recompute) {
|
|
299
327
|
t2 = () => {
|
|
300
|
-
const
|
|
301
|
-
if (!
|
|
328
|
+
const element_0 = reference.current;
|
|
329
|
+
if (!element_0) return;
|
|
302
330
|
recompute();
|
|
303
331
|
window.addEventListener("resize", recompute);
|
|
304
|
-
|
|
305
|
-
ro
|
|
306
|
-
ro.observe(
|
|
307
|
-
ro.observe(
|
|
332
|
+
window.visualViewport?.addEventListener("resize", recompute);
|
|
333
|
+
const ro = new ResizeObserver(() => recompute());
|
|
334
|
+
ro.observe(element_0);
|
|
335
|
+
for (const ancestor_0 of getAncestors(element_0)) ro.observe(ancestor_0);
|
|
308
336
|
return () => {
|
|
309
337
|
window.removeEventListener("resize", recompute);
|
|
338
|
+
window.visualViewport?.removeEventListener("resize", recompute);
|
|
310
339
|
ro.disconnect();
|
|
311
340
|
};
|
|
312
341
|
};
|
|
@@ -361,15 +390,14 @@ const baseStyle = {
|
|
|
361
390
|
borderWidth: 2,
|
|
362
391
|
borderRadius: 2,
|
|
363
392
|
borderStyle: "dashed",
|
|
364
|
-
|
|
365
|
-
transition: "border .24s ease-in-out",
|
|
393
|
+
transition: "border-color .24s ease-in-out",
|
|
366
394
|
cursor: "pointer"
|
|
367
395
|
};
|
|
368
396
|
const Dropzone = (t0) => {
|
|
369
|
-
const $ = c(
|
|
370
|
-
if ($[0] !== "
|
|
371
|
-
for (let $i = 0; $i <
|
|
372
|
-
$[0] = "
|
|
397
|
+
const $ = c(33);
|
|
398
|
+
if ($[0] !== "5f7e412e732333f86e343ff1dbc3882283622c609fd4ce6a961ebef933e25fd9") {
|
|
399
|
+
for (let $i = 0; $i < 33; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
400
|
+
$[0] = "5f7e412e732333f86e343ff1dbc3882283622c609fd4ce6a961ebef933e25fd9";
|
|
373
401
|
}
|
|
374
402
|
let progress;
|
|
375
403
|
let props;
|
|
@@ -392,7 +420,7 @@ const Dropzone = (t0) => {
|
|
|
392
420
|
const t2 = theme.vars || theme;
|
|
393
421
|
let T0;
|
|
394
422
|
let t3;
|
|
395
|
-
if ($[5] !== getRootProps || $[6] !== isDragAccept || $[7] !== isDragReject || $[8] !== isFocused || $[9] !==
|
|
423
|
+
if ($[5] !== getRootProps || $[6] !== isDragAccept || $[7] !== isDragReject || $[8] !== isFocused || $[9] !== props.disabled || $[10] !== t1 || $[11] !== t2.palette.text.disabled || $[12] !== theme) {
|
|
396
424
|
const style = {
|
|
397
425
|
...baseStyle,
|
|
398
426
|
cursor: t1,
|
|
@@ -402,64 +430,70 @@ const Dropzone = (t0) => {
|
|
|
402
430
|
...isDragReject ? { borderColor: (theme.vars || theme).palette.error.main } : {}
|
|
403
431
|
};
|
|
404
432
|
T0 = Box;
|
|
405
|
-
t3 = getRootProps({
|
|
433
|
+
t3 = getRootProps({
|
|
434
|
+
style,
|
|
435
|
+
role: "button",
|
|
436
|
+
"aria-disabled": props.disabled || void 0
|
|
437
|
+
});
|
|
406
438
|
$[5] = getRootProps;
|
|
407
439
|
$[6] = isDragAccept;
|
|
408
440
|
$[7] = isDragReject;
|
|
409
441
|
$[8] = isFocused;
|
|
410
|
-
$[9] =
|
|
411
|
-
$[10] =
|
|
412
|
-
$[11] =
|
|
413
|
-
$[12] =
|
|
414
|
-
$[13] =
|
|
442
|
+
$[9] = props.disabled;
|
|
443
|
+
$[10] = t1;
|
|
444
|
+
$[11] = t2.palette.text.disabled;
|
|
445
|
+
$[12] = theme;
|
|
446
|
+
$[13] = T0;
|
|
447
|
+
$[14] = t3;
|
|
415
448
|
} else {
|
|
416
|
-
T0 = $[
|
|
417
|
-
t3 = $[
|
|
449
|
+
T0 = $[13];
|
|
450
|
+
t3 = $[14];
|
|
418
451
|
}
|
|
419
452
|
let t4;
|
|
420
|
-
if ($[
|
|
453
|
+
if ($[15] !== getInputProps) {
|
|
421
454
|
t4 = getInputProps();
|
|
422
|
-
$[
|
|
423
|
-
$[
|
|
424
|
-
} else t4 = $[
|
|
455
|
+
$[15] = getInputProps;
|
|
456
|
+
$[16] = t4;
|
|
457
|
+
} else t4 = $[16];
|
|
425
458
|
let t5;
|
|
426
|
-
if ($[
|
|
459
|
+
if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
|
|
427
460
|
t5 = { display: "none" };
|
|
428
|
-
$[
|
|
429
|
-
} else t5 = $[
|
|
461
|
+
$[17] = t5;
|
|
462
|
+
} else t5 = $[17];
|
|
430
463
|
let t6;
|
|
431
|
-
if ($[
|
|
464
|
+
if ($[18] !== t4) {
|
|
432
465
|
t6 = /* @__PURE__ */ jsx("input", {
|
|
433
466
|
...t4,
|
|
434
467
|
style: t5
|
|
435
468
|
});
|
|
436
|
-
$[
|
|
437
|
-
$[
|
|
438
|
-
} else t6 = $[
|
|
469
|
+
$[18] = t4;
|
|
470
|
+
$[19] = t6;
|
|
471
|
+
} else t6 = $[19];
|
|
439
472
|
let t7;
|
|
440
|
-
if ($[
|
|
473
|
+
if ($[20] !== progress) {
|
|
441
474
|
t7 = progress ? /* @__PURE__ */ jsx(CircularProgress, {
|
|
442
475
|
size: 24,
|
|
443
476
|
variant: "determinate",
|
|
444
|
-
value: progress
|
|
477
|
+
value: progress,
|
|
478
|
+
"aria-label": "Uploading"
|
|
445
479
|
}) : /* @__PURE__ */ jsx(CloudUpload, {});
|
|
446
|
-
$[
|
|
447
|
-
$[
|
|
448
|
-
} else t7 = $[
|
|
480
|
+
$[20] = progress;
|
|
481
|
+
$[21] = t7;
|
|
482
|
+
} else t7 = $[21];
|
|
449
483
|
let t8;
|
|
450
|
-
if ($[
|
|
484
|
+
if ($[22] !== t) {
|
|
451
485
|
t8 = t("Layout.File.DragSomeFilesHereOrClickToSelectThem");
|
|
452
|
-
$[
|
|
453
|
-
$[
|
|
454
|
-
} else t8 = $[
|
|
486
|
+
$[22] = t;
|
|
487
|
+
$[23] = t8;
|
|
488
|
+
} else t8 = $[23];
|
|
455
489
|
let t9;
|
|
456
|
-
if ($[
|
|
490
|
+
if ($[24] !== t8) {
|
|
457
491
|
t9 = /* @__PURE__ */ jsx(Typography, { children: t8 });
|
|
458
|
-
$[
|
|
459
|
-
$[
|
|
460
|
-
} else t9 = $[
|
|
492
|
+
$[24] = t8;
|
|
493
|
+
$[25] = t9;
|
|
494
|
+
} else t9 = $[25];
|
|
461
495
|
let t10;
|
|
462
|
-
if ($[
|
|
496
|
+
if ($[26] !== T0 || $[27] !== sx || $[28] !== t3 || $[29] !== t6 || $[30] !== t7 || $[31] !== t9) {
|
|
463
497
|
t10 = /* @__PURE__ */ jsxs(T0, {
|
|
464
498
|
...t3,
|
|
465
499
|
sx,
|
|
@@ -469,14 +503,14 @@ const Dropzone = (t0) => {
|
|
|
469
503
|
t9
|
|
470
504
|
]
|
|
471
505
|
});
|
|
472
|
-
$[
|
|
473
|
-
$[
|
|
474
|
-
$[
|
|
475
|
-
$[
|
|
476
|
-
$[
|
|
477
|
-
$[
|
|
478
|
-
$[
|
|
479
|
-
} else t10 = $[
|
|
506
|
+
$[26] = T0;
|
|
507
|
+
$[27] = sx;
|
|
508
|
+
$[28] = t3;
|
|
509
|
+
$[29] = t6;
|
|
510
|
+
$[30] = t7;
|
|
511
|
+
$[31] = t9;
|
|
512
|
+
$[32] = t10;
|
|
513
|
+
} else t10 = $[32];
|
|
480
514
|
return t10;
|
|
481
515
|
};
|
|
482
516
|
//#endregion
|
|
@@ -484,9 +518,9 @@ const Dropzone = (t0) => {
|
|
|
484
518
|
const FileContext = createContext(null);
|
|
485
519
|
const useFile = () => {
|
|
486
520
|
const $ = c(1);
|
|
487
|
-
if ($[0] !== "
|
|
521
|
+
if ($[0] !== "789f01e265d2e58bf61ca53d252b729cbba9746bda4ad35fa3d3560f0590dabc") {
|
|
488
522
|
for (let $i = 0; $i < 1; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
489
|
-
$[0] = "
|
|
523
|
+
$[0] = "789f01e265d2e58bf61ca53d252b729cbba9746bda4ad35fa3d3560f0590dabc";
|
|
490
524
|
}
|
|
491
525
|
const context = useContext(FileContext);
|
|
492
526
|
if (!context) throw new Error("FileViewer components must be used within FileViewer");
|
|
@@ -495,47 +529,38 @@ const useFile = () => {
|
|
|
495
529
|
//#endregion
|
|
496
530
|
//#region src/components/file/fileViewer/common/ActionsMenu.tsx
|
|
497
531
|
const ActionsMenu = (t0) => {
|
|
498
|
-
const $ = c(
|
|
499
|
-
if ($[0] !== "
|
|
500
|
-
for (let $i = 0; $i <
|
|
501
|
-
$[0] = "
|
|
532
|
+
const $ = c(38);
|
|
533
|
+
if ($[0] !== "7ed2ca73a1b83560ce36924119f722bc2853d54808eacf915e739dac0ddf031e") {
|
|
534
|
+
for (let $i = 0; $i < 38; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
535
|
+
$[0] = "7ed2ca73a1b83560ce36924119f722bc2853d54808eacf915e739dac0ddf031e";
|
|
502
536
|
}
|
|
503
|
-
const { meta,
|
|
537
|
+
const { meta, anchorEl, onClose } = t0;
|
|
504
538
|
const { t } = useTranslation();
|
|
505
539
|
const { fileMetas, onDelete, actions, appName } = useFile();
|
|
506
|
-
const { confirm } = useDialogs();
|
|
540
|
+
const { alert, confirm } = useDialogs();
|
|
507
541
|
let t1;
|
|
508
|
-
if ($[1]
|
|
509
|
-
t1 =
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
$[2] = t1;
|
|
514
|
-
} else t1 = $[2];
|
|
515
|
-
const handleMenuClose = t1;
|
|
542
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
543
|
+
t1 = { from: rootRouteId };
|
|
544
|
+
$[1] = t1;
|
|
545
|
+
} else t1 = $[1];
|
|
546
|
+
const queryClient = useMatch(t1).context.queryClient;
|
|
516
547
|
let t2;
|
|
517
|
-
if ($[
|
|
518
|
-
t2 =
|
|
519
|
-
$[
|
|
520
|
-
} else t2 = $[
|
|
521
|
-
const
|
|
548
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
549
|
+
t2 = downloadFileMutationOptions();
|
|
550
|
+
$[2] = t2;
|
|
551
|
+
} else t2 = $[2];
|
|
552
|
+
const { mutate: download, isPending: isDownloading } = useMutation(t2);
|
|
522
553
|
let t3;
|
|
523
|
-
if ($[
|
|
524
|
-
t3 =
|
|
554
|
+
if ($[3] !== queryClient) {
|
|
555
|
+
t3 = deleteFileMutationOptions({ queryClient });
|
|
556
|
+
$[3] = queryClient;
|
|
525
557
|
$[4] = t3;
|
|
526
558
|
} else t3 = $[4];
|
|
527
|
-
const {
|
|
559
|
+
const { mutateAsync: deleteFile, isPending: isDeleting } = useMutation(t3);
|
|
528
560
|
let t4;
|
|
529
|
-
if ($[5] !==
|
|
530
|
-
t4 =
|
|
531
|
-
|
|
532
|
-
$[6] = t4;
|
|
533
|
-
} else t4 = $[6];
|
|
534
|
-
const { mutate: deleteFile, isPending: isDeleting } = useMutation(t4);
|
|
535
|
-
let t5;
|
|
536
|
-
if ($[7] !== appName || $[8] !== download || $[9] !== handleMenuClose || $[10] !== meta.fileExtension || $[11] !== meta.fileName || $[12] !== meta.id) {
|
|
537
|
-
t5 = () => {
|
|
538
|
-
handleMenuClose();
|
|
561
|
+
if ($[5] !== appName || $[6] !== download || $[7] !== meta.fileExtension || $[8] !== meta.fileName || $[9] !== meta.id || $[10] !== onClose) {
|
|
562
|
+
t4 = () => {
|
|
563
|
+
onClose();
|
|
539
564
|
download({
|
|
540
565
|
id: meta.id,
|
|
541
566
|
appName,
|
|
@@ -543,115 +568,102 @@ const ActionsMenu = (t0) => {
|
|
|
543
568
|
fileExtension: meta.fileExtension
|
|
544
569
|
});
|
|
545
570
|
};
|
|
546
|
-
$[
|
|
547
|
-
$[
|
|
548
|
-
$[
|
|
549
|
-
$[
|
|
550
|
-
$[
|
|
551
|
-
$[
|
|
552
|
-
$[
|
|
553
|
-
} else
|
|
554
|
-
const handleOnDownload =
|
|
555
|
-
let
|
|
556
|
-
if ($[
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
});
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
remainingFileMetas,
|
|
568
|
-
deletedFileMeta: meta
|
|
571
|
+
$[5] = appName;
|
|
572
|
+
$[6] = download;
|
|
573
|
+
$[7] = meta.fileExtension;
|
|
574
|
+
$[8] = meta.fileName;
|
|
575
|
+
$[9] = meta.id;
|
|
576
|
+
$[10] = onClose;
|
|
577
|
+
$[11] = t4;
|
|
578
|
+
} else t4 = $[11];
|
|
579
|
+
const handleOnDownload = t4;
|
|
580
|
+
let t5;
|
|
581
|
+
if ($[12] !== alert || $[13] !== appName || $[14] !== confirm || $[15] !== deleteFile || $[16] !== fileMetas || $[17] !== meta || $[18] !== onClose || $[19] !== onDelete || $[20] !== t) {
|
|
582
|
+
t5 = async () => {
|
|
583
|
+
onClose();
|
|
584
|
+
if (!await confirm(t("Layout.File.AreYouSureYouWantToDelete", { name: meta.fileName }), {
|
|
585
|
+
title: t("Layout.File.Delete"),
|
|
586
|
+
confirmText: t("Layout.File.Delete")
|
|
587
|
+
})) return;
|
|
588
|
+
try {
|
|
589
|
+
await deleteFile({
|
|
590
|
+
id: meta.id,
|
|
591
|
+
appName
|
|
569
592
|
});
|
|
593
|
+
} catch (t6) {
|
|
594
|
+
const error = t6;
|
|
595
|
+
await alert(error instanceof Error ? error.message : String(error));
|
|
596
|
+
return;
|
|
570
597
|
}
|
|
598
|
+
onDelete?.({
|
|
599
|
+
remainingFileMetas: fileMetas.filter((m) => m.id !== meta.id),
|
|
600
|
+
deletedFileMeta: meta
|
|
601
|
+
});
|
|
571
602
|
};
|
|
572
|
-
$[
|
|
573
|
-
$[
|
|
574
|
-
$[
|
|
575
|
-
$[
|
|
576
|
-
$[
|
|
577
|
-
$[
|
|
578
|
-
$[
|
|
579
|
-
$[
|
|
580
|
-
$[
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
const
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
left: menu.mouseX
|
|
589
|
-
};
|
|
590
|
-
$[23] = menu;
|
|
591
|
-
$[24] = t8;
|
|
592
|
-
} else t8 = $[24];
|
|
593
|
-
let t9;
|
|
594
|
-
if ($[25] !== actions?.download || $[26] !== handleOnDownload || $[27] !== isDownloading || $[28] !== t) {
|
|
595
|
-
t9 = actions?.download !== false && /* @__PURE__ */ jsxs(ListItemButton, {
|
|
603
|
+
$[12] = alert;
|
|
604
|
+
$[13] = appName;
|
|
605
|
+
$[14] = confirm;
|
|
606
|
+
$[15] = deleteFile;
|
|
607
|
+
$[16] = fileMetas;
|
|
608
|
+
$[17] = meta;
|
|
609
|
+
$[18] = onClose;
|
|
610
|
+
$[19] = onDelete;
|
|
611
|
+
$[20] = t;
|
|
612
|
+
$[21] = t5;
|
|
613
|
+
} else t5 = $[21];
|
|
614
|
+
const handleOnDelete = t5;
|
|
615
|
+
const t6 = !!anchorEl;
|
|
616
|
+
let t7;
|
|
617
|
+
if ($[22] !== actions?.download || $[23] !== handleOnDownload || $[24] !== isDownloading || $[25] !== t) {
|
|
618
|
+
t7 = actions?.download !== false && /* @__PURE__ */ jsxs(MenuItem, {
|
|
596
619
|
onClick: handleOnDownload,
|
|
597
620
|
disabled: isDownloading,
|
|
598
621
|
children: [/* @__PURE__ */ jsx(ListItemIcon, { children: /* @__PURE__ */ jsx(FileDownload, {}) }), /* @__PURE__ */ jsx(ListItemText, { children: t("Layout.File.Download") })]
|
|
599
622
|
});
|
|
600
|
-
$[
|
|
601
|
-
$[
|
|
602
|
-
$[
|
|
603
|
-
$[
|
|
604
|
-
$[
|
|
605
|
-
} else
|
|
606
|
-
let
|
|
607
|
-
if ($[
|
|
608
|
-
|
|
623
|
+
$[22] = actions?.download;
|
|
624
|
+
$[23] = handleOnDownload;
|
|
625
|
+
$[24] = isDownloading;
|
|
626
|
+
$[25] = t;
|
|
627
|
+
$[26] = t7;
|
|
628
|
+
} else t7 = $[26];
|
|
629
|
+
let t8;
|
|
630
|
+
if ($[27] !== actions?.delete || $[28] !== handleOnDelete || $[29] !== isDeleting || $[30] !== t) {
|
|
631
|
+
t8 = actions?.delete !== false && /* @__PURE__ */ jsxs(MenuItem, {
|
|
609
632
|
onClick: handleOnDelete,
|
|
610
633
|
disabled: isDeleting,
|
|
611
634
|
children: [/* @__PURE__ */ jsx(ListItemIcon, { children: /* @__PURE__ */ jsx(Delete, {}) }), /* @__PURE__ */ jsx(ListItemText, { children: t("Layout.File.Delete") })]
|
|
612
635
|
});
|
|
613
|
-
$[
|
|
614
|
-
$[
|
|
615
|
-
$[
|
|
616
|
-
$[
|
|
617
|
-
$[
|
|
618
|
-
} else
|
|
619
|
-
let
|
|
620
|
-
if ($[35] !==
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
$[36] = t9;
|
|
627
|
-
$[37] = t11;
|
|
628
|
-
} else t11 = $[37];
|
|
629
|
-
let t12;
|
|
630
|
-
if ($[38] !== handleMenuClose || $[39] !== t11 || $[40] !== t7 || $[41] !== t8) {
|
|
631
|
-
t12 = /* @__PURE__ */ jsx(Menu, {
|
|
632
|
-
open: t7,
|
|
633
|
-
onClose: handleMenuClose,
|
|
634
|
-
anchorReference: "anchorPosition",
|
|
635
|
-
variant: "menu",
|
|
636
|
-
anchorPosition: t8,
|
|
637
|
-
children: t11
|
|
636
|
+
$[27] = actions?.delete;
|
|
637
|
+
$[28] = handleOnDelete;
|
|
638
|
+
$[29] = isDeleting;
|
|
639
|
+
$[30] = t;
|
|
640
|
+
$[31] = t8;
|
|
641
|
+
} else t8 = $[31];
|
|
642
|
+
let t9;
|
|
643
|
+
if ($[32] !== anchorEl || $[33] !== onClose || $[34] !== t6 || $[35] !== t7 || $[36] !== t8) {
|
|
644
|
+
t9 = /* @__PURE__ */ jsxs(Menu, {
|
|
645
|
+
anchorEl,
|
|
646
|
+
open: t6,
|
|
647
|
+
onClose,
|
|
648
|
+
children: [t7, t8]
|
|
638
649
|
});
|
|
639
|
-
$[
|
|
640
|
-
$[
|
|
641
|
-
$[
|
|
642
|
-
$[
|
|
643
|
-
$[
|
|
644
|
-
|
|
645
|
-
|
|
650
|
+
$[32] = anchorEl;
|
|
651
|
+
$[33] = onClose;
|
|
652
|
+
$[34] = t6;
|
|
653
|
+
$[35] = t7;
|
|
654
|
+
$[36] = t8;
|
|
655
|
+
$[37] = t9;
|
|
656
|
+
} else t9 = $[37];
|
|
657
|
+
return t9;
|
|
646
658
|
};
|
|
647
659
|
//#endregion
|
|
648
660
|
//#region src/components/file/fileViewer/FileViewerGrid.tsx
|
|
649
661
|
const IMAGE_SIZE = 150;
|
|
650
662
|
const FileViewerGrid = (t0) => {
|
|
651
663
|
const $ = c(13);
|
|
652
|
-
if ($[0] !== "
|
|
664
|
+
if ($[0] !== "0b6106e2d976834ad6da1be7ac64269b20131a7e8bed012e78cb98b5ae12e94c") {
|
|
653
665
|
for (let $i = 0; $i < 13; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
654
|
-
$[0] = "
|
|
666
|
+
$[0] = "0b6106e2d976834ad6da1be7ac64269b20131a7e8bed012e78cb98b5ae12e94c";
|
|
655
667
|
}
|
|
656
668
|
const { sx, size, itemBar } = t0;
|
|
657
669
|
const { fileMetas } = useFile();
|
|
@@ -699,14 +711,16 @@ const FileViewerGrid = (t0) => {
|
|
|
699
711
|
};
|
|
700
712
|
const GridFileViewerItem = ({ meta, size, itemBar }) => {
|
|
701
713
|
const { setImageId, actions, appName } = useFile();
|
|
702
|
-
const [
|
|
703
|
-
const [
|
|
714
|
+
const [hovered, setHovered] = useState(false);
|
|
715
|
+
const [focused, setFocused] = useState(false);
|
|
716
|
+
const [menuAnchor, setMenuAnchor] = useState(null);
|
|
704
717
|
const { ref, inView } = useInView();
|
|
705
718
|
const queryClient = useQueryClient();
|
|
706
719
|
const target = useRef(null);
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
720
|
+
const side = size ?? IMAGE_SIZE;
|
|
721
|
+
const fileName = `${meta.fileName}.${meta.fileExtension}`;
|
|
722
|
+
const hasActions = actions?.download !== false || actions.delete !== false;
|
|
723
|
+
const showItemBar = itemBar === "always" || itemBar !== "hidden" && (hovered || focused || !!menuAnchor);
|
|
710
724
|
const { data: source, isPending } = useQuery({
|
|
711
725
|
...fileThumbnailQueryOptions({
|
|
712
726
|
id: meta.id,
|
|
@@ -714,17 +728,12 @@ const GridFileViewerItem = ({ meta, size, itemBar }) => {
|
|
|
714
728
|
}),
|
|
715
729
|
enabled: inView
|
|
716
730
|
});
|
|
717
|
-
const handleOnMouseEnter = () => setShowItemBar(true);
|
|
718
|
-
const handleOnMouseLeave = () => itemBar !== "always" && setShowItemBar(false);
|
|
719
|
-
const openMenu = (event) => {
|
|
720
|
-
setMenu(menu === null ? {
|
|
721
|
-
mouseX: event.clientX,
|
|
722
|
-
mouseY: event.clientY
|
|
723
|
-
} : null);
|
|
724
|
-
setTimeout(() => setShowItemBar(true));
|
|
725
|
-
};
|
|
726
731
|
const { mutate: openFile } = useMutation(openFileMutationOptions({ target }));
|
|
727
732
|
const { mutate: download } = useMutation(downloadFileMutationOptions());
|
|
733
|
+
const prefetch = () => queryClient.prefetchQuery(fileQueryOptions({
|
|
734
|
+
id: meta.id,
|
|
735
|
+
appName
|
|
736
|
+
}));
|
|
728
737
|
const onClick = () => {
|
|
729
738
|
switch (meta.mediaType) {
|
|
730
739
|
case "image": return setImageId(meta.id);
|
|
@@ -745,63 +754,77 @@ const GridFileViewerItem = ({ meta, size, itemBar }) => {
|
|
|
745
754
|
};
|
|
746
755
|
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(ImageListItem, {
|
|
747
756
|
sx: {
|
|
748
|
-
width:
|
|
749
|
-
height:
|
|
757
|
+
width: side,
|
|
758
|
+
height: side
|
|
759
|
+
},
|
|
760
|
+
onMouseEnter: () => setHovered(true),
|
|
761
|
+
onMouseLeave: () => setHovered(false),
|
|
762
|
+
onFocus: () => setFocused(true),
|
|
763
|
+
onBlur: (event) => {
|
|
764
|
+
if (!event.currentTarget.contains(event.relatedTarget)) setFocused(false);
|
|
750
765
|
},
|
|
751
|
-
onMouseEnter: handleOnMouseEnter,
|
|
752
|
-
onMouseLeave: handleOnMouseLeave,
|
|
753
766
|
ref,
|
|
754
767
|
children: [isPending ? /* @__PURE__ */ jsx(Skeleton, {
|
|
755
768
|
variant: "rectangular",
|
|
756
|
-
width:
|
|
757
|
-
height:
|
|
758
|
-
}) : /* @__PURE__ */ jsx(
|
|
759
|
-
component: "img",
|
|
760
|
-
src: source,
|
|
761
|
-
loading: "lazy",
|
|
762
|
-
alt: "thumbnail-" + meta.id,
|
|
769
|
+
width: side,
|
|
770
|
+
height: side
|
|
771
|
+
}) : /* @__PURE__ */ jsx(ButtonBase, {
|
|
763
772
|
onClick,
|
|
764
|
-
onMouseEnter:
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
})),
|
|
773
|
+
onMouseEnter: prefetch,
|
|
774
|
+
onFocus: prefetch,
|
|
775
|
+
"aria-label": `Open ${fileName}`,
|
|
768
776
|
sx: {
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
777
|
+
width: side,
|
|
778
|
+
height: side,
|
|
779
|
+
"&.Mui-focusVisible": {
|
|
780
|
+
outline: "2px solid",
|
|
781
|
+
outlineColor: "primary.main",
|
|
782
|
+
outlineOffset: -2
|
|
783
|
+
}
|
|
784
|
+
},
|
|
785
|
+
children: /* @__PURE__ */ jsx(Box, {
|
|
786
|
+
component: "img",
|
|
787
|
+
src: source,
|
|
788
|
+
loading: "lazy",
|
|
789
|
+
alt: "",
|
|
790
|
+
sx: {
|
|
791
|
+
objectFit: "contain",
|
|
792
|
+
width: side,
|
|
793
|
+
height: side
|
|
794
|
+
}
|
|
795
|
+
})
|
|
796
|
+
}), showItemBar && /* @__PURE__ */ jsx(ImageListItemBar, {
|
|
775
797
|
title: /* @__PURE__ */ jsx(Tooltip, {
|
|
776
|
-
title:
|
|
798
|
+
title: fileName,
|
|
777
799
|
children: /* @__PURE__ */ jsx(Box, { children: meta.fileName })
|
|
778
800
|
}),
|
|
779
|
-
actionIcon:
|
|
801
|
+
actionIcon: hasActions && /* @__PURE__ */ jsx(IconButton, {
|
|
780
802
|
sx: { color: grey[100] },
|
|
781
|
-
onClick:
|
|
782
|
-
"aria-label":
|
|
803
|
+
onClick: (event_0) => setMenuAnchor(event_0.currentTarget),
|
|
804
|
+
"aria-label": `Actions for ${fileName}`,
|
|
805
|
+
"aria-haspopup": "menu",
|
|
783
806
|
children: /* @__PURE__ */ jsx(MoreVert, {})
|
|
784
807
|
})
|
|
785
808
|
})]
|
|
786
|
-
}),
|
|
809
|
+
}), hasActions && /* @__PURE__ */ jsx(ActionsMenu, {
|
|
787
810
|
meta,
|
|
788
|
-
|
|
789
|
-
|
|
811
|
+
anchorEl: menuAnchor,
|
|
812
|
+
onClose: () => setMenuAnchor(null)
|
|
790
813
|
})] });
|
|
791
814
|
};
|
|
792
815
|
//#endregion
|
|
793
816
|
//#region src/components/file/fileViewer/FileViewerList.tsx
|
|
794
817
|
const FileViewerList = (t0) => {
|
|
795
818
|
const $ = c(6);
|
|
796
|
-
if ($[0] !== "
|
|
819
|
+
if ($[0] !== "def12bfee125db96c0e25478a726cf153aa928252368ec27de2bcba8f364adae") {
|
|
797
820
|
for (let $i = 0; $i < 6; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
798
|
-
$[0] = "
|
|
821
|
+
$[0] = "def12bfee125db96c0e25478a726cf153aa928252368ec27de2bcba8f364adae";
|
|
799
822
|
}
|
|
800
823
|
const { sx } = t0;
|
|
801
824
|
const { fileMetas } = useFile();
|
|
802
825
|
let t1;
|
|
803
826
|
if ($[1] !== fileMetas) {
|
|
804
|
-
t1 = fileMetas.map(_temp);
|
|
827
|
+
t1 = fileMetas.map(_temp$1);
|
|
805
828
|
$[1] = fileMetas;
|
|
806
829
|
$[2] = t1;
|
|
807
830
|
} else t1 = $[2];
|
|
@@ -820,16 +843,11 @@ const FileViewerList = (t0) => {
|
|
|
820
843
|
};
|
|
821
844
|
const ListFileViewerItem = ({ meta }) => {
|
|
822
845
|
const { setImageId, actions, appName } = useFile();
|
|
823
|
-
const [
|
|
846
|
+
const [menuAnchor, setMenuAnchor] = useState(null);
|
|
824
847
|
const queryClient = useQueryClient();
|
|
825
848
|
const target = useRef(null);
|
|
826
|
-
const
|
|
827
|
-
|
|
828
|
-
setMenu(menu === null ? {
|
|
829
|
-
mouseX: event.clientX,
|
|
830
|
-
mouseY: event.clientY
|
|
831
|
-
} : null);
|
|
832
|
-
};
|
|
849
|
+
const fileName = `${meta.fileName}.${meta.fileExtension}`;
|
|
850
|
+
const hasActions = actions?.download !== false || actions.delete !== false;
|
|
833
851
|
const { mutate: openFile } = useMutation(openFileMutationOptions({ target }));
|
|
834
852
|
const { mutate: download } = useMutation(downloadFileMutationOptions());
|
|
835
853
|
const onClick = () => {
|
|
@@ -857,80 +875,173 @@ const ListFileViewerItem = ({ meta }) => {
|
|
|
857
875
|
default: return /* @__PURE__ */ jsx(AttachFile, {});
|
|
858
876
|
}
|
|
859
877
|
};
|
|
860
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
/* @__PURE__ */ jsx(
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
})
|
|
875
|
-
|
|
876
|
-
|
|
878
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ListItem, {
|
|
879
|
+
disablePadding: true,
|
|
880
|
+
secondaryAction: hasActions && /* @__PURE__ */ jsx(IconButton, {
|
|
881
|
+
edge: "end",
|
|
882
|
+
onClick: (event) => setMenuAnchor(event.currentTarget),
|
|
883
|
+
"aria-label": `Actions for ${fileName}`,
|
|
884
|
+
"aria-haspopup": "menu",
|
|
885
|
+
children: /* @__PURE__ */ jsx(MoreVert, {})
|
|
886
|
+
}),
|
|
887
|
+
children: /* @__PURE__ */ jsxs(ListItemButton, {
|
|
888
|
+
onClick,
|
|
889
|
+
onMouseEnter: () => queryClient.prefetchQuery(fileQueryOptions({
|
|
890
|
+
id: meta.id,
|
|
891
|
+
appName
|
|
892
|
+
})),
|
|
893
|
+
children: [/* @__PURE__ */ jsx(ListItemIcon, { children: icon() }), /* @__PURE__ */ jsx(ListItemText, { primary: fileName })]
|
|
894
|
+
})
|
|
895
|
+
}), hasActions && /* @__PURE__ */ jsx(ActionsMenu, {
|
|
877
896
|
meta,
|
|
878
|
-
|
|
879
|
-
|
|
897
|
+
anchorEl: menuAnchor,
|
|
898
|
+
onClose: () => setMenuAnchor(null)
|
|
880
899
|
})] });
|
|
881
900
|
};
|
|
882
|
-
function _temp(fileMeta) {
|
|
901
|
+
function _temp$1(fileMeta) {
|
|
883
902
|
return /* @__PURE__ */ jsx(ListFileViewerItem, { meta: fileMeta }, fileMeta.id);
|
|
884
903
|
}
|
|
885
904
|
//#endregion
|
|
886
905
|
//#region src/components/file/fileViewer/ImageViewer.tsx
|
|
887
|
-
const ImageViewer = (
|
|
906
|
+
const ImageViewer = (t0) => {
|
|
907
|
+
const $ = c(56);
|
|
908
|
+
if ($[0] !== "c362b5d42dedaecf837e96525daab6341b34e31726fb1413e37d4a5eb8122071") {
|
|
909
|
+
for (let $i = 0; $i < 56; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
910
|
+
$[0] = "c362b5d42dedaecf837e96525daab6341b34e31726fb1413e37d4a5eb8122071";
|
|
911
|
+
}
|
|
912
|
+
const { metaId } = t0;
|
|
888
913
|
const { fileMetas, setImageId, appName } = useFile();
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
914
|
+
let meta;
|
|
915
|
+
let next;
|
|
916
|
+
let previous;
|
|
917
|
+
let t1;
|
|
918
|
+
let t2;
|
|
919
|
+
if ($[1] !== appName || $[2] !== fileMetas || $[3] !== metaId) {
|
|
920
|
+
let t3;
|
|
921
|
+
if ($[9] !== metaId) {
|
|
922
|
+
t3 = (m) => m.id === metaId;
|
|
923
|
+
$[9] = metaId;
|
|
924
|
+
$[10] = t3;
|
|
925
|
+
} else t3 = $[10];
|
|
926
|
+
meta = fileMetas.find(t3);
|
|
927
|
+
let images;
|
|
928
|
+
let t4;
|
|
929
|
+
if ($[11] !== fileMetas || $[12] !== metaId) {
|
|
930
|
+
images = fileMetas.filter(_temp);
|
|
931
|
+
let t5;
|
|
932
|
+
if ($[15] !== metaId) {
|
|
933
|
+
t5 = (m_1) => m_1.id === metaId;
|
|
934
|
+
$[15] = metaId;
|
|
935
|
+
$[16] = t5;
|
|
936
|
+
} else t5 = $[16];
|
|
937
|
+
t4 = images.findIndex(t5);
|
|
938
|
+
$[11] = fileMetas;
|
|
939
|
+
$[12] = metaId;
|
|
940
|
+
$[13] = images;
|
|
941
|
+
$[14] = t4;
|
|
942
|
+
} else {
|
|
943
|
+
images = $[13];
|
|
944
|
+
t4 = $[14];
|
|
945
|
+
}
|
|
946
|
+
const index = t4;
|
|
947
|
+
previous = index > 0 ? images[index - 1] : void 0;
|
|
948
|
+
next = index >= 0 && index < images.length - 1 ? images[index + 1] : void 0;
|
|
949
|
+
t2 = useQuery;
|
|
950
|
+
t1 = fileQueryOptions({
|
|
892
951
|
id: meta?.id ?? "",
|
|
893
952
|
appName
|
|
894
|
-
})
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
953
|
+
});
|
|
954
|
+
$[1] = appName;
|
|
955
|
+
$[2] = fileMetas;
|
|
956
|
+
$[3] = metaId;
|
|
957
|
+
$[4] = meta;
|
|
958
|
+
$[5] = next;
|
|
959
|
+
$[6] = previous;
|
|
960
|
+
$[7] = t1;
|
|
961
|
+
$[8] = t2;
|
|
962
|
+
} else {
|
|
963
|
+
meta = $[4];
|
|
964
|
+
next = $[5];
|
|
965
|
+
previous = $[6];
|
|
966
|
+
t1 = $[7];
|
|
967
|
+
t2 = $[8];
|
|
968
|
+
}
|
|
969
|
+
const t3 = !!meta;
|
|
970
|
+
let t4;
|
|
971
|
+
if ($[17] !== t1 || $[18] !== t3) {
|
|
972
|
+
t4 = {
|
|
973
|
+
...t1,
|
|
974
|
+
enabled: t3
|
|
901
975
|
};
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
976
|
+
$[17] = t1;
|
|
977
|
+
$[18] = t3;
|
|
978
|
+
$[19] = t4;
|
|
979
|
+
} else t4 = $[19];
|
|
980
|
+
const { data: source, isPending } = t2(t4);
|
|
981
|
+
let t5;
|
|
982
|
+
if ($[20] !== setImageId) {
|
|
983
|
+
t5 = () => setImageId("");
|
|
984
|
+
$[20] = setImageId;
|
|
985
|
+
$[21] = t5;
|
|
986
|
+
} else t5 = $[21];
|
|
987
|
+
const onClose = t5;
|
|
988
|
+
let t6;
|
|
989
|
+
if ($[22] !== metaId || $[23] !== next || $[24] !== onClose || $[25] !== previous || $[26] !== setImageId) {
|
|
990
|
+
t6 = () => {
|
|
991
|
+
if (!metaId) return;
|
|
992
|
+
const handleOnKeydown = (event) => {
|
|
993
|
+
switch (event.key) {
|
|
994
|
+
case "ArrowLeft": return previous && setImageId(previous.id);
|
|
995
|
+
case "ArrowRight": return next && setImageId(next.id);
|
|
996
|
+
case "Backspace":
|
|
997
|
+
case "Escape":
|
|
998
|
+
event.preventDefault();
|
|
999
|
+
return onClose();
|
|
1000
|
+
}
|
|
1001
|
+
};
|
|
1002
|
+
globalThis.addEventListener("keydown", handleOnKeydown);
|
|
1003
|
+
return () => globalThis.removeEventListener("keydown", handleOnKeydown);
|
|
1004
|
+
};
|
|
1005
|
+
$[22] = metaId;
|
|
1006
|
+
$[23] = next;
|
|
1007
|
+
$[24] = onClose;
|
|
1008
|
+
$[25] = previous;
|
|
1009
|
+
$[26] = setImageId;
|
|
1010
|
+
$[27] = t6;
|
|
1011
|
+
} else t6 = $[27];
|
|
1012
|
+
let t7;
|
|
1013
|
+
if ($[28] !== metaId || $[29] !== next || $[30] !== previous) {
|
|
1014
|
+
t7 = [
|
|
1015
|
+
metaId,
|
|
1016
|
+
previous,
|
|
1017
|
+
next
|
|
1018
|
+
];
|
|
1019
|
+
$[28] = metaId;
|
|
1020
|
+
$[29] = next;
|
|
1021
|
+
$[30] = previous;
|
|
1022
|
+
$[31] = t7;
|
|
1023
|
+
} else t7 = $[31];
|
|
1024
|
+
useEffect(t6, t7);
|
|
928
1025
|
if (!meta) return null;
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
1026
|
+
let t8;
|
|
1027
|
+
if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1028
|
+
t8 = {
|
|
1029
|
+
position: "fixed",
|
|
1030
|
+
top: "50%",
|
|
1031
|
+
transform: "translateY(-50%)"
|
|
1032
|
+
};
|
|
1033
|
+
$[32] = t8;
|
|
1034
|
+
} else t8 = $[32];
|
|
1035
|
+
const navSx = t8;
|
|
1036
|
+
let t9;
|
|
1037
|
+
if ($[33] !== meta.fileName) {
|
|
1038
|
+
t9 = { paper: { "aria-label": meta.fileName } };
|
|
1039
|
+
$[33] = meta.fileName;
|
|
1040
|
+
$[34] = t9;
|
|
1041
|
+
} else t9 = $[34];
|
|
1042
|
+
let t10;
|
|
1043
|
+
if ($[35] !== isPending || $[36] !== meta.fileName || $[37] !== source) {
|
|
1044
|
+
t10 = isPending ? /* @__PURE__ */ jsx(Skeleton, {
|
|
934
1045
|
variant: "rectangular",
|
|
935
1046
|
sx: {
|
|
936
1047
|
width: {
|
|
@@ -953,26 +1064,105 @@ const ImageViewer = ({ metaId }) => {
|
|
|
953
1064
|
sm: "calc(100vh - 64px)"
|
|
954
1065
|
}
|
|
955
1066
|
}
|
|
956
|
-
})
|
|
1067
|
+
});
|
|
1068
|
+
$[35] = isPending;
|
|
1069
|
+
$[36] = meta.fileName;
|
|
1070
|
+
$[37] = source;
|
|
1071
|
+
$[38] = t10;
|
|
1072
|
+
} else t10 = $[38];
|
|
1073
|
+
let t11;
|
|
1074
|
+
if ($[39] !== previous || $[40] !== setImageId) {
|
|
1075
|
+
t11 = previous && /* @__PURE__ */ jsx(Fab, {
|
|
957
1076
|
size: "medium",
|
|
958
|
-
onClick:
|
|
959
|
-
"aria-label": "
|
|
1077
|
+
onClick: () => setImageId(previous.id),
|
|
1078
|
+
"aria-label": "Previous",
|
|
1079
|
+
sx: {
|
|
1080
|
+
...navSx,
|
|
1081
|
+
left: 8
|
|
1082
|
+
},
|
|
1083
|
+
children: /* @__PURE__ */ jsx(ChevronLeft, {})
|
|
1084
|
+
});
|
|
1085
|
+
$[39] = previous;
|
|
1086
|
+
$[40] = setImageId;
|
|
1087
|
+
$[41] = t11;
|
|
1088
|
+
} else t11 = $[41];
|
|
1089
|
+
let t12;
|
|
1090
|
+
if ($[42] !== next || $[43] !== setImageId) {
|
|
1091
|
+
t12 = next && /* @__PURE__ */ jsx(Fab, {
|
|
1092
|
+
size: "medium",
|
|
1093
|
+
onClick: () => setImageId(next.id),
|
|
1094
|
+
"aria-label": "Next",
|
|
960
1095
|
sx: {
|
|
961
|
-
|
|
962
|
-
top: 8,
|
|
1096
|
+
...navSx,
|
|
963
1097
|
right: 8
|
|
964
1098
|
},
|
|
965
|
-
children: /* @__PURE__ */ jsx(
|
|
966
|
-
})
|
|
967
|
-
|
|
1099
|
+
children: /* @__PURE__ */ jsx(ChevronRight, {})
|
|
1100
|
+
});
|
|
1101
|
+
$[42] = next;
|
|
1102
|
+
$[43] = setImageId;
|
|
1103
|
+
$[44] = t12;
|
|
1104
|
+
} else t12 = $[44];
|
|
1105
|
+
let t13;
|
|
1106
|
+
let t14;
|
|
1107
|
+
if ($[45] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1108
|
+
t13 = {
|
|
1109
|
+
position: "fixed",
|
|
1110
|
+
top: 8,
|
|
1111
|
+
right: 8
|
|
1112
|
+
};
|
|
1113
|
+
t14 = /* @__PURE__ */ jsx(Close, {});
|
|
1114
|
+
$[45] = t13;
|
|
1115
|
+
$[46] = t14;
|
|
1116
|
+
} else {
|
|
1117
|
+
t13 = $[45];
|
|
1118
|
+
t14 = $[46];
|
|
1119
|
+
}
|
|
1120
|
+
let t15;
|
|
1121
|
+
if ($[47] !== onClose) {
|
|
1122
|
+
t15 = /* @__PURE__ */ jsx(Fab, {
|
|
1123
|
+
size: "medium",
|
|
1124
|
+
onClick: onClose,
|
|
1125
|
+
"aria-label": "Close",
|
|
1126
|
+
sx: t13,
|
|
1127
|
+
children: t14
|
|
1128
|
+
});
|
|
1129
|
+
$[47] = onClose;
|
|
1130
|
+
$[48] = t15;
|
|
1131
|
+
} else t15 = $[48];
|
|
1132
|
+
let t16;
|
|
1133
|
+
if ($[49] !== onClose || $[50] !== t10 || $[51] !== t11 || $[52] !== t12 || $[53] !== t15 || $[54] !== t9) {
|
|
1134
|
+
t16 = /* @__PURE__ */ jsxs(Dialog, {
|
|
1135
|
+
open: true,
|
|
1136
|
+
onClose,
|
|
1137
|
+
maxWidth: "xl",
|
|
1138
|
+
slotProps: t9,
|
|
1139
|
+
children: [
|
|
1140
|
+
t10,
|
|
1141
|
+
t11,
|
|
1142
|
+
t12,
|
|
1143
|
+
t15
|
|
1144
|
+
]
|
|
1145
|
+
});
|
|
1146
|
+
$[49] = onClose;
|
|
1147
|
+
$[50] = t10;
|
|
1148
|
+
$[51] = t11;
|
|
1149
|
+
$[52] = t12;
|
|
1150
|
+
$[53] = t15;
|
|
1151
|
+
$[54] = t9;
|
|
1152
|
+
$[55] = t16;
|
|
1153
|
+
} else t16 = $[55];
|
|
1154
|
+
return t16;
|
|
968
1155
|
};
|
|
1156
|
+
function _temp(m_0) {
|
|
1157
|
+
return m_0.mediaType === "image";
|
|
1158
|
+
}
|
|
969
1159
|
//#endregion
|
|
970
1160
|
//#region src/components/file/FileViewer.tsx
|
|
971
1161
|
const FileViewer = (t0) => {
|
|
972
1162
|
const $ = c(22);
|
|
973
|
-
if ($[0] !== "
|
|
1163
|
+
if ($[0] !== "e56cccf59021ad4f268b0fa9c3b1b47aaffd2cf82021d791cbb7aecbc2510344") {
|
|
974
1164
|
for (let $i = 0; $i < 22; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
975
|
-
$[0] = "
|
|
1165
|
+
$[0] = "e56cccf59021ad4f268b0fa9c3b1b47aaffd2cf82021d791cbb7aecbc2510344";
|
|
976
1166
|
}
|
|
977
1167
|
const { appName, subId, onDelete, actions, children } = t0;
|
|
978
1168
|
let t1;
|
|
@@ -1053,9 +1243,9 @@ const FileViewer = (t0) => {
|
|
|
1053
1243
|
//#region src/components/router/RouterButton.tsx
|
|
1054
1244
|
const Component$3 = React.forwardRef(function ButtonComponent(props, reference) {
|
|
1055
1245
|
const $ = c(4);
|
|
1056
|
-
if ($[0] !== "
|
|
1246
|
+
if ($[0] !== "ce85b5435705cac1e74b4bbb9839fb623c97b9aa12295be401d5963375a1aa3e") {
|
|
1057
1247
|
for (let $i = 0; $i < 4; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1058
|
-
$[0] = "
|
|
1248
|
+
$[0] = "ce85b5435705cac1e74b4bbb9839fb623c97b9aa12295be401d5963375a1aa3e";
|
|
1059
1249
|
}
|
|
1060
1250
|
let t0;
|
|
1061
1251
|
if ($[1] !== props || $[2] !== reference) {
|
|
@@ -1073,9 +1263,9 @@ const Component$3 = React.forwardRef(function ButtonComponent(props, reference)
|
|
|
1073
1263
|
const CreatedComponent$3 = createLink(Component$3);
|
|
1074
1264
|
const RouterButton = (props) => {
|
|
1075
1265
|
const $ = c(3);
|
|
1076
|
-
if ($[0] !== "
|
|
1266
|
+
if ($[0] !== "ce85b5435705cac1e74b4bbb9839fb623c97b9aa12295be401d5963375a1aa3e") {
|
|
1077
1267
|
for (let $i = 0; $i < 3; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1078
|
-
$[0] = "
|
|
1268
|
+
$[0] = "ce85b5435705cac1e74b4bbb9839fb623c97b9aa12295be401d5963375a1aa3e";
|
|
1079
1269
|
}
|
|
1080
1270
|
let t0;
|
|
1081
1271
|
if ($[1] !== props) {
|
|
@@ -1089,9 +1279,9 @@ const RouterButton = (props) => {
|
|
|
1089
1279
|
//#region src/components/router/RouterFab.tsx
|
|
1090
1280
|
const Component$2 = React.forwardRef(function FabComponent(props, reference) {
|
|
1091
1281
|
const $ = c(4);
|
|
1092
|
-
if ($[0] !== "
|
|
1282
|
+
if ($[0] !== "6f7f03127143ce33544b1f7ed2f2e082f960805a44e6bd02a96e540a88381da3") {
|
|
1093
1283
|
for (let $i = 0; $i < 4; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1094
|
-
$[0] = "
|
|
1284
|
+
$[0] = "6f7f03127143ce33544b1f7ed2f2e082f960805a44e6bd02a96e540a88381da3";
|
|
1095
1285
|
}
|
|
1096
1286
|
let t0;
|
|
1097
1287
|
if ($[1] !== props || $[2] !== reference) {
|
|
@@ -1109,9 +1299,9 @@ const Component$2 = React.forwardRef(function FabComponent(props, reference) {
|
|
|
1109
1299
|
const CreatedComponent$2 = createLink(Component$2);
|
|
1110
1300
|
const RouterFab = (props) => {
|
|
1111
1301
|
const $ = c(3);
|
|
1112
|
-
if ($[0] !== "
|
|
1302
|
+
if ($[0] !== "6f7f03127143ce33544b1f7ed2f2e082f960805a44e6bd02a96e540a88381da3") {
|
|
1113
1303
|
for (let $i = 0; $i < 3; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1114
|
-
$[0] = "
|
|
1304
|
+
$[0] = "6f7f03127143ce33544b1f7ed2f2e082f960805a44e6bd02a96e540a88381da3";
|
|
1115
1305
|
}
|
|
1116
1306
|
let t0;
|
|
1117
1307
|
if ($[1] !== props) {
|
|
@@ -1125,9 +1315,9 @@ const RouterFab = (props) => {
|
|
|
1125
1315
|
//#region src/components/router/RouterLink.tsx
|
|
1126
1316
|
const Component$1 = React.forwardRef(function LinkComponent(props, reference) {
|
|
1127
1317
|
const $ = c(4);
|
|
1128
|
-
if ($[0] !== "
|
|
1318
|
+
if ($[0] !== "0988b007ba1c512b38183cce57f8ffd0c7a8514561ed3c9b853a66e7d9eef38d") {
|
|
1129
1319
|
for (let $i = 0; $i < 4; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1130
|
-
$[0] = "
|
|
1320
|
+
$[0] = "0988b007ba1c512b38183cce57f8ffd0c7a8514561ed3c9b853a66e7d9eef38d";
|
|
1131
1321
|
}
|
|
1132
1322
|
let t0;
|
|
1133
1323
|
if ($[1] !== props || $[2] !== reference) {
|
|
@@ -1144,9 +1334,9 @@ const Component$1 = React.forwardRef(function LinkComponent(props, reference) {
|
|
|
1144
1334
|
const CreatedComponent$1 = createLink(Component$1);
|
|
1145
1335
|
const RouterLink = (props) => {
|
|
1146
1336
|
const $ = c(3);
|
|
1147
|
-
if ($[0] !== "
|
|
1337
|
+
if ($[0] !== "0988b007ba1c512b38183cce57f8ffd0c7a8514561ed3c9b853a66e7d9eef38d") {
|
|
1148
1338
|
for (let $i = 0; $i < 3; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1149
|
-
$[0] = "
|
|
1339
|
+
$[0] = "0988b007ba1c512b38183cce57f8ffd0c7a8514561ed3c9b853a66e7d9eef38d";
|
|
1150
1340
|
}
|
|
1151
1341
|
let t0;
|
|
1152
1342
|
if ($[1] !== props) {
|
|
@@ -1160,9 +1350,9 @@ const RouterLink = (props) => {
|
|
|
1160
1350
|
//#region src/components/router/RouterTab.tsx
|
|
1161
1351
|
const Component = React.forwardRef(function TabComponent(props, reference) {
|
|
1162
1352
|
const $ = c(4);
|
|
1163
|
-
if ($[0] !== "
|
|
1353
|
+
if ($[0] !== "3aca1efbae3f7743b7a2945ef0bc3292071fc593047012a71c96ab1498e62816") {
|
|
1164
1354
|
for (let $i = 0; $i < 4; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1165
|
-
$[0] = "
|
|
1355
|
+
$[0] = "3aca1efbae3f7743b7a2945ef0bc3292071fc593047012a71c96ab1498e62816";
|
|
1166
1356
|
}
|
|
1167
1357
|
let t0;
|
|
1168
1358
|
if ($[1] !== props || $[2] !== reference) {
|
|
@@ -1180,9 +1370,9 @@ const Component = React.forwardRef(function TabComponent(props, reference) {
|
|
|
1180
1370
|
const CreatedComponent = createLink(Component);
|
|
1181
1371
|
const RouterTab = (props) => {
|
|
1182
1372
|
const $ = c(3);
|
|
1183
|
-
if ($[0] !== "
|
|
1373
|
+
if ($[0] !== "3aca1efbae3f7743b7a2945ef0bc3292071fc593047012a71c96ab1498e62816") {
|
|
1184
1374
|
for (let $i = 0; $i < 3; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1185
|
-
$[0] = "
|
|
1375
|
+
$[0] = "3aca1efbae3f7743b7a2945ef0bc3292071fc593047012a71c96ab1498e62816";
|
|
1186
1376
|
}
|
|
1187
1377
|
let t0;
|
|
1188
1378
|
if ($[1] !== props) {
|
|
@@ -1196,9 +1386,9 @@ const RouterTab = (props) => {
|
|
|
1196
1386
|
//#region src/components/router/RouterNotFound.tsx
|
|
1197
1387
|
function RouterNotFound() {
|
|
1198
1388
|
const $ = c(9);
|
|
1199
|
-
if ($[0] !== "
|
|
1389
|
+
if ($[0] !== "b85bee0f4f29e1fb858e96e13dc2fcbb04a6bbd08c5b88b6d4df66a8869ddb03") {
|
|
1200
1390
|
for (let $i = 0; $i < 9; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1201
|
-
$[0] = "
|
|
1391
|
+
$[0] = "b85bee0f4f29e1fb858e96e13dc2fcbb04a6bbd08c5b88b6d4df66a8869ddb03";
|
|
1202
1392
|
}
|
|
1203
1393
|
const { t } = useTranslation();
|
|
1204
1394
|
let t0;
|
|
@@ -1215,6 +1405,7 @@ function RouterNotFound() {
|
|
|
1215
1405
|
t1 = {
|
|
1216
1406
|
display: "flex",
|
|
1217
1407
|
alignItems: "center",
|
|
1408
|
+
m: 0,
|
|
1218
1409
|
mb: 4
|
|
1219
1410
|
};
|
|
1220
1411
|
$[2] = t1;
|
|
@@ -1235,6 +1426,8 @@ function RouterNotFound() {
|
|
|
1235
1426
|
let t3;
|
|
1236
1427
|
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1237
1428
|
t3 = /* @__PURE__ */ jsx(Divider, {
|
|
1429
|
+
component: "span",
|
|
1430
|
+
role: "presentation",
|
|
1238
1431
|
orientation: "vertical",
|
|
1239
1432
|
flexItem: true,
|
|
1240
1433
|
sx: { mx: 3 }
|
|
@@ -1252,6 +1445,7 @@ function RouterNotFound() {
|
|
|
1252
1445
|
t5 = /* @__PURE__ */ jsx(Fullscreen, {
|
|
1253
1446
|
sx: t0,
|
|
1254
1447
|
children: /* @__PURE__ */ jsxs(Box, {
|
|
1448
|
+
component: "h1",
|
|
1255
1449
|
sx: t1,
|
|
1256
1450
|
children: [
|
|
1257
1451
|
t2,
|
|
@@ -1273,9 +1467,9 @@ function RouterNotFound() {
|
|
|
1273
1467
|
//#region src/components/router/RouterError.tsx
|
|
1274
1468
|
const RouterError = (t0) => {
|
|
1275
1469
|
const $ = c(12);
|
|
1276
|
-
if ($[0] !== "
|
|
1470
|
+
if ($[0] !== "99b46ee567229b93d88dd5dde9a07d2a370c1710d4e834f04c33ae486b9ec8a5") {
|
|
1277
1471
|
for (let $i = 0; $i < 12; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1278
|
-
$[0] = "
|
|
1472
|
+
$[0] = "99b46ee567229b93d88dd5dde9a07d2a370c1710d4e834f04c33ae486b9ec8a5";
|
|
1279
1473
|
}
|
|
1280
1474
|
const { error } = t0;
|
|
1281
1475
|
const isError = error instanceof Error;
|
|
@@ -1293,6 +1487,7 @@ const RouterError = (t0) => {
|
|
|
1293
1487
|
t2 = {
|
|
1294
1488
|
display: "flex",
|
|
1295
1489
|
alignItems: "center",
|
|
1490
|
+
m: 0,
|
|
1296
1491
|
mb: 4
|
|
1297
1492
|
};
|
|
1298
1493
|
$[2] = t2;
|
|
@@ -1320,6 +1515,8 @@ const RouterError = (t0) => {
|
|
|
1320
1515
|
let t6;
|
|
1321
1516
|
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1322
1517
|
t6 = /* @__PURE__ */ jsx(Divider, {
|
|
1518
|
+
component: "span",
|
|
1519
|
+
role: "presentation",
|
|
1323
1520
|
orientation: "vertical",
|
|
1324
1521
|
flexItem: true,
|
|
1325
1522
|
sx: { mx: 3 }
|
|
@@ -1342,6 +1539,7 @@ const RouterError = (t0) => {
|
|
|
1342
1539
|
t9 = /* @__PURE__ */ jsx(Fullscreen, {
|
|
1343
1540
|
sx: t1,
|
|
1344
1541
|
children: /* @__PURE__ */ jsxs(Box, {
|
|
1542
|
+
component: "h1",
|
|
1345
1543
|
sx: t2,
|
|
1346
1544
|
children: [
|
|
1347
1545
|
t5,
|
|
@@ -1388,12 +1586,16 @@ const FOOTER_SX = {
|
|
|
1388
1586
|
borderColor: "divider"
|
|
1389
1587
|
};
|
|
1390
1588
|
const pinnedWidth = (columns) => columns.reduce((total, column) => total + column.getSize(), 0);
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1589
|
+
/**
|
|
1590
|
+
* Gives an ellipsized value (the cell itself or a noWrap Typography in it) a native
|
|
1591
|
+
* tooltip with its full text. Checked on hover, so it follows resizes and new data.
|
|
1592
|
+
*/
|
|
1593
|
+
const titleIfTruncated = (event) => {
|
|
1594
|
+
const element = event.target;
|
|
1595
|
+
if (getComputedStyle(element).textOverflow !== "ellipsis") return;
|
|
1596
|
+
element.title = element.scrollWidth > element.clientWidth ? element.textContent ?? "" : "";
|
|
1597
|
+
};
|
|
1598
|
+
function LayoutTable({ table, loading = false, pagination = false, pageSizeOptions = DEFAULT_PAGE_SIZE_OPTIONS, showToolbar = false, disableColumnMenu = false, onRowClick, onRowDoubleClick, sx, ...toolbar }) {
|
|
1397
1599
|
"use no memo";
|
|
1398
1600
|
const { t } = useTranslation();
|
|
1399
1601
|
const containerRef = useRef(null);
|
|
@@ -1411,11 +1613,24 @@ function LayoutTable({ table, loading = false, pagination = false, pageSizeOptio
|
|
|
1411
1613
|
];
|
|
1412
1614
|
const isEmpty = !loading && !rows.length;
|
|
1413
1615
|
const pageSize = table.state.pagination.pageSize;
|
|
1414
|
-
|
|
1415
|
-
|
|
1616
|
+
const pageSizeOffered = pageSizeOptions.includes(pageSize);
|
|
1617
|
+
const pagerStarted = useRef(false);
|
|
1618
|
+
useLayoutEffect(() => {
|
|
1619
|
+
if (!pagination) {
|
|
1620
|
+
if (pageSize !== rows.length) table.setPageSize(Math.max(rows.length, 1));
|
|
1621
|
+
return;
|
|
1622
|
+
}
|
|
1623
|
+
const appSetSize = pagerStarted.current || !!(table.options.state?.pagination ?? table.options.initialState?.pagination);
|
|
1624
|
+
pagerStarted.current = true;
|
|
1625
|
+
if (!appSetSize || !pageSizeOffered) table.setPagination({
|
|
1626
|
+
pageIndex: 0,
|
|
1627
|
+
pageSize: Math.min(...pageSizeOptions)
|
|
1628
|
+
});
|
|
1416
1629
|
}, [
|
|
1417
1630
|
pagination,
|
|
1418
1631
|
pageSize,
|
|
1632
|
+
pageSizeOffered,
|
|
1633
|
+
pageSizeOptions,
|
|
1419
1634
|
rows.length,
|
|
1420
1635
|
table
|
|
1421
1636
|
]);
|
|
@@ -1436,15 +1651,19 @@ function LayoutTable({ table, loading = false, pagination = false, pageSizeOptio
|
|
|
1436
1651
|
}, []);
|
|
1437
1652
|
const flexColumns = table.getVisibleLeafColumns().filter((column_0) => columnFlex(column_0) > 0);
|
|
1438
1653
|
const totalFlex = flexColumns.reduce((total, column_1) => total + columnFlex(column_1), 0);
|
|
1439
|
-
const flexSpace =
|
|
1440
|
-
const
|
|
1441
|
-
const
|
|
1654
|
+
const flexSpace = containerWidth - table.getTotalSize();
|
|
1655
|
+
const flexDeltas = flexColumns.map((column_2) => [column_2.id, Math.floor(flexSpace * columnFlex(column_2) / totalFlex)]);
|
|
1656
|
+
const flexFits = flexColumns.every((column_3, index) => column_3.getSize() + flexDeltas[index][1] >= (column_3.columnDef.minSize ?? 20));
|
|
1657
|
+
const flexWidths = new Map(flexFits ? flexDeltas : []);
|
|
1658
|
+
const tableWidth = [...flexWidths.values()].reduce((total_0, delta) => total_0 + delta, table.getTotalSize());
|
|
1659
|
+
const renderedWidth = (column_4) => column_4.getSize() + (flexWidths.get(column_4.id) ?? 0);
|
|
1660
|
+
const headerWidth = (header) => header.column.getLeafColumns().reduce((width, column_5) => width + (flexWidths.get(column_5.id) ?? 0), header.getSize());
|
|
1442
1661
|
const virtualizeColumns = headerGroups.length === 1 && !loading;
|
|
1443
1662
|
const rowVirtualizer = useVirtualizer({
|
|
1444
1663
|
count: rows.length,
|
|
1445
1664
|
getScrollElement: () => containerRef.current,
|
|
1446
1665
|
estimateSize: () => ROW_HEIGHT,
|
|
1447
|
-
getItemKey: (
|
|
1666
|
+
getItemKey: (index_0) => rows[index_0].id,
|
|
1448
1667
|
overscan: ROW_OVERSCAN,
|
|
1449
1668
|
rangeExtractor: (range) => lookaheadRange(range, rowVirtualizer.scrollDirection, ROW_LOOKAHEAD),
|
|
1450
1669
|
scrollMargin: headerHeight,
|
|
@@ -1453,8 +1672,8 @@ function LayoutTable({ table, loading = false, pagination = false, pageSizeOptio
|
|
|
1453
1672
|
const columnVirtualizer = useVirtualizer({
|
|
1454
1673
|
count: virtualizeColumns ? centerColumns.length : 0,
|
|
1455
1674
|
getScrollElement: () => containerRef.current,
|
|
1456
|
-
estimateSize: (
|
|
1457
|
-
getItemKey: (
|
|
1675
|
+
estimateSize: (index_1) => renderedWidth(centerColumns[index_1]),
|
|
1676
|
+
getItemKey: (index_2) => centerColumns[index_2].id,
|
|
1458
1677
|
horizontal: true,
|
|
1459
1678
|
overscan: COLUMN_OVERSCAN,
|
|
1460
1679
|
scrollPaddingStart: startPinnedWidth,
|
|
@@ -1463,7 +1682,11 @@ function LayoutTable({ table, loading = false, pagination = false, pageSizeOptio
|
|
|
1463
1682
|
const columnSizing = table.state.columnSizing;
|
|
1464
1683
|
useEffect(() => {
|
|
1465
1684
|
columnVirtualizer.measure();
|
|
1466
|
-
}, [
|
|
1685
|
+
}, [
|
|
1686
|
+
columnVirtualizer,
|
|
1687
|
+
columnSizing,
|
|
1688
|
+
containerWidth
|
|
1689
|
+
]);
|
|
1467
1690
|
const focusedCell = table.getFocusedCell();
|
|
1468
1691
|
const focusedRowId = focusedCell?.row.id;
|
|
1469
1692
|
const focusedColumnId = focusedCell?.column.id;
|
|
@@ -1478,7 +1701,7 @@ function LayoutTable({ table, loading = false, pagination = false, pageSizeOptio
|
|
|
1478
1701
|
}
|
|
1479
1702
|
const rowIndex = rows.findIndex((row_0) => row_0.id === focusedRowId);
|
|
1480
1703
|
if (rowIndex >= 0) rowVirtualizer.scrollToIndex(rowIndex);
|
|
1481
|
-
const columnIndex = centerColumns.findIndex((
|
|
1704
|
+
const columnIndex = centerColumns.findIndex((column_6) => column_6.id === focusedColumnId);
|
|
1482
1705
|
if (columnIndex >= 0) columnVirtualizer.scrollToIndex(columnIndex);
|
|
1483
1706
|
}, [focusedRowId, focusedColumnId]);
|
|
1484
1707
|
const hasCellSelection = table.state.cellSelection.length > 0;
|
|
@@ -1605,7 +1828,7 @@ function LayoutTable({ table, loading = false, pagination = false, pageSizeOptio
|
|
|
1605
1828
|
}
|
|
1606
1829
|
},
|
|
1607
1830
|
children: /* @__PURE__ */ jsx(header_0.HeaderSortLabel, { children: /* @__PURE__ */ jsx(header_0.FlexRender, {}) })
|
|
1608
|
-
}), !disableColumnMenu && /* @__PURE__ */ jsx(header_0.HeaderMenu, {})]
|
|
1831
|
+
}), !disableColumnMenu && /* @__PURE__ */ jsx(header_0.HeaderMenu, { disableGrouping: pagination })]
|
|
1609
1832
|
}), /* @__PURE__ */ jsx(header_0.HeaderResizeHandle, {})]
|
|
1610
1833
|
});
|
|
1611
1834
|
}
|
|
@@ -1619,6 +1842,7 @@ function LayoutTable({ table, loading = false, pagination = false, pageSizeOptio
|
|
|
1619
1842
|
tabIndex: cell_0.getCanSelect() ? cell_0.getTabIndex() : void 0,
|
|
1620
1843
|
onMouseDown: cell_0.getSelectionStartHandler(),
|
|
1621
1844
|
onMouseEnter: cell_0.getSelectionExtendHandler(),
|
|
1845
|
+
onMouseOver: titleIfTruncated,
|
|
1622
1846
|
sx: {
|
|
1623
1847
|
overflow: "hidden",
|
|
1624
1848
|
textOverflow: "ellipsis",
|
|
@@ -1644,13 +1868,20 @@ function LayoutTable({ table, loading = false, pagination = false, pageSizeOptio
|
|
|
1644
1868
|
children: footer.isPlaceholder ? null : /* @__PURE__ */ jsx(footer.FlexRender, {})
|
|
1645
1869
|
})
|
|
1646
1870
|
}, f.id);
|
|
1871
|
+
const rowAction = onRowClick ?? onRowDoubleClick;
|
|
1647
1872
|
const renderRow = (row_1) => {
|
|
1648
1873
|
const cells = windowColumns(row_1.getVisibleCells());
|
|
1874
|
+
const focusableCells = row_1.getVisibleCells().some((cell_1) => cell_1.getCanSelect());
|
|
1649
1875
|
return /* @__PURE__ */ jsxs(TableRow, {
|
|
1650
1876
|
hover: true,
|
|
1651
1877
|
selected: row_1.getIsSelected(),
|
|
1878
|
+
tabIndex: rowAction && !focusableCells ? 0 : void 0,
|
|
1652
1879
|
onClick: onRowClick && (() => onRowClick(row_1)),
|
|
1653
1880
|
onDoubleClick: onRowDoubleClick && (() => onRowDoubleClick(row_1)),
|
|
1881
|
+
onKeyDown: rowAction && ((event) => {
|
|
1882
|
+
const target = event.target;
|
|
1883
|
+
if (event.key === "Enter" && (target === event.currentTarget || target.tagName === "TD")) rowAction(row_1);
|
|
1884
|
+
}),
|
|
1654
1885
|
sx: {
|
|
1655
1886
|
height: ROW_HEIGHT,
|
|
1656
1887
|
cursor: onRowClick || onRowDoubleClick ? "pointer" : void 0
|
|
@@ -1675,7 +1906,7 @@ function LayoutTable({ table, loading = false, pagination = false, pageSizeOptio
|
|
|
1675
1906
|
paddingStart,
|
|
1676
1907
|
paddingEnd
|
|
1677
1908
|
]);
|
|
1678
|
-
const bodyRows = virtualRows.map(({ index:
|
|
1909
|
+
const bodyRows = virtualRows.map(({ index: index_3 }) => rowCache.current.get(rows[index_3].id) ?? renderRow(rows[index_3]));
|
|
1679
1910
|
rowCache.current = new Map(bodyRows.map((row_2) => [row_2.key, row_2]));
|
|
1680
1911
|
/** Reserves the scroll height of the rows outside the virtual window. */
|
|
1681
1912
|
const skippedRows = (height) => height > 0 ? /* @__PURE__ */ jsx(TableRow, {
|
|
@@ -1714,12 +1945,14 @@ function LayoutTable({ table, loading = false, pagination = false, pageSizeOptio
|
|
|
1714
1945
|
children: /* @__PURE__ */ jsxs(Table, {
|
|
1715
1946
|
stickyHeader: true,
|
|
1716
1947
|
size: "small",
|
|
1948
|
+
"aria-busy": loading,
|
|
1949
|
+
"aria-label": typeof toolbar.title === "string" ? toolbar.title : void 0,
|
|
1717
1950
|
sx: {
|
|
1718
1951
|
tableLayout: "fixed",
|
|
1719
|
-
width:
|
|
1952
|
+
width: tableWidth,
|
|
1720
1953
|
minWidth: "100%",
|
|
1721
1954
|
"& tbody .MuiTableRow-root:last-of-type .MuiTableCell-root": { borderBottom: 0 },
|
|
1722
|
-
"& .MuiTableCell-root:focus": {
|
|
1955
|
+
"& .MuiTableCell-root:focus, & .MuiTableRow-root:focus-visible": {
|
|
1723
1956
|
outline: "1px solid",
|
|
1724
1957
|
outlineColor: "primary.main",
|
|
1725
1958
|
outlineOffset: -1
|
|
@@ -1823,7 +2056,7 @@ function LayoutTable({ table, loading = false, pagination = false, pageSizeOptio
|
|
|
1823
2056
|
]
|
|
1824
2057
|
})
|
|
1825
2058
|
}),
|
|
1826
|
-
pagination && /* @__PURE__ */ jsx(table.Pagination, { pageSizeOptions })
|
|
2059
|
+
pagination && pageSizeOffered && /* @__PURE__ */ jsx(table.Pagination, { pageSizeOptions })
|
|
1827
2060
|
]
|
|
1828
2061
|
}) });
|
|
1829
2062
|
}
|