@serhii.olishevskyi/docs 1.2.26 → 1.2.28
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.mts +357 -327
- package/dist/index.d.ts +357 -327
- package/dist/index.js +1104 -393
- package/dist/index.mjs +989 -258
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2403,16 +2403,16 @@ var init_context = __esm({
|
|
|
2403
2403
|
});
|
|
2404
2404
|
|
|
2405
2405
|
// src/UI/components/buttons/CopyClipboardButtonComponent.tsx
|
|
2406
|
-
var
|
|
2406
|
+
var import_react24, import_material17, import_Check3, import_ContentCopy3, import_jsx_runtime27, CopyClipboardButtonComponent;
|
|
2407
2407
|
var init_CopyClipboardButtonComponent = __esm({
|
|
2408
2408
|
"src/UI/components/buttons/CopyClipboardButtonComponent.tsx"() {
|
|
2409
2409
|
"use strict";
|
|
2410
|
-
|
|
2411
|
-
|
|
2410
|
+
import_react24 = require("react");
|
|
2411
|
+
import_material17 = require("@mui/material");
|
|
2412
2412
|
import_Check3 = __toESM(require("@mui/icons-material/Check"));
|
|
2413
2413
|
import_ContentCopy3 = __toESM(require("@mui/icons-material/ContentCopy"));
|
|
2414
2414
|
init_TranslatableTooltipComponent();
|
|
2415
|
-
|
|
2415
|
+
import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2416
2416
|
CopyClipboardButtonComponent = ({
|
|
2417
2417
|
overrideNamespace,
|
|
2418
2418
|
textToCopy,
|
|
@@ -2425,7 +2425,7 @@ var init_CopyClipboardButtonComponent = __esm({
|
|
|
2425
2425
|
sx,
|
|
2426
2426
|
...iconButtonProps
|
|
2427
2427
|
}) => {
|
|
2428
|
-
const [copied, setCopied] = (0,
|
|
2428
|
+
const [copied, setCopied] = (0, import_react24.useState)(false);
|
|
2429
2429
|
const handleCopy = async (e) => {
|
|
2430
2430
|
e.stopPropagation();
|
|
2431
2431
|
if (!textToCopy) return;
|
|
@@ -2442,15 +2442,15 @@ var init_CopyClipboardButtonComponent = __esm({
|
|
|
2442
2442
|
console.error("Failed to copy text to clipboard:", error);
|
|
2443
2443
|
}
|
|
2444
2444
|
};
|
|
2445
|
-
return /* @__PURE__ */ (0,
|
|
2446
|
-
|
|
2445
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TranslatableTooltipComponent, { title: copied ? copiedTooltipText : copyTooltipText, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2446
|
+
import_material17.IconButton,
|
|
2447
2447
|
{
|
|
2448
2448
|
size,
|
|
2449
2449
|
onClick: handleCopy,
|
|
2450
2450
|
disabled: !textToCopy || iconButtonProps.disabled,
|
|
2451
2451
|
sx: { p: 0.25, ...sx },
|
|
2452
2452
|
...iconButtonProps,
|
|
2453
|
-
children: copied ? /* @__PURE__ */ (0,
|
|
2453
|
+
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_Check3.default, { fontSize: size === "large" ? "medium" : "small", color: "success" }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_ContentCopy3.default, { fontSize: size === "large" ? "medium" : "small" })
|
|
2454
2454
|
}
|
|
2455
2455
|
) }) });
|
|
2456
2456
|
};
|
|
@@ -2458,33 +2458,33 @@ var init_CopyClipboardButtonComponent = __esm({
|
|
|
2458
2458
|
});
|
|
2459
2459
|
|
|
2460
2460
|
// src/UI/components/data.display/UserStatusChipComponent.tsx
|
|
2461
|
-
var
|
|
2461
|
+
var import_material19, import_InfoOutlined, import_jsx_runtime29, UserStatusChipComponent;
|
|
2462
2462
|
var init_UserStatusChipComponent = __esm({
|
|
2463
2463
|
"src/UI/components/data.display/UserStatusChipComponent.tsx"() {
|
|
2464
2464
|
"use strict";
|
|
2465
|
-
|
|
2465
|
+
import_material19 = require("@mui/material");
|
|
2466
2466
|
import_InfoOutlined = __toESM(require("@mui/icons-material/InfoOutlined"));
|
|
2467
2467
|
init_context();
|
|
2468
|
-
|
|
2468
|
+
import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2469
2469
|
UserStatusChipComponent = ({ overrideNamespace, state }) => {
|
|
2470
2470
|
const confirm = useConfirmation();
|
|
2471
2471
|
const handleShowReason = async (e) => {
|
|
2472
2472
|
e.stopPropagation();
|
|
2473
2473
|
if (!state.locked_reason) return;
|
|
2474
2474
|
await confirm({
|
|
2475
|
-
title: /* @__PURE__ */ (0,
|
|
2475
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TranslateText, { overrideNamespace: overrideNamespace || "system_widgets", children: "Lock Reason" }),
|
|
2476
2476
|
message: state.locked_reason,
|
|
2477
2477
|
type: "info",
|
|
2478
|
-
confirmText: /* @__PURE__ */ (0,
|
|
2478
|
+
confirmText: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TranslateText, { overrideNamespace: overrideNamespace || "system_widgets", children: "OK" }),
|
|
2479
2479
|
showNoButton: false,
|
|
2480
2480
|
showCancelButton: false
|
|
2481
2481
|
});
|
|
2482
2482
|
};
|
|
2483
2483
|
if (state.profile_archived) {
|
|
2484
|
-
return /* @__PURE__ */ (0,
|
|
2485
|
-
|
|
2484
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2485
|
+
import_material19.Chip,
|
|
2486
2486
|
{
|
|
2487
|
-
label: /* @__PURE__ */ (0,
|
|
2487
|
+
label: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TranslateText, { overrideNamespace: overrideNamespace || "system_widgets", children: "Archived" }),
|
|
2488
2488
|
color: "default",
|
|
2489
2489
|
size: "small",
|
|
2490
2490
|
variant: "filled"
|
|
@@ -2492,10 +2492,10 @@ var init_UserStatusChipComponent = __esm({
|
|
|
2492
2492
|
);
|
|
2493
2493
|
}
|
|
2494
2494
|
if (state.profile_locked) {
|
|
2495
|
-
return /* @__PURE__ */ (0,
|
|
2496
|
-
|
|
2495
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2496
|
+
import_material19.Chip,
|
|
2497
2497
|
{
|
|
2498
|
-
label: /* @__PURE__ */ (0,
|
|
2498
|
+
label: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TranslateText, { overrideNamespace: overrideNamespace || "system_widgets", children: "System Locked" }),
|
|
2499
2499
|
color: "error",
|
|
2500
2500
|
size: "small",
|
|
2501
2501
|
variant: "filled"
|
|
@@ -2503,30 +2503,30 @@ var init_UserStatusChipComponent = __esm({
|
|
|
2503
2503
|
);
|
|
2504
2504
|
}
|
|
2505
2505
|
if (state.excluded) {
|
|
2506
|
-
return /* @__PURE__ */ (0,
|
|
2507
|
-
|
|
2506
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2507
|
+
import_material19.Chip,
|
|
2508
2508
|
{
|
|
2509
|
-
label: /* @__PURE__ */ (0,
|
|
2509
|
+
label: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TranslateText, { overrideNamespace: overrideNamespace || "system_widgets", children: "Excluded" }),
|
|
2510
2510
|
size: "small"
|
|
2511
2511
|
}
|
|
2512
2512
|
);
|
|
2513
2513
|
}
|
|
2514
2514
|
if (state.locked) {
|
|
2515
|
-
return /* @__PURE__ */ (0,
|
|
2516
|
-
|
|
2515
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2516
|
+
import_material19.Chip,
|
|
2517
2517
|
{
|
|
2518
|
-
label: /* @__PURE__ */ (0,
|
|
2518
|
+
label: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TranslateText, { overrideNamespace: overrideNamespace || "system_widgets", children: "Locked" }),
|
|
2519
2519
|
color: "error",
|
|
2520
2520
|
size: "small",
|
|
2521
2521
|
onDelete: state.locked_reason ? handleShowReason : void 0,
|
|
2522
|
-
deleteIcon: state.locked_reason ? /* @__PURE__ */ (0,
|
|
2522
|
+
deleteIcon: state.locked_reason ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_material19.IconButton, { size: "small", component: "span", sx: { p: 0.2 }, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_InfoOutlined.default, { fontSize: "small" }) }) : void 0
|
|
2523
2523
|
}
|
|
2524
2524
|
);
|
|
2525
2525
|
}
|
|
2526
|
-
return /* @__PURE__ */ (0,
|
|
2527
|
-
|
|
2526
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2527
|
+
import_material19.Chip,
|
|
2528
2528
|
{
|
|
2529
|
-
label: /* @__PURE__ */ (0,
|
|
2529
|
+
label: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TranslateText, { overrideNamespace: overrideNamespace || "system_widgets", children: "Active" }),
|
|
2530
2530
|
color: "success",
|
|
2531
2531
|
size: "small",
|
|
2532
2532
|
variant: "outlined"
|
|
@@ -2537,38 +2537,38 @@ var init_UserStatusChipComponent = __esm({
|
|
|
2537
2537
|
});
|
|
2538
2538
|
|
|
2539
2539
|
// src/UI/components/data.display/UserRoleChipComponent.tsx
|
|
2540
|
-
var
|
|
2540
|
+
var import_material20, import_jsx_runtime30, UserRoleChipComponent;
|
|
2541
2541
|
var init_UserRoleChipComponent = __esm({
|
|
2542
2542
|
"src/UI/components/data.display/UserRoleChipComponent.tsx"() {
|
|
2543
2543
|
"use strict";
|
|
2544
|
-
|
|
2544
|
+
import_material20 = require("@mui/material");
|
|
2545
2545
|
init_context();
|
|
2546
|
-
|
|
2546
|
+
import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2547
2547
|
UserRoleChipComponent = ({ overrideNamespace, role }) => {
|
|
2548
2548
|
switch (role) {
|
|
2549
2549
|
case "superadmin":
|
|
2550
|
-
return /* @__PURE__ */ (0,
|
|
2551
|
-
|
|
2550
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2551
|
+
import_material20.Chip,
|
|
2552
2552
|
{
|
|
2553
|
-
label: /* @__PURE__ */ (0,
|
|
2553
|
+
label: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TranslateText, { overrideNamespace: overrideNamespace || "system_widgets", children: "Superadministrator" }),
|
|
2554
2554
|
color: "error",
|
|
2555
2555
|
size: "small"
|
|
2556
2556
|
}
|
|
2557
2557
|
);
|
|
2558
2558
|
case "admin":
|
|
2559
|
-
return /* @__PURE__ */ (0,
|
|
2560
|
-
|
|
2559
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2560
|
+
import_material20.Chip,
|
|
2561
2561
|
{
|
|
2562
|
-
label: /* @__PURE__ */ (0,
|
|
2562
|
+
label: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TranslateText, { overrideNamespace: overrideNamespace || "system_widgets", children: "Administrator" }),
|
|
2563
2563
|
color: "primary",
|
|
2564
2564
|
size: "small"
|
|
2565
2565
|
}
|
|
2566
2566
|
);
|
|
2567
2567
|
default:
|
|
2568
|
-
return /* @__PURE__ */ (0,
|
|
2569
|
-
|
|
2568
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2569
|
+
import_material20.Chip,
|
|
2570
2570
|
{
|
|
2571
|
-
label: /* @__PURE__ */ (0,
|
|
2571
|
+
label: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TranslateText, { overrideNamespace: overrideNamespace || "system_widgets", children: "User" }),
|
|
2572
2572
|
variant: "outlined",
|
|
2573
2573
|
size: "small"
|
|
2574
2574
|
}
|
|
@@ -2584,13 +2584,13 @@ __export(UserPopoverComponent_exports, {
|
|
|
2584
2584
|
UserPopoverComponent: () => UserPopoverComponent,
|
|
2585
2585
|
default: () => UserPopoverComponent_default
|
|
2586
2586
|
});
|
|
2587
|
-
var
|
|
2587
|
+
var import_react26, import_material21, import_icons_material3, import_jsx_runtime31, useUserStatus, UserPopoverComponent, UserPopoverComponent_default;
|
|
2588
2588
|
var init_UserPopoverComponent = __esm({
|
|
2589
2589
|
"src/UI/components/data.display/UserPopoverComponent.tsx"() {
|
|
2590
2590
|
"use strict";
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2591
|
+
import_react26 = require("react");
|
|
2592
|
+
import_material21 = require("@mui/material");
|
|
2593
|
+
import_icons_material3 = require("@mui/icons-material");
|
|
2594
2594
|
init_UserStatusChipComponent();
|
|
2595
2595
|
init_UserRoleChipComponent();
|
|
2596
2596
|
init_CopyClipboardButtonComponent();
|
|
@@ -2599,11 +2599,11 @@ var init_UserPopoverComponent = __esm({
|
|
|
2599
2599
|
init_UserSettingsProvider();
|
|
2600
2600
|
init_TranslatableTooltipComponent();
|
|
2601
2601
|
init_session_service();
|
|
2602
|
-
|
|
2602
|
+
import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2603
2603
|
useUserStatus = (supabase, userId, open) => {
|
|
2604
|
-
const [lastSeenAt, setLastSeenAt] = (0,
|
|
2605
|
-
const [loading, setLoading] = (0,
|
|
2606
|
-
(0,
|
|
2604
|
+
const [lastSeenAt, setLastSeenAt] = (0, import_react26.useState)(null);
|
|
2605
|
+
const [loading, setLoading] = (0, import_react26.useState)(true);
|
|
2606
|
+
(0, import_react26.useEffect)(() => {
|
|
2607
2607
|
if (!userId || !open) {
|
|
2608
2608
|
setLastSeenAt(null);
|
|
2609
2609
|
setLoading(false);
|
|
@@ -2652,13 +2652,13 @@ var init_UserPopoverComponent = __esm({
|
|
|
2652
2652
|
const { activeCompanyId, membership: currentMembership } = useAuth();
|
|
2653
2653
|
const { openChatWithUser } = useUserSettings();
|
|
2654
2654
|
const { formatDate, formatRelativeTime } = useLocalization();
|
|
2655
|
-
const [profileData, setProfileData] = (0,
|
|
2656
|
-
const [membershipData, setMembershipData] = (0,
|
|
2657
|
-
const [avatarUrl, setAvatarUrl] = (0,
|
|
2658
|
-
const [coverUrl, setCoverUrl] = (0,
|
|
2659
|
-
const [loading, setLoading] = (0,
|
|
2655
|
+
const [profileData, setProfileData] = (0, import_react26.useState)(null);
|
|
2656
|
+
const [membershipData, setMembershipData] = (0, import_react26.useState)(null);
|
|
2657
|
+
const [avatarUrl, setAvatarUrl] = (0, import_react26.useState)(null);
|
|
2658
|
+
const [coverUrl, setCoverUrl] = (0, import_react26.useState)(null);
|
|
2659
|
+
const [loading, setLoading] = (0, import_react26.useState)(true);
|
|
2660
2660
|
const { lastSeenAt, isOnline } = useUserStatus(supabase, userId, open);
|
|
2661
|
-
(0,
|
|
2661
|
+
(0, import_react26.useEffect)(() => {
|
|
2662
2662
|
if (!open || !userId || !activeCompanyId) return;
|
|
2663
2663
|
let isMounted = true;
|
|
2664
2664
|
setLoading(true);
|
|
@@ -2704,7 +2704,7 @@ var init_UserPopoverComponent = __esm({
|
|
|
2704
2704
|
}, [open, userId, currentMembership?.id, activeCompanyId]);
|
|
2705
2705
|
const getStatusChip = () => {
|
|
2706
2706
|
if (!profileData) return null;
|
|
2707
|
-
return /* @__PURE__ */ (0,
|
|
2707
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(UserStatusChipComponent, { state: { profile_archived: profileData.archived, profile_locked: profileData.locked, excluded: membershipData?.excluded || false, locked: membershipData?.locked || false, locked_reason: membershipData?.locked_reason || "" } });
|
|
2708
2708
|
};
|
|
2709
2709
|
const getStatusTypographyColor = (isOnline2, lastSeenAt2) => {
|
|
2710
2710
|
if (isOnline2) return "success";
|
|
@@ -2725,8 +2725,8 @@ var init_UserPopoverComponent = __esm({
|
|
|
2725
2725
|
return "inherit";
|
|
2726
2726
|
};
|
|
2727
2727
|
const canChat = currentMembership && membershipData && currentMembership.id !== membershipData.id;
|
|
2728
|
-
return /* @__PURE__ */ (0,
|
|
2729
|
-
|
|
2728
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2729
|
+
import_material21.Popover,
|
|
2730
2730
|
{
|
|
2731
2731
|
open,
|
|
2732
2732
|
anchorEl,
|
|
@@ -2744,9 +2744,9 @@ var init_UserPopoverComponent = __esm({
|
|
|
2744
2744
|
}
|
|
2745
2745
|
}
|
|
2746
2746
|
},
|
|
2747
|
-
children: loading ? /* @__PURE__ */ (0,
|
|
2748
|
-
/* @__PURE__ */ (0,
|
|
2749
|
-
|
|
2747
|
+
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material21.Box, { sx: { display: "flex", justifyContent: "center", py: 4 }, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material21.CircularProgress, { size: 28 }) }) : profileData ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_material21.Box, { sx: { display: "flex", flexDirection: "column" }, children: [
|
|
2748
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
2749
|
+
import_material21.Box,
|
|
2750
2750
|
{
|
|
2751
2751
|
sx: {
|
|
2752
2752
|
position: "relative",
|
|
@@ -2755,8 +2755,8 @@ var init_UserPopoverComponent = __esm({
|
|
|
2755
2755
|
bgcolor: "action.selected"
|
|
2756
2756
|
},
|
|
2757
2757
|
children: [
|
|
2758
|
-
coverUrl && /* @__PURE__ */ (0,
|
|
2759
|
-
|
|
2758
|
+
coverUrl && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2759
|
+
import_material21.Box,
|
|
2760
2760
|
{
|
|
2761
2761
|
component: "img",
|
|
2762
2762
|
src: coverUrl,
|
|
@@ -2771,8 +2771,8 @@ var init_UserPopoverComponent = __esm({
|
|
|
2771
2771
|
}
|
|
2772
2772
|
}
|
|
2773
2773
|
),
|
|
2774
|
-
/* @__PURE__ */ (0,
|
|
2775
|
-
|
|
2774
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2775
|
+
import_material21.IconButton,
|
|
2776
2776
|
{
|
|
2777
2777
|
size: "small",
|
|
2778
2778
|
onClick: onClose,
|
|
@@ -2789,16 +2789,16 @@ var init_UserPopoverComponent = __esm({
|
|
|
2789
2789
|
transform: "scale(1.1)"
|
|
2790
2790
|
}
|
|
2791
2791
|
},
|
|
2792
|
-
children: /* @__PURE__ */ (0,
|
|
2792
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_icons_material3.Close, { fontSize: "small" })
|
|
2793
2793
|
}
|
|
2794
2794
|
)
|
|
2795
2795
|
]
|
|
2796
2796
|
}
|
|
2797
2797
|
),
|
|
2798
|
-
/* @__PURE__ */ (0,
|
|
2799
|
-
/* @__PURE__ */ (0,
|
|
2800
|
-
/* @__PURE__ */ (0,
|
|
2801
|
-
|
|
2798
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_material21.Box, { sx: { p: 2, pt: 0 }, children: [
|
|
2799
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_material21.Stack, { direction: "row", spacing: 1.5, sx: { alignItems: "flex-end", mt: "-18px", mb: 1 }, children: [
|
|
2800
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2801
|
+
import_material21.Badge,
|
|
2802
2802
|
{
|
|
2803
2803
|
overlap: "circular",
|
|
2804
2804
|
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
@@ -2834,8 +2834,8 @@ var init_UserPopoverComponent = __esm({
|
|
|
2834
2834
|
}
|
|
2835
2835
|
}
|
|
2836
2836
|
},
|
|
2837
|
-
children: /* @__PURE__ */ (0,
|
|
2838
|
-
|
|
2837
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2838
|
+
import_material21.Avatar,
|
|
2839
2839
|
{
|
|
2840
2840
|
src: avatarUrl || coverUrl || void 0,
|
|
2841
2841
|
sx: {
|
|
@@ -2853,54 +2853,54 @@ var init_UserPopoverComponent = __esm({
|
|
|
2853
2853
|
)
|
|
2854
2854
|
}
|
|
2855
2855
|
),
|
|
2856
|
-
/* @__PURE__ */ (0,
|
|
2857
|
-
/* @__PURE__ */ (0,
|
|
2858
|
-
membershipData?.employee_post && /* @__PURE__ */ (0,
|
|
2856
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_material21.Box, { sx: { overflow: "hidden", pb: 0.5 }, children: [
|
|
2857
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material21.Typography, { variant: "subtitle1", sx: { fontWeight: 600, lineHeight: 1.2 }, noWrap: true, children: profileData.display_name || `${profileData.first_name || ""} ${profileData.last_name || ""}` }),
|
|
2858
|
+
membershipData?.employee_post && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material21.Typography, { variant: "body2", color: "text.secondary", noWrap: true, children: membershipData.employee_post })
|
|
2859
2859
|
] })
|
|
2860
2860
|
] }),
|
|
2861
|
-
/* @__PURE__ */ (0,
|
|
2861
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_material21.Stack, { direction: "row", spacing: 1, sx: { my: 1, flexWrap: "wrap", gap: 0.5 }, children: [
|
|
2862
2862
|
getStatusChip(),
|
|
2863
|
-
/* @__PURE__ */ (0,
|
|
2863
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(UserRoleChipComponent, { role: membershipData?.role || "user" })
|
|
2864
2864
|
] }),
|
|
2865
|
-
/* @__PURE__ */ (0,
|
|
2866
|
-
/* @__PURE__ */ (0,
|
|
2867
|
-
/* @__PURE__ */ (0,
|
|
2868
|
-
/* @__PURE__ */ (0,
|
|
2869
|
-
/* @__PURE__ */ (0,
|
|
2870
|
-
/* @__PURE__ */ (0,
|
|
2865
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material21.Divider, { sx: { my: 1.5 } }),
|
|
2866
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_material21.Stack, { spacing: 1, sx: { fontSize: "0.875rem", mb: 1.5 }, children: [
|
|
2867
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_material21.Stack, { direction: "row", spacing: 1, sx: { alignItems: "center" }, color: "text.secondary", children: [
|
|
2868
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_icons_material3.AccessTime, { fontSize: "small", color: getStatusIconColor(isOnline, lastSeenAt) }),
|
|
2869
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material21.Typography, { variant: "body2", color: getStatusTypographyColor(isOnline, lastSeenAt), children: isOnline ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TranslateText, { overrideNamespace: overrideNamespace || "form_components", children: "Online" }) : lastSeenAt ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
2870
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TranslateText, { overrideNamespace: overrideNamespace || "form_components", children: "Last seen" }),
|
|
2871
2871
|
":",
|
|
2872
2872
|
" ",
|
|
2873
|
-
/* @__PURE__ */ (0,
|
|
2874
|
-
] }) : /* @__PURE__ */ (0,
|
|
2873
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("strong", { children: formatRelativeTime(lastSeenAt) })
|
|
2874
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TranslateText, { overrideNamespace: overrideNamespace || "form_components", children: "Offline" }) })
|
|
2875
2875
|
] }),
|
|
2876
|
-
profileData.email && /* @__PURE__ */ (0,
|
|
2877
|
-
/* @__PURE__ */ (0,
|
|
2878
|
-
/* @__PURE__ */ (0,
|
|
2879
|
-
/* @__PURE__ */ (0,
|
|
2876
|
+
profileData.email && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_material21.Stack, { direction: "row", spacing: 1, sx: { alignItems: "center" }, color: "text.secondary", children: [
|
|
2877
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_icons_material3.Email, { fontSize: "small" }),
|
|
2878
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material21.Typography, { variant: "body2", color: "text.primary", noWrap: true, sx: { flexGrow: 1 }, children: profileData.email }),
|
|
2879
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(CopyClipboardButtonComponent, { textToCopy: profileData.email })
|
|
2880
2880
|
] }),
|
|
2881
|
-
membershipData?.employee_post && /* @__PURE__ */ (0,
|
|
2882
|
-
/* @__PURE__ */ (0,
|
|
2883
|
-
/* @__PURE__ */ (0,
|
|
2884
|
-
/* @__PURE__ */ (0,
|
|
2881
|
+
membershipData?.employee_post && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_material21.Stack, { direction: "row", spacing: 1, sx: { alignItems: "center" }, color: "text.secondary", children: [
|
|
2882
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_icons_material3.Work, { fontSize: "small" }),
|
|
2883
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material21.Typography, { variant: "body2", color: "text.primary", noWrap: true, sx: { flexGrow: 1 }, children: membershipData.employee_post }),
|
|
2884
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(CopyClipboardButtonComponent, { textToCopy: membershipData.employee_post })
|
|
2885
2885
|
] }),
|
|
2886
|
-
profileData.phone && /* @__PURE__ */ (0,
|
|
2887
|
-
/* @__PURE__ */ (0,
|
|
2888
|
-
/* @__PURE__ */ (0,
|
|
2886
|
+
profileData.phone && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_material21.Stack, { direction: "row", spacing: 1, sx: { alignItems: "center" }, color: "text.secondary", children: [
|
|
2887
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_icons_material3.Phone, { fontSize: "small" }),
|
|
2888
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material21.Typography, { variant: "body2", color: "text.primary", children: profileData.phone })
|
|
2889
2889
|
] }),
|
|
2890
|
-
profileData.birthday && /* @__PURE__ */ (0,
|
|
2891
|
-
/* @__PURE__ */ (0,
|
|
2892
|
-
/* @__PURE__ */ (0,
|
|
2890
|
+
profileData.birthday && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_material21.Stack, { direction: "row", spacing: 1, sx: { alignItems: "center" }, color: "text.secondary", children: [
|
|
2891
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_icons_material3.Cake, { fontSize: "small" }),
|
|
2892
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material21.Typography, { variant: "body2", color: "text.primary", children: formatDate(profileData.birthday) })
|
|
2893
2893
|
] }),
|
|
2894
|
-
membershipData?.created_at && /* @__PURE__ */ (0,
|
|
2895
|
-
/* @__PURE__ */ (0,
|
|
2896
|
-
/* @__PURE__ */ (0,
|
|
2897
|
-
/* @__PURE__ */ (0,
|
|
2894
|
+
membershipData?.created_at && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_material21.Stack, { direction: "row", spacing: 1, sx: { alignItems: "center" }, color: "text.secondary", children: [
|
|
2895
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_icons_material3.CalendarToday, { fontSize: "small" }),
|
|
2896
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_material21.Typography, { variant: "body2", color: "text.primary", children: [
|
|
2897
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TranslateText, { overrideNamespace: overrideNamespace || "form_components", children: "In company from" }),
|
|
2898
2898
|
": ",
|
|
2899
2899
|
formatDate(membershipData.created_at)
|
|
2900
2900
|
] })
|
|
2901
2901
|
] }),
|
|
2902
|
-
profileData.description && /* @__PURE__ */ (0,
|
|
2903
|
-
|
|
2902
|
+
profileData.description && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2903
|
+
import_material21.Typography,
|
|
2904
2904
|
{
|
|
2905
2905
|
variant: "caption",
|
|
2906
2906
|
color: "text.secondary",
|
|
@@ -2915,28 +2915,28 @@ var init_UserPopoverComponent = __esm({
|
|
|
2915
2915
|
}
|
|
2916
2916
|
)
|
|
2917
2917
|
] }),
|
|
2918
|
-
/* @__PURE__ */ (0,
|
|
2919
|
-
/* @__PURE__ */ (0,
|
|
2920
|
-
/* @__PURE__ */ (0,
|
|
2921
|
-
/* @__PURE__ */ (0,
|
|
2922
|
-
/* @__PURE__ */ (0,
|
|
2923
|
-
|
|
2918
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material21.Divider, { sx: { my: 1 } }),
|
|
2919
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_material21.Stack, { direction: "row", spacing: 1, sx: { justifyContent: "space-around", pt: 0.5 }, children: [
|
|
2920
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TranslatableTooltipComponent, { title: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TranslateText, { overrideNamespace: overrideNamespace || "form_components", children: "Send a notification" }), children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material21.IconButton, { size: "small", color: "primary", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_icons_material3.NotificationsNone, { fontSize: "small" }) }) }),
|
|
2921
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TranslatableTooltipComponent, { title: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TranslateText, { overrideNamespace: overrideNamespace || "form_components", children: "Set a task" }), children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material21.IconButton, { size: "small", color: "primary", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_icons_material3.AssignmentOutlined, { fontSize: "small" }) }) }),
|
|
2922
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TranslatableTooltipComponent, { title: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TranslateText, { overrideNamespace: overrideNamespace || "form_components", children: "Start a chat" }), children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2923
|
+
import_material21.IconButton,
|
|
2924
2924
|
{
|
|
2925
2925
|
size: "small",
|
|
2926
2926
|
color: "primary",
|
|
2927
2927
|
disabled: !canChat,
|
|
2928
2928
|
onClick: () => membershipData && openChatWithUser(membershipData.id),
|
|
2929
|
-
children: /* @__PURE__ */ (0,
|
|
2929
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_icons_material3.ChatBubble, { fontSize: "small" })
|
|
2930
2930
|
}
|
|
2931
2931
|
) })
|
|
2932
2932
|
] })
|
|
2933
2933
|
] })
|
|
2934
|
-
] }) : /* @__PURE__ */ (0,
|
|
2935
|
-
|
|
2934
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material21.Box, { sx: { p: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2935
|
+
import_material21.Typography,
|
|
2936
2936
|
{
|
|
2937
2937
|
color: "error",
|
|
2938
2938
|
variant: "body2",
|
|
2939
|
-
children: /* @__PURE__ */ (0,
|
|
2939
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TranslateText, { overrideNamespace: overrideNamespace || "form_components", children: "Failed to load user data" })
|
|
2940
2940
|
}
|
|
2941
2941
|
) })
|
|
2942
2942
|
}
|
|
@@ -2958,6 +2958,7 @@ __export(index_exports, {
|
|
|
2958
2958
|
CollapsedContainerComponent: () => CollapsedContainerComponent,
|
|
2959
2959
|
ConfirmationProvider: () => ConfirmationProvider,
|
|
2960
2960
|
CopyClipboardButtonComponent: () => CopyClipboardButtonComponent,
|
|
2961
|
+
DateTimePickerComponent: () => DateTimePickerComponent,
|
|
2961
2962
|
EmailInputComponent: () => EmailInputComponent,
|
|
2962
2963
|
ErrorAlertComponent: () => ErrorAlertComponent,
|
|
2963
2964
|
ExpandableNoteComponent: () => ExpandableNoteComponent,
|
|
@@ -2985,7 +2986,7 @@ __export(index_exports, {
|
|
|
2985
2986
|
TranslateProvider: () => TranslateProvider,
|
|
2986
2987
|
TranslateText: () => TranslateText,
|
|
2987
2988
|
TranslationEditProvider: () => TranslationEditProvider,
|
|
2988
|
-
|
|
2989
|
+
TruncatedTypographyComponent: () => TruncatedTypographyComponent,
|
|
2989
2990
|
UrlComponent: () => UrlComponent,
|
|
2990
2991
|
UserAvatarComponent: () => UserAvatarComponent,
|
|
2991
2992
|
UserPopoverComponent: () => UserPopoverComponent,
|
|
@@ -4103,21 +4104,730 @@ function UrlComponent({
|
|
|
4103
4104
|
] });
|
|
4104
4105
|
}
|
|
4105
4106
|
|
|
4106
|
-
// src/UI/components/
|
|
4107
|
+
// src/UI/components/inputs/DateTimePickerComponent.tsx
|
|
4107
4108
|
var import_react22 = require("react");
|
|
4108
4109
|
var import_material15 = require("@mui/material");
|
|
4110
|
+
var import_icons_material2 = require("@mui/icons-material");
|
|
4109
4111
|
init_context();
|
|
4112
|
+
init_TranslatableTooltipComponent();
|
|
4110
4113
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
4111
|
-
var
|
|
4114
|
+
var LOCALE_CONFIGS = {
|
|
4115
|
+
de: {
|
|
4116
|
+
locale: "de-DE",
|
|
4117
|
+
dateFormat: "DD.MM.YYYY",
|
|
4118
|
+
timeFormat: "24",
|
|
4119
|
+
placeholderDate: "TT.MM.JJJJ",
|
|
4120
|
+
placeholderTime: "HH:MM",
|
|
4121
|
+
placeholderDateTime: "TT.MM.JJJJ HH:MM",
|
|
4122
|
+
weekStartsOn: 1
|
|
4123
|
+
},
|
|
4124
|
+
en: {
|
|
4125
|
+
locale: "en-US",
|
|
4126
|
+
dateFormat: "MM/DD/YYYY",
|
|
4127
|
+
timeFormat: "12",
|
|
4128
|
+
placeholderDate: "MM/DD/YYYY",
|
|
4129
|
+
placeholderTime: "HH:MM AM/PM",
|
|
4130
|
+
placeholderDateTime: "MM/DD/YYYY, HH:MM AM/PM",
|
|
4131
|
+
weekStartsOn: 0
|
|
4132
|
+
},
|
|
4133
|
+
es: {
|
|
4134
|
+
locale: "es-ES",
|
|
4135
|
+
dateFormat: "DD/MM/YYYY",
|
|
4136
|
+
timeFormat: "24",
|
|
4137
|
+
placeholderDate: "DD/MM/AAAA",
|
|
4138
|
+
placeholderTime: "HH:MM",
|
|
4139
|
+
placeholderDateTime: "DD/MM/AAAA HH:MM",
|
|
4140
|
+
weekStartsOn: 1
|
|
4141
|
+
},
|
|
4142
|
+
fr: {
|
|
4143
|
+
locale: "fr-FR",
|
|
4144
|
+
dateFormat: "DD/MM/YYYY",
|
|
4145
|
+
timeFormat: "24",
|
|
4146
|
+
placeholderDate: "JJ/MM/AAAA",
|
|
4147
|
+
placeholderTime: "HH:MM",
|
|
4148
|
+
placeholderDateTime: "JJ/MM/AAAA HH:MM",
|
|
4149
|
+
weekStartsOn: 1
|
|
4150
|
+
},
|
|
4151
|
+
it: {
|
|
4152
|
+
locale: "it-IT",
|
|
4153
|
+
dateFormat: "DD/MM/YYYY",
|
|
4154
|
+
timeFormat: "24",
|
|
4155
|
+
placeholderDate: "GG/MM/AAAA",
|
|
4156
|
+
placeholderTime: "HH:MM",
|
|
4157
|
+
placeholderDateTime: "GG/MM/AAAA HH:MM",
|
|
4158
|
+
weekStartsOn: 1
|
|
4159
|
+
},
|
|
4160
|
+
pl: {
|
|
4161
|
+
locale: "pl-PL",
|
|
4162
|
+
dateFormat: "DD.MM.YYYY",
|
|
4163
|
+
timeFormat: "24",
|
|
4164
|
+
placeholderDate: "DD.MM.RRRR",
|
|
4165
|
+
placeholderTime: "HH:MM",
|
|
4166
|
+
placeholderDateTime: "DD.MM.RRRR HH:MM",
|
|
4167
|
+
weekStartsOn: 1
|
|
4168
|
+
},
|
|
4169
|
+
uk: {
|
|
4170
|
+
locale: "uk-UA",
|
|
4171
|
+
dateFormat: "DD.MM.YYYY",
|
|
4172
|
+
timeFormat: "24",
|
|
4173
|
+
placeholderDate: "\u0414\u0414.\u041C\u041C.\u0420\u0420\u0420\u0420",
|
|
4174
|
+
placeholderTime: "\u0413\u0413:\u0425\u0425",
|
|
4175
|
+
placeholderDateTime: "\u0414\u0414.\u041C\u041C.\u0420\u0420\u0420\u0420 \u0413\u0413:\u0425\u0425",
|
|
4176
|
+
weekStartsOn: 1
|
|
4177
|
+
}
|
|
4178
|
+
};
|
|
4179
|
+
function getLocaleConfig(langCode) {
|
|
4180
|
+
const code = (langCode || "en").toLowerCase().substring(0, 2);
|
|
4181
|
+
return LOCALE_CONFIGS[code] || LOCALE_CONFIGS.en;
|
|
4182
|
+
}
|
|
4183
|
+
function getMonthNames(langCode) {
|
|
4184
|
+
const config = getLocaleConfig(langCode);
|
|
4185
|
+
const formatter = new Intl.DateTimeFormat(config.locale, { month: "long" });
|
|
4186
|
+
return Array.from({ length: 12 }, (_, i) => {
|
|
4187
|
+
const d = new Date(2026, i, 15);
|
|
4188
|
+
const name = formatter.format(d);
|
|
4189
|
+
return name.charAt(0).toUpperCase() + name.slice(1);
|
|
4190
|
+
});
|
|
4191
|
+
}
|
|
4192
|
+
function getDayOfWeekShortNames(langCode) {
|
|
4193
|
+
const config = getLocaleConfig(langCode);
|
|
4194
|
+
const formatter = new Intl.DateTimeFormat(config.locale, { weekday: "short" });
|
|
4195
|
+
const baseSunday = new Date(2026, 4, 10);
|
|
4196
|
+
const days = [];
|
|
4197
|
+
for (let i = 0; i < 7; i++) {
|
|
4198
|
+
const d = new Date(baseSunday);
|
|
4199
|
+
d.setDate(baseSunday.getDate() + i);
|
|
4200
|
+
const dayStr = formatter.format(d);
|
|
4201
|
+
days.push(dayStr.charAt(0).toUpperCase() + dayStr.slice(1, 3));
|
|
4202
|
+
}
|
|
4203
|
+
if (config.weekStartsOn === 1) {
|
|
4204
|
+
const sunday = days.shift();
|
|
4205
|
+
days.push(sunday);
|
|
4206
|
+
}
|
|
4207
|
+
return days;
|
|
4208
|
+
}
|
|
4209
|
+
function applyInputMask(val, langCode, mode) {
|
|
4210
|
+
const config = getLocaleConfig(langCode);
|
|
4211
|
+
const isSlash = config.dateFormat.includes("/");
|
|
4212
|
+
const dateSep = isSlash ? "/" : ".";
|
|
4213
|
+
const digits = val.replace(/\D/g, "");
|
|
4214
|
+
if (mode === "date") {
|
|
4215
|
+
const d = digits.slice(0, 8);
|
|
4216
|
+
let res = "";
|
|
4217
|
+
if (d.length > 0) res += d.slice(0, 2);
|
|
4218
|
+
if (d.length >= 2) res += dateSep;
|
|
4219
|
+
if (d.length > 2) res += d.slice(2, 4);
|
|
4220
|
+
if (d.length >= 4) res += dateSep;
|
|
4221
|
+
if (d.length > 4) res += d.slice(4, 8);
|
|
4222
|
+
return res;
|
|
4223
|
+
} else if (mode === "time") {
|
|
4224
|
+
const t = digits.slice(0, 4);
|
|
4225
|
+
let res = "";
|
|
4226
|
+
if (t.length > 0) res += t.slice(0, 2);
|
|
4227
|
+
if (t.length >= 2) res += ":";
|
|
4228
|
+
if (t.length > 2) res += t.slice(2, 4);
|
|
4229
|
+
return res;
|
|
4230
|
+
} else {
|
|
4231
|
+
const dt = digits.slice(0, 12);
|
|
4232
|
+
let res = "";
|
|
4233
|
+
if (dt.length > 0) res += dt.slice(0, 2);
|
|
4234
|
+
if (dt.length >= 2) res += dateSep;
|
|
4235
|
+
if (dt.length > 2) res += dt.slice(2, 4);
|
|
4236
|
+
if (dt.length >= 4) res += dateSep;
|
|
4237
|
+
if (dt.length > 4) res += dt.slice(4, 8);
|
|
4238
|
+
if (dt.length > 8) res += " " + dt.slice(8, 10);
|
|
4239
|
+
if (dt.length >= 10) res += ":";
|
|
4240
|
+
if (dt.length > 10) res += dt.slice(10, 12);
|
|
4241
|
+
return res;
|
|
4242
|
+
}
|
|
4243
|
+
}
|
|
4244
|
+
function parseDateFromMask(maskedStr, langCode, mode) {
|
|
4245
|
+
const config = getLocaleConfig(langCode);
|
|
4246
|
+
const digits = maskedStr.replace(/\D/g, "");
|
|
4247
|
+
if (mode === "date" && digits.length !== 8) return null;
|
|
4248
|
+
if (mode === "time" && digits.length !== 4) return null;
|
|
4249
|
+
if (mode === "datetime" && digits.length !== 12) return null;
|
|
4250
|
+
try {
|
|
4251
|
+
let day = 1, month = 0, year = 2026, hours = 0, minutes = 0;
|
|
4252
|
+
if (mode === "date" || mode === "datetime") {
|
|
4253
|
+
const isMMDD = config.dateFormat.startsWith("MM");
|
|
4254
|
+
if (isMMDD) {
|
|
4255
|
+
month = parseInt(digits.slice(0, 2), 10) - 1;
|
|
4256
|
+
day = parseInt(digits.slice(2, 4), 10);
|
|
4257
|
+
} else {
|
|
4258
|
+
day = parseInt(digits.slice(0, 2), 10);
|
|
4259
|
+
month = parseInt(digits.slice(2, 4), 10) - 1;
|
|
4260
|
+
}
|
|
4261
|
+
year = parseInt(digits.slice(4, 8), 10);
|
|
4262
|
+
if (month < 0 || month > 11) return null;
|
|
4263
|
+
if (day < 1 || day > 31) return null;
|
|
4264
|
+
if (year < 1900 || year > 2100) return null;
|
|
4265
|
+
}
|
|
4266
|
+
if (mode === "time") {
|
|
4267
|
+
hours = parseInt(digits.slice(0, 2), 10);
|
|
4268
|
+
minutes = parseInt(digits.slice(2, 4), 10);
|
|
4269
|
+
if (hours < 0 || hours > 23) return null;
|
|
4270
|
+
if (minutes < 0 || minutes > 59) return null;
|
|
4271
|
+
} else if (mode === "datetime") {
|
|
4272
|
+
hours = parseInt(digits.slice(8, 10), 10);
|
|
4273
|
+
minutes = parseInt(digits.slice(10, 12), 10);
|
|
4274
|
+
if (hours < 0 || hours > 23) return null;
|
|
4275
|
+
if (minutes < 0 || minutes > 59) return null;
|
|
4276
|
+
}
|
|
4277
|
+
const d = new Date(year, month, day, hours, minutes, 0);
|
|
4278
|
+
if (isNaN(d.getTime())) return null;
|
|
4279
|
+
if (mode !== "time" && (d.getDate() !== day || d.getMonth() !== month)) return null;
|
|
4280
|
+
return d;
|
|
4281
|
+
} catch {
|
|
4282
|
+
return null;
|
|
4283
|
+
}
|
|
4284
|
+
}
|
|
4285
|
+
function formatDateByLocale(date, langCode, mode) {
|
|
4286
|
+
if (!date || isNaN(date.getTime())) return "";
|
|
4287
|
+
const config = getLocaleConfig(langCode);
|
|
4288
|
+
try {
|
|
4289
|
+
if (mode === "date") {
|
|
4290
|
+
return new Intl.DateTimeFormat(config.locale, {
|
|
4291
|
+
day: "2-digit",
|
|
4292
|
+
month: "2-digit",
|
|
4293
|
+
year: "numeric"
|
|
4294
|
+
}).format(date);
|
|
4295
|
+
} else if (mode === "time") {
|
|
4296
|
+
return new Intl.DateTimeFormat(config.locale, {
|
|
4297
|
+
hour: "2-digit",
|
|
4298
|
+
minute: "2-digit",
|
|
4299
|
+
hour12: config.timeFormat === "12"
|
|
4300
|
+
}).format(date);
|
|
4301
|
+
} else {
|
|
4302
|
+
return new Intl.DateTimeFormat(config.locale, {
|
|
4303
|
+
day: "2-digit",
|
|
4304
|
+
month: "2-digit",
|
|
4305
|
+
year: "numeric",
|
|
4306
|
+
hour: "2-digit",
|
|
4307
|
+
minute: "2-digit",
|
|
4308
|
+
hour12: config.timeFormat === "12"
|
|
4309
|
+
}).format(date);
|
|
4310
|
+
}
|
|
4311
|
+
} catch (err) {
|
|
4312
|
+
return date.toISOString();
|
|
4313
|
+
}
|
|
4314
|
+
}
|
|
4315
|
+
var DateTimePickerComponent = ({
|
|
4316
|
+
overrideNamespace,
|
|
4317
|
+
value = null,
|
|
4318
|
+
mode = "datetime",
|
|
4319
|
+
onDateChange,
|
|
4320
|
+
onChange,
|
|
4321
|
+
disabled = false,
|
|
4322
|
+
slotProps,
|
|
4323
|
+
copyTooltip = "Copy",
|
|
4324
|
+
copiedTooltip = "Copied!",
|
|
4325
|
+
clearTooltip = "Clear",
|
|
4326
|
+
lockTooltip = "Field is read-only",
|
|
4327
|
+
showLock = false,
|
|
4328
|
+
hideCopyButton = false,
|
|
4329
|
+
hideClearButton = false,
|
|
4330
|
+
error: customError,
|
|
4331
|
+
helperText: customHelperText,
|
|
4332
|
+
label,
|
|
4333
|
+
...props
|
|
4334
|
+
}) => {
|
|
4335
|
+
const namespace = "form_components";
|
|
4336
|
+
const { languages, currentLang } = useLocalization();
|
|
4337
|
+
const [isFocused, setIsFocused] = (0, import_react22.useState)(false);
|
|
4338
|
+
const [selectedDate, setSelectedDate] = (0, import_react22.useState)(() => {
|
|
4339
|
+
if (!value) return null;
|
|
4340
|
+
const d = typeof value === "string" ? new Date(value) : value;
|
|
4341
|
+
return isNaN(d.getTime()) ? null : d;
|
|
4342
|
+
});
|
|
4343
|
+
const activeLang = (0, import_react22.useMemo)(() => {
|
|
4344
|
+
return languages.find((l) => l.code.toLowerCase() === currentLang.toLowerCase()) || languages[0];
|
|
4345
|
+
}, [currentLang]);
|
|
4346
|
+
const [inputValue, setInputValue] = (0, import_react22.useState)(() => {
|
|
4347
|
+
return selectedDate ? formatDateByLocale(selectedDate, activeLang.code, mode) : "";
|
|
4348
|
+
});
|
|
4349
|
+
(0, import_react22.useEffect)(() => {
|
|
4350
|
+
if (value === null || value === "") {
|
|
4351
|
+
setSelectedDate(null);
|
|
4352
|
+
setInputValue("");
|
|
4353
|
+
} else {
|
|
4354
|
+
const parsed = typeof value === "string" ? new Date(value) : value;
|
|
4355
|
+
if (!isNaN(parsed.getTime())) {
|
|
4356
|
+
setSelectedDate(parsed);
|
|
4357
|
+
if (!isFocused) {
|
|
4358
|
+
setInputValue(formatDateByLocale(parsed, activeLang.code, mode));
|
|
4359
|
+
}
|
|
4360
|
+
}
|
|
4361
|
+
}
|
|
4362
|
+
}, [value, activeLang.code, mode, isFocused]);
|
|
4363
|
+
const [anchorEl, setAnchorEl] = (0, import_react22.useState)(null);
|
|
4364
|
+
const [copied, setCopied] = (0, import_react22.useState)(false);
|
|
4365
|
+
const [inputError, setInputError] = (0, import_react22.useState)(false);
|
|
4366
|
+
const [viewDate, setViewDate] = (0, import_react22.useState)(() => selectedDate || /* @__PURE__ */ new Date());
|
|
4367
|
+
const localeConfig = (0, import_react22.useMemo)(() => getLocaleConfig(activeLang.code), [activeLang]);
|
|
4368
|
+
const placeholderText = (0, import_react22.useMemo)(() => {
|
|
4369
|
+
if (mode === "date") return localeConfig.placeholderDate;
|
|
4370
|
+
if (mode === "time") return localeConfig.placeholderTime;
|
|
4371
|
+
return localeConfig.placeholderDateTime;
|
|
4372
|
+
}, [mode, localeConfig]);
|
|
4373
|
+
const isReadOnly = Boolean(slotProps?.htmlInput?.readOnly);
|
|
4374
|
+
const isLocked = disabled || isReadOnly;
|
|
4375
|
+
const notifyChanges = (newDate, updateText = true) => {
|
|
4376
|
+
setSelectedDate(newDate);
|
|
4377
|
+
const formatted = formatDateByLocale(newDate, activeLang.code, mode);
|
|
4378
|
+
if (updateText) {
|
|
4379
|
+
setInputValue(formatted);
|
|
4380
|
+
}
|
|
4381
|
+
setInputError(false);
|
|
4382
|
+
const iso = newDate ? newDate.toISOString() : "";
|
|
4383
|
+
if (onDateChange) {
|
|
4384
|
+
onDateChange({
|
|
4385
|
+
date: newDate,
|
|
4386
|
+
formatted,
|
|
4387
|
+
iso,
|
|
4388
|
+
mode
|
|
4389
|
+
});
|
|
4390
|
+
}
|
|
4391
|
+
if (onChange) {
|
|
4392
|
+
const syntheticEvent = {
|
|
4393
|
+
target: { value: iso },
|
|
4394
|
+
currentTarget: { value: iso }
|
|
4395
|
+
};
|
|
4396
|
+
onChange(syntheticEvent);
|
|
4397
|
+
}
|
|
4398
|
+
};
|
|
4399
|
+
const handleManualInput = (e) => {
|
|
4400
|
+
const rawVal = e.target.value;
|
|
4401
|
+
const masked = applyInputMask(rawVal, activeLang.code, mode);
|
|
4402
|
+
setInputValue(masked);
|
|
4403
|
+
if (onChange) {
|
|
4404
|
+
onChange(e);
|
|
4405
|
+
}
|
|
4406
|
+
if (!masked.trim()) {
|
|
4407
|
+
notifyChanges(null, false);
|
|
4408
|
+
setInputError(false);
|
|
4409
|
+
return;
|
|
4410
|
+
}
|
|
4411
|
+
const parsedDate = parseDateFromMask(masked, activeLang.code, mode);
|
|
4412
|
+
if (parsedDate) {
|
|
4413
|
+
setInputError(false);
|
|
4414
|
+
notifyChanges(parsedDate, false);
|
|
4415
|
+
} else {
|
|
4416
|
+
const digits = masked.replace(/\D/g, "");
|
|
4417
|
+
const expectedDigits = mode === "date" ? 8 : mode === "time" ? 4 : 12;
|
|
4418
|
+
if (digits.length === expectedDigits) {
|
|
4419
|
+
setInputError(true);
|
|
4420
|
+
} else {
|
|
4421
|
+
setInputError(false);
|
|
4422
|
+
}
|
|
4423
|
+
if (onDateChange) {
|
|
4424
|
+
onDateChange({
|
|
4425
|
+
date: null,
|
|
4426
|
+
formatted: masked,
|
|
4427
|
+
iso: "",
|
|
4428
|
+
mode
|
|
4429
|
+
});
|
|
4430
|
+
}
|
|
4431
|
+
}
|
|
4432
|
+
};
|
|
4433
|
+
const handleOpenPicker = (event) => {
|
|
4434
|
+
if (isLocked) return;
|
|
4435
|
+
setViewDate(selectedDate || /* @__PURE__ */ new Date());
|
|
4436
|
+
setAnchorEl(event.currentTarget);
|
|
4437
|
+
};
|
|
4438
|
+
const handleClosePicker = () => {
|
|
4439
|
+
setAnchorEl(null);
|
|
4440
|
+
};
|
|
4441
|
+
const handleClear = (e) => {
|
|
4442
|
+
e.stopPropagation();
|
|
4443
|
+
notifyChanges(null, true);
|
|
4444
|
+
};
|
|
4445
|
+
const handleCopy = async (e) => {
|
|
4446
|
+
e.stopPropagation();
|
|
4447
|
+
if (!inputValue || copied) return;
|
|
4448
|
+
let success = false;
|
|
4449
|
+
if (navigator.clipboard && window.isSecureContext) {
|
|
4450
|
+
try {
|
|
4451
|
+
await navigator.clipboard.writeText(inputValue);
|
|
4452
|
+
success = true;
|
|
4453
|
+
} catch {
|
|
4454
|
+
}
|
|
4455
|
+
}
|
|
4456
|
+
if (!success) {
|
|
4457
|
+
try {
|
|
4458
|
+
const textArea = document.createElement("textarea");
|
|
4459
|
+
textArea.value = inputValue;
|
|
4460
|
+
textArea.style.position = "fixed";
|
|
4461
|
+
textArea.style.left = "-999999px";
|
|
4462
|
+
document.body.appendChild(textArea);
|
|
4463
|
+
textArea.focus();
|
|
4464
|
+
textArea.select();
|
|
4465
|
+
success = document.execCommand("copy");
|
|
4466
|
+
document.body.removeChild(textArea);
|
|
4467
|
+
} catch (err) {
|
|
4468
|
+
console.warn("Copy fallback error", err);
|
|
4469
|
+
}
|
|
4470
|
+
}
|
|
4471
|
+
if (success) {
|
|
4472
|
+
setCopied(true);
|
|
4473
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
4474
|
+
}
|
|
4475
|
+
};
|
|
4476
|
+
const monthNames = (0, import_react22.useMemo)(() => getMonthNames(activeLang.code), [activeLang.code]);
|
|
4477
|
+
const dayShortNames = (0, import_react22.useMemo)(() => getDayOfWeekShortNames(activeLang.code), [activeLang.code]);
|
|
4478
|
+
const calendarGrid = (0, import_react22.useMemo)(() => {
|
|
4479
|
+
const year = viewDate.getFullYear();
|
|
4480
|
+
const month = viewDate.getMonth();
|
|
4481
|
+
const firstDayOfMonth = new Date(year, month, 1);
|
|
4482
|
+
const lastDayOfMonth = new Date(year, month + 1, 0);
|
|
4483
|
+
let startDayOfWeek = firstDayOfMonth.getDay();
|
|
4484
|
+
if (localeConfig.weekStartsOn === 1) {
|
|
4485
|
+
startDayOfWeek = (startDayOfWeek + 6) % 7;
|
|
4486
|
+
}
|
|
4487
|
+
const daysInMonth = lastDayOfMonth.getDate();
|
|
4488
|
+
const grid = [];
|
|
4489
|
+
for (let i = 0; i < startDayOfWeek; i++) {
|
|
4490
|
+
grid.push(null);
|
|
4491
|
+
}
|
|
4492
|
+
for (let d = 1; d <= daysInMonth; d++) {
|
|
4493
|
+
grid.push(new Date(year, month, d));
|
|
4494
|
+
}
|
|
4495
|
+
return grid;
|
|
4496
|
+
}, [viewDate, localeConfig.weekStartsOn]);
|
|
4497
|
+
const handleSelectDay = (day) => {
|
|
4498
|
+
const base = selectedDate ? new Date(selectedDate) : /* @__PURE__ */ new Date();
|
|
4499
|
+
base.setFullYear(day.getFullYear(), day.getMonth(), day.getDate());
|
|
4500
|
+
notifyChanges(base, true);
|
|
4501
|
+
if (mode === "date") {
|
|
4502
|
+
handleClosePicker();
|
|
4503
|
+
}
|
|
4504
|
+
};
|
|
4505
|
+
const handleTimeChange = (hours, minutes) => {
|
|
4506
|
+
const base = selectedDate ? new Date(selectedDate) : /* @__PURE__ */ new Date();
|
|
4507
|
+
base.setHours(hours);
|
|
4508
|
+
base.setMinutes(minutes);
|
|
4509
|
+
base.setSeconds(0);
|
|
4510
|
+
notifyChanges(base, true);
|
|
4511
|
+
};
|
|
4512
|
+
const isToday = (d) => {
|
|
4513
|
+
if (!d) return false;
|
|
4514
|
+
const now = /* @__PURE__ */ new Date();
|
|
4515
|
+
return d.getDate() === now.getDate() && d.getMonth() === now.getMonth() && d.getFullYear() === now.getFullYear();
|
|
4516
|
+
};
|
|
4517
|
+
const isSelected = (d) => {
|
|
4518
|
+
if (!d || !selectedDate) return false;
|
|
4519
|
+
return d.getDate() === selectedDate.getDate() && d.getMonth() === selectedDate.getMonth() && d.getFullYear() === selectedDate.getFullYear();
|
|
4520
|
+
};
|
|
4521
|
+
const getModeIcon = () => {
|
|
4522
|
+
if (mode === "date") return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_icons_material2.CalendarMonth, { fontSize: "small", color: "action" });
|
|
4523
|
+
if (mode === "time") return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_icons_material2.AccessTime, { fontSize: "small", color: "action" });
|
|
4524
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_icons_material2.Event, { fontSize: "small", color: "action" });
|
|
4525
|
+
};
|
|
4526
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_material15.Box, { sx: { width: "100%" }, children: [
|
|
4527
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4528
|
+
import_material15.TextField,
|
|
4529
|
+
{
|
|
4530
|
+
value: inputValue,
|
|
4531
|
+
onChange: handleManualInput,
|
|
4532
|
+
onFocus: (e) => {
|
|
4533
|
+
setIsFocused(true);
|
|
4534
|
+
if (props.onFocus) props.onFocus(e);
|
|
4535
|
+
},
|
|
4536
|
+
onBlur: (e) => {
|
|
4537
|
+
setIsFocused(false);
|
|
4538
|
+
if (selectedDate) {
|
|
4539
|
+
setInputValue(formatDateByLocale(selectedDate, activeLang.code, mode));
|
|
4540
|
+
}
|
|
4541
|
+
if (props.onBlur) props.onBlur(e);
|
|
4542
|
+
},
|
|
4543
|
+
disabled,
|
|
4544
|
+
placeholder: placeholderText,
|
|
4545
|
+
label,
|
|
4546
|
+
error: customError || inputError,
|
|
4547
|
+
margin: "dense",
|
|
4548
|
+
helperText: customHelperText || (inputError ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TranslateText, { overrideNamespace, children: "Invalid date or time format" }) : ""),
|
|
4549
|
+
sx: {
|
|
4550
|
+
"& .MuiInputLabel-asterisk": {
|
|
4551
|
+
color: "red",
|
|
4552
|
+
fontSize: "1.5rem"
|
|
4553
|
+
},
|
|
4554
|
+
"& .MuiInputBase-input": {
|
|
4555
|
+
color: isReadOnly ? "text.disabled" : void 0,
|
|
4556
|
+
fontWeight: 500,
|
|
4557
|
+
letterSpacing: "0.02em"
|
|
4558
|
+
}
|
|
4559
|
+
},
|
|
4560
|
+
...props,
|
|
4561
|
+
slotProps: {
|
|
4562
|
+
...slotProps,
|
|
4563
|
+
input: {
|
|
4564
|
+
...slotProps?.input || {},
|
|
4565
|
+
readOnly: isReadOnly,
|
|
4566
|
+
/* END ADORNMENT: Action Icons (Clear, Animated Copy, Lock, Trigger) */
|
|
4567
|
+
endAdornment: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_material15.InputAdornment, { position: "end", sx: { gap: 0.5 }, children: [
|
|
4568
|
+
inputValue && !isLocked && !hideClearButton && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TranslatableTooltipComponent, { title: clearTooltip, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4569
|
+
import_material15.IconButton,
|
|
4570
|
+
{
|
|
4571
|
+
size: "small",
|
|
4572
|
+
onClick: handleClear,
|
|
4573
|
+
edge: "end",
|
|
4574
|
+
"aria-label": "clear date input",
|
|
4575
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_icons_material2.Clear, { fontSize: "small" })
|
|
4576
|
+
}
|
|
4577
|
+
) }),
|
|
4578
|
+
inputValue && !hideCopyButton && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TranslatableTooltipComponent, { title: copied ? copiedTooltip : copyTooltip, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4579
|
+
import_material15.IconButton,
|
|
4580
|
+
{
|
|
4581
|
+
size: "small",
|
|
4582
|
+
onClick: handleCopy,
|
|
4583
|
+
edge: "end",
|
|
4584
|
+
"aria-label": "copy date value",
|
|
4585
|
+
color: copied ? "success" : "default",
|
|
4586
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
4587
|
+
import_material15.Box,
|
|
4588
|
+
{
|
|
4589
|
+
sx: {
|
|
4590
|
+
display: "flex",
|
|
4591
|
+
alignItems: "center",
|
|
4592
|
+
justifyContent: "center",
|
|
4593
|
+
position: "relative",
|
|
4594
|
+
width: 20,
|
|
4595
|
+
height: 20
|
|
4596
|
+
},
|
|
4597
|
+
children: [
|
|
4598
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4599
|
+
import_icons_material2.ContentCopy,
|
|
4600
|
+
{
|
|
4601
|
+
fontSize: "small",
|
|
4602
|
+
sx: {
|
|
4603
|
+
position: "absolute",
|
|
4604
|
+
transition: "all 0.25s cubic-bezier(0.4, 0, 0.2, 1)",
|
|
4605
|
+
opacity: copied ? 0 : 1,
|
|
4606
|
+
transform: copied ? "scale(0.5) rotate(-45deg)" : "scale(1) rotate(0deg)"
|
|
4607
|
+
}
|
|
4608
|
+
}
|
|
4609
|
+
),
|
|
4610
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4611
|
+
import_icons_material2.Check,
|
|
4612
|
+
{
|
|
4613
|
+
fontSize: "small",
|
|
4614
|
+
color: "success",
|
|
4615
|
+
sx: {
|
|
4616
|
+
position: "absolute",
|
|
4617
|
+
transition: "all 0.25s cubic-bezier(0.4, 0, 0.2, 1)",
|
|
4618
|
+
opacity: copied ? 1 : 0,
|
|
4619
|
+
transform: copied ? "scale(1) rotate(0deg)" : "scale(0.5) rotate(45deg)"
|
|
4620
|
+
}
|
|
4621
|
+
}
|
|
4622
|
+
)
|
|
4623
|
+
]
|
|
4624
|
+
}
|
|
4625
|
+
)
|
|
4626
|
+
}
|
|
4627
|
+
) }),
|
|
4628
|
+
!isLocked && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4629
|
+
import_material15.IconButton,
|
|
4630
|
+
{
|
|
4631
|
+
size: "small",
|
|
4632
|
+
onClick: handleOpenPicker,
|
|
4633
|
+
edge: "end",
|
|
4634
|
+
color: Boolean(anchorEl) ? "primary" : "default",
|
|
4635
|
+
children: getModeIcon()
|
|
4636
|
+
}
|
|
4637
|
+
),
|
|
4638
|
+
isLocked && showLock && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TranslatableTooltipComponent, { title: lockTooltip, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4639
|
+
import_material15.IconButton,
|
|
4640
|
+
{
|
|
4641
|
+
size: "small",
|
|
4642
|
+
disabled: true,
|
|
4643
|
+
edge: "end",
|
|
4644
|
+
"aria-label": "locked input",
|
|
4645
|
+
sx: {
|
|
4646
|
+
"&.Mui-disabled": {
|
|
4647
|
+
color: "text.secondary"
|
|
4648
|
+
}
|
|
4649
|
+
},
|
|
4650
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_icons_material2.Lock, { fontSize: "small" })
|
|
4651
|
+
}
|
|
4652
|
+
) }),
|
|
4653
|
+
slotProps?.input?.endAdornment
|
|
4654
|
+
] })
|
|
4655
|
+
}
|
|
4656
|
+
}
|
|
4657
|
+
}
|
|
4658
|
+
),
|
|
4659
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4660
|
+
import_material15.Popover,
|
|
4661
|
+
{
|
|
4662
|
+
open: Boolean(anchorEl),
|
|
4663
|
+
anchorEl,
|
|
4664
|
+
onClose: handleClosePicker,
|
|
4665
|
+
anchorOrigin: {
|
|
4666
|
+
vertical: "bottom",
|
|
4667
|
+
horizontal: "left"
|
|
4668
|
+
},
|
|
4669
|
+
transformOrigin: {
|
|
4670
|
+
vertical: "top",
|
|
4671
|
+
horizontal: "left"
|
|
4672
|
+
},
|
|
4673
|
+
slotProps: {
|
|
4674
|
+
paper: {
|
|
4675
|
+
elevation: 6,
|
|
4676
|
+
sx: {
|
|
4677
|
+
p: 2,
|
|
4678
|
+
width: 320,
|
|
4679
|
+
//borderRadius: 3,
|
|
4680
|
+
mt: 1,
|
|
4681
|
+
border: "1px solid",
|
|
4682
|
+
borderColor: "divider"
|
|
4683
|
+
}
|
|
4684
|
+
}
|
|
4685
|
+
},
|
|
4686
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_material15.Box, { children: [
|
|
4687
|
+
mode !== "time" && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_material15.Box, { children: [
|
|
4688
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_material15.Box, { sx: { display: "flex", alignItems: "center", justifyContent: "space-between", mb: 1 }, children: [
|
|
4689
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4690
|
+
import_material15.IconButton,
|
|
4691
|
+
{
|
|
4692
|
+
size: "small",
|
|
4693
|
+
onClick: () => setViewDate(new Date(viewDate.getFullYear(), viewDate.getMonth() - 1, 1)),
|
|
4694
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_icons_material2.ChevronLeft, {})
|
|
4695
|
+
}
|
|
4696
|
+
),
|
|
4697
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_material15.Typography, { variant: "body2", sx: { fontWeight: 700 }, children: [
|
|
4698
|
+
monthNames[viewDate.getMonth()],
|
|
4699
|
+
" ",
|
|
4700
|
+
viewDate.getFullYear()
|
|
4701
|
+
] }),
|
|
4702
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4703
|
+
import_material15.IconButton,
|
|
4704
|
+
{
|
|
4705
|
+
size: "small",
|
|
4706
|
+
onClick: () => setViewDate(new Date(viewDate.getFullYear(), viewDate.getMonth() + 1, 1)),
|
|
4707
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_icons_material2.ChevronRight, {})
|
|
4708
|
+
}
|
|
4709
|
+
)
|
|
4710
|
+
] }),
|
|
4711
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material15.Grid, { container: true, columns: 7, sx: { mb: 0.5, textAlign: "center" }, children: dayShortNames.map((dayName, idx) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material15.Grid, { size: { xs: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4712
|
+
import_material15.Typography,
|
|
4713
|
+
{
|
|
4714
|
+
variant: "caption",
|
|
4715
|
+
color: "secondary",
|
|
4716
|
+
sx: { fontSize: "0.7rem", fontWeight: 700 },
|
|
4717
|
+
children: dayName
|
|
4718
|
+
}
|
|
4719
|
+
) }, idx)) }),
|
|
4720
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material15.Grid, { container: true, columns: 7, spacing: 0.5, sx: { textAlign: "center", mb: 2 }, children: calendarGrid.map((day, idx) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material15.Grid, { size: { xs: 1 }, children: day ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4721
|
+
import_material15.Button,
|
|
4722
|
+
{
|
|
4723
|
+
size: "small",
|
|
4724
|
+
onClick: () => handleSelectDay(day),
|
|
4725
|
+
sx: {
|
|
4726
|
+
minWidth: 0,
|
|
4727
|
+
width: "100%",
|
|
4728
|
+
height: 32,
|
|
4729
|
+
p: 0,
|
|
4730
|
+
borderRadius: "50%",
|
|
4731
|
+
fontSize: "0.8rem",
|
|
4732
|
+
fontWeight: isSelected(day) || isToday(day) ? 700 : 400,
|
|
4733
|
+
bgcolor: isSelected(day) ? "primary.main" : isToday(day) ? "action.hover" : "transparent",
|
|
4734
|
+
color: isSelected(day) ? "primary.contrastText" : isToday(day) ? "primary.main" : "text.primary",
|
|
4735
|
+
border: isToday(day) && !isSelected(day) ? "1px solid" : "none",
|
|
4736
|
+
borderColor: "primary.main",
|
|
4737
|
+
"&:hover": {
|
|
4738
|
+
bgcolor: isSelected(day) ? "primary.dark" : "action.selected"
|
|
4739
|
+
}
|
|
4740
|
+
},
|
|
4741
|
+
children: day.getDate()
|
|
4742
|
+
}
|
|
4743
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material15.Box, { sx: { height: 32 } }) }, idx)) })
|
|
4744
|
+
] }),
|
|
4745
|
+
mode !== "date" && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_material15.Box, { sx: { pt: mode === "datetime" ? 1.5 : 0, borderTop: mode === "datetime" ? "1px solid" : "none", borderColor: "divider" }, children: [
|
|
4746
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_material15.Typography, { variant: "caption", color: "secondary", sx: { fontWeight: 700, display: "block", mb: 1 }, children: [
|
|
4747
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TranslateText, { overrideNamespace, children: `Time Selection (${localeConfig.timeFormat === "12" ? "12-hour AM/PM" : "24-hour format"})` }),
|
|
4748
|
+
":"
|
|
4749
|
+
] }),
|
|
4750
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_material15.Box, { sx: { display: "flex", alignItems: "center", justifyContent: "center", gap: 1, my: 1 }, children: [
|
|
4751
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4752
|
+
import_material15.Select,
|
|
4753
|
+
{
|
|
4754
|
+
size: "small",
|
|
4755
|
+
value: (selectedDate || /* @__PURE__ */ new Date()).getHours(),
|
|
4756
|
+
onChange: (e) => handleTimeChange(Number(e.target.value), (selectedDate || /* @__PURE__ */ new Date()).getMinutes()),
|
|
4757
|
+
sx: { minWidth: 70 },
|
|
4758
|
+
children: Array.from({ length: 24 }, (_, i) => {
|
|
4759
|
+
let labelStr = i.toString().padStart(2, "0");
|
|
4760
|
+
if (localeConfig.timeFormat === "12") {
|
|
4761
|
+
const period = i >= 12 ? "PM" : "AM";
|
|
4762
|
+
const h12 = i % 12 || 12;
|
|
4763
|
+
labelStr = `${h12} ${period}`;
|
|
4764
|
+
}
|
|
4765
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material15.MenuItem, { value: i, children: labelStr }, i);
|
|
4766
|
+
})
|
|
4767
|
+
}
|
|
4768
|
+
),
|
|
4769
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material15.Typography, { variant: "h6", sx: { fontWeight: 700 }, children: ":" }),
|
|
4770
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4771
|
+
import_material15.Select,
|
|
4772
|
+
{
|
|
4773
|
+
size: "small",
|
|
4774
|
+
value: Math.floor((selectedDate || /* @__PURE__ */ new Date()).getMinutes() / 5) * 5,
|
|
4775
|
+
onChange: (e) => handleTimeChange((selectedDate || /* @__PURE__ */ new Date()).getHours(), Number(e.target.value)),
|
|
4776
|
+
sx: { minWidth: 70 },
|
|
4777
|
+
children: Array.from({ length: 12 }, (_, i) => i * 5).map((m) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material15.MenuItem, { value: m, children: m.toString().padStart(2, "0") }, m))
|
|
4778
|
+
}
|
|
4779
|
+
)
|
|
4780
|
+
] })
|
|
4781
|
+
] }),
|
|
4782
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material15.Divider, { sx: { my: 1.5 } }),
|
|
4783
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_material15.Box, { sx: { display: "flex", flexWrap: "wrap", gap: 1, justifyContent: "space-between" }, children: [
|
|
4784
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4785
|
+
import_material15.Button,
|
|
4786
|
+
{
|
|
4787
|
+
size: "small",
|
|
4788
|
+
variant: "outlined",
|
|
4789
|
+
startIcon: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_icons_material2.Today, { fontSize: "inherit" }),
|
|
4790
|
+
onClick: () => {
|
|
4791
|
+
const now = /* @__PURE__ */ new Date();
|
|
4792
|
+
notifyChanges(now, true);
|
|
4793
|
+
if (mode === "date") handleClosePicker();
|
|
4794
|
+
},
|
|
4795
|
+
sx: { fontSize: "0.72rem", py: 0.3 },
|
|
4796
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TranslateText, { overrideNamespace: overrideNamespace || "form_components", children: "Now" })
|
|
4797
|
+
}
|
|
4798
|
+
),
|
|
4799
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4800
|
+
import_material15.Button,
|
|
4801
|
+
{
|
|
4802
|
+
size: "small",
|
|
4803
|
+
variant: "contained",
|
|
4804
|
+
onClick: handleClosePicker,
|
|
4805
|
+
sx: { fontSize: "0.72rem", py: 0.3 },
|
|
4806
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TranslateText, { overrideNamespace: overrideNamespace || "form_components", children: "Done" })
|
|
4807
|
+
}
|
|
4808
|
+
)
|
|
4809
|
+
] })
|
|
4810
|
+
] })
|
|
4811
|
+
}
|
|
4812
|
+
)
|
|
4813
|
+
] });
|
|
4814
|
+
};
|
|
4815
|
+
|
|
4816
|
+
// src/UI/components/buttons/ButtonComponent.tsx
|
|
4817
|
+
var import_react23 = require("react");
|
|
4818
|
+
var import_material16 = require("@mui/material");
|
|
4819
|
+
init_context();
|
|
4820
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
4821
|
+
var ButtonComponent = (0, import_react23.forwardRef)(
|
|
4112
4822
|
({ label, children, overrideNamespace, ...props }, ref) => {
|
|
4113
4823
|
const renderContent = (content) => {
|
|
4114
4824
|
if (typeof content === "string") {
|
|
4115
|
-
return /* @__PURE__ */ (0,
|
|
4825
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TranslateText, { overrideNamespace, children: content });
|
|
4116
4826
|
}
|
|
4117
4827
|
return content;
|
|
4118
4828
|
};
|
|
4119
4829
|
const contentToRender = label !== void 0 ? label : children;
|
|
4120
|
-
return /* @__PURE__ */ (0,
|
|
4830
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material16.Button, { ref, ...props, children: renderContent(contentToRender) });
|
|
4121
4831
|
}
|
|
4122
4832
|
);
|
|
4123
4833
|
ButtonComponent.displayName = "ButtonComponent";
|
|
@@ -4126,13 +4836,13 @@ ButtonComponent.displayName = "ButtonComponent";
|
|
|
4126
4836
|
init_CopyClipboardButtonComponent();
|
|
4127
4837
|
|
|
4128
4838
|
// src/UI/components/buttons/RefreshButtonComponent.tsx
|
|
4129
|
-
var
|
|
4130
|
-
var
|
|
4839
|
+
var import_react25 = require("react");
|
|
4840
|
+
var import_material18 = require("@mui/material");
|
|
4131
4841
|
var import_Refresh = __toESM(require("@mui/icons-material/Refresh"));
|
|
4132
4842
|
init_context();
|
|
4133
4843
|
init_TranslatableTooltipComponent();
|
|
4134
|
-
var
|
|
4135
|
-
var AnimatedRefreshIcon = (0,
|
|
4844
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
4845
|
+
var AnimatedRefreshIcon = (0, import_material18.styled)(import_Refresh.default, {
|
|
4136
4846
|
shouldForwardProp: (prop) => prop !== "isSpinning"
|
|
4137
4847
|
})(({ isSpinning }) => ({
|
|
4138
4848
|
animation: isSpinning ? "spin 1s linear infinite" : "none",
|
|
@@ -4159,7 +4869,7 @@ var RefreshButtonComponent = ({
|
|
|
4159
4869
|
hideTooltipOnDesktop
|
|
4160
4870
|
}) => {
|
|
4161
4871
|
const { displayState } = useAppTheme();
|
|
4162
|
-
const [internalLoading, setInternalLoading] = (0,
|
|
4872
|
+
const [internalLoading, setInternalLoading] = (0, import_react25.useState)(false);
|
|
4163
4873
|
const isLoading = externalLoading !== void 0 ? externalLoading : internalLoading;
|
|
4164
4874
|
const handleClick = async (event) => {
|
|
4165
4875
|
if (!onClick || isLoading || disabled) return;
|
|
@@ -4170,10 +4880,10 @@ var RefreshButtonComponent = ({
|
|
|
4170
4880
|
setInternalLoading(false);
|
|
4171
4881
|
}
|
|
4172
4882
|
};
|
|
4173
|
-
const renderIcon = () => /* @__PURE__ */ (0,
|
|
4883
|
+
const renderIcon = () => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(AnimatedRefreshIcon, { fontSize: size, isSpinning: isLoading });
|
|
4174
4884
|
if (displayState.isMobile && !disableMobileView || mobileViewOnly) {
|
|
4175
|
-
return /* @__PURE__ */ (0,
|
|
4176
|
-
|
|
4885
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TranslatableTooltipComponent, { title: hideTooltipOnMobile ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_jsx_runtime28.Fragment, {}) : tooltip || /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TranslateText, { overrideNamespace: overrideNamespace || "form_components", children: "Refresh" }), children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4886
|
+
import_material18.Fab,
|
|
4177
4887
|
{
|
|
4178
4888
|
size,
|
|
4179
4889
|
color: "inherit",
|
|
@@ -4184,8 +4894,8 @@ var RefreshButtonComponent = ({
|
|
|
4184
4894
|
}
|
|
4185
4895
|
) }) });
|
|
4186
4896
|
}
|
|
4187
|
-
return /* @__PURE__ */ (0,
|
|
4188
|
-
|
|
4897
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TranslatableTooltipComponent, { title: hideTooltipOnDesktop ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_jsx_runtime28.Fragment, {}) : tooltip || /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TranslateText, { overrideNamespace: overrideNamespace || "form_components", children: "Refresh" }), children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4898
|
+
import_material18.Button,
|
|
4189
4899
|
{
|
|
4190
4900
|
variant: "contained",
|
|
4191
4901
|
color: "inherit",
|
|
@@ -4194,7 +4904,7 @@ var RefreshButtonComponent = ({
|
|
|
4194
4904
|
disabled: disabled || isLoading,
|
|
4195
4905
|
fullWidth,
|
|
4196
4906
|
startIcon: renderIcon(),
|
|
4197
|
-
children: /* @__PURE__ */ (0,
|
|
4907
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TranslateText, { overrideNamespace: overrideNamespace || "form_components", children: "Refresh" })
|
|
4198
4908
|
}
|
|
4199
4909
|
) });
|
|
4200
4910
|
};
|
|
@@ -4203,11 +4913,11 @@ var RefreshButtonComponent = ({
|
|
|
4203
4913
|
init_TranslatableTooltipComponent();
|
|
4204
4914
|
|
|
4205
4915
|
// src/UI/components/data.display/UserAvatarComponent.tsx
|
|
4206
|
-
var
|
|
4207
|
-
var
|
|
4916
|
+
var import_react27 = require("react");
|
|
4917
|
+
var import_material22 = require("@mui/material");
|
|
4208
4918
|
init_context();
|
|
4209
|
-
var
|
|
4210
|
-
var LazyUserPopover = (0,
|
|
4919
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
4920
|
+
var LazyUserPopover = (0, import_react27.lazy)(() => Promise.resolve().then(() => (init_UserPopoverComponent(), UserPopoverComponent_exports)));
|
|
4211
4921
|
var getInitials = (name) => {
|
|
4212
4922
|
if (!name) return "?";
|
|
4213
4923
|
const parts = name.trim().split(" ");
|
|
@@ -4229,11 +4939,11 @@ var UserAvatarComponent = ({
|
|
|
4229
4939
|
sx = {}
|
|
4230
4940
|
}) => {
|
|
4231
4941
|
const supabase = useSupabase();
|
|
4232
|
-
const [anchorEl, setAnchorEl] = (0,
|
|
4233
|
-
const [hasInteracted, setHasInteracted] = (0,
|
|
4234
|
-
const [resolvedAvatarUrl, setResolvedAvatarUrl] = (0,
|
|
4942
|
+
const [anchorEl, setAnchorEl] = (0, import_react27.useState)(null);
|
|
4943
|
+
const [hasInteracted, setHasInteracted] = (0, import_react27.useState)(false);
|
|
4944
|
+
const [resolvedAvatarUrl, setResolvedAvatarUrl] = (0, import_react27.useState)(null);
|
|
4235
4945
|
const canShowPopover = !disablePopover && Boolean(userId);
|
|
4236
|
-
(0,
|
|
4946
|
+
(0, import_react27.useEffect)(() => {
|
|
4237
4947
|
let isMounted = true;
|
|
4238
4948
|
const resolveAvatar = async () => {
|
|
4239
4949
|
if (!avatarUrl) {
|
|
@@ -4278,13 +4988,13 @@ var UserAvatarComponent = ({
|
|
|
4278
4988
|
};
|
|
4279
4989
|
const isPopoverOpen = Boolean(anchorEl);
|
|
4280
4990
|
const initials = getInitials(displayName || "");
|
|
4281
|
-
const getTooltip = /* @__PURE__ */ (0,
|
|
4282
|
-
/* @__PURE__ */ (0,
|
|
4283
|
-
displayName && employeePost && /* @__PURE__ */ (0,
|
|
4991
|
+
const getTooltip = /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
4992
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material22.Typography, { component: "div", variant: "caption", children: displayName }),
|
|
4993
|
+
displayName && employeePost && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material22.Typography, { component: "div", variant: "caption", children: employeePost })
|
|
4284
4994
|
] });
|
|
4285
|
-
return /* @__PURE__ */ (0,
|
|
4286
|
-
/* @__PURE__ */ (0,
|
|
4287
|
-
|
|
4995
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
4996
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material22.Tooltip, { title: disableTooltip || isPopoverOpen ? "" : getTooltip, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4997
|
+
import_material22.Avatar,
|
|
4288
4998
|
{
|
|
4289
4999
|
src: resolvedAvatarUrl || void 0,
|
|
4290
5000
|
alt: displayName || "User Avatar",
|
|
@@ -4309,7 +5019,7 @@ var UserAvatarComponent = ({
|
|
|
4309
5019
|
children: !resolvedAvatarUrl && initials
|
|
4310
5020
|
}
|
|
4311
5021
|
) }),
|
|
4312
|
-
canShowPopover && hasInteracted && /* @__PURE__ */ (0,
|
|
5022
|
+
canShowPopover && hasInteracted && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react27.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4313
5023
|
LazyUserPopover,
|
|
4314
5024
|
{
|
|
4315
5025
|
userId,
|
|
@@ -4327,10 +5037,10 @@ init_UserRoleChipComponent();
|
|
|
4327
5037
|
init_UserStatusChipComponent();
|
|
4328
5038
|
|
|
4329
5039
|
// src/UI/components/data.display/MyAvatarComponent.tsx
|
|
4330
|
-
var
|
|
4331
|
-
var
|
|
5040
|
+
var import_react28 = require("react");
|
|
5041
|
+
var import_material23 = require("@mui/material");
|
|
4332
5042
|
init_context();
|
|
4333
|
-
var
|
|
5043
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
4334
5044
|
var getInitials2 = (name) => {
|
|
4335
5045
|
if (!name) return "?";
|
|
4336
5046
|
const parts = name.trim().split(" ");
|
|
@@ -4347,7 +5057,7 @@ var MyAvatarComponent = ({
|
|
|
4347
5057
|
sx = {}
|
|
4348
5058
|
}) => {
|
|
4349
5059
|
const { profile: userProfile, loading: isLoading } = useAuth();
|
|
4350
|
-
const [anchorEl, setAnchorEl] = (0,
|
|
5060
|
+
const [anchorEl, setAnchorEl] = (0, import_react28.useState)(null);
|
|
4351
5061
|
const handlePopoverOpen = (event) => {
|
|
4352
5062
|
if (!disablePopover) {
|
|
4353
5063
|
setAnchorEl(event.currentTarget);
|
|
@@ -4358,8 +5068,8 @@ var MyAvatarComponent = ({
|
|
|
4358
5068
|
};
|
|
4359
5069
|
const isPopoverOpen = Boolean(anchorEl);
|
|
4360
5070
|
if (isLoading) {
|
|
4361
|
-
return /* @__PURE__ */ (0,
|
|
4362
|
-
|
|
5071
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
5072
|
+
import_material23.Skeleton,
|
|
4363
5073
|
{
|
|
4364
5074
|
variant: "circular",
|
|
4365
5075
|
width: size,
|
|
@@ -4369,9 +5079,9 @@ var MyAvatarComponent = ({
|
|
|
4369
5079
|
);
|
|
4370
5080
|
}
|
|
4371
5081
|
const initials = getInitials2(userProfile?.display_name || "");
|
|
4372
|
-
return /* @__PURE__ */ (0,
|
|
4373
|
-
/* @__PURE__ */ (0,
|
|
4374
|
-
|
|
5082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
5083
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
5084
|
+
import_material23.Avatar,
|
|
4375
5085
|
{
|
|
4376
5086
|
src: userProfile?.avatar_url || void 0,
|
|
4377
5087
|
alt: userProfile?.display_name || "User Avatar",
|
|
@@ -4397,8 +5107,8 @@ var MyAvatarComponent = ({
|
|
|
4397
5107
|
children: !userProfile?.avatar_url && initials
|
|
4398
5108
|
}
|
|
4399
5109
|
),
|
|
4400
|
-
!disablePopover && /* @__PURE__ */ (0,
|
|
4401
|
-
|
|
5110
|
+
!disablePopover && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
5111
|
+
import_material23.Popover,
|
|
4402
5112
|
{
|
|
4403
5113
|
id: `avatar-popover-${userProfile?.id}`,
|
|
4404
5114
|
open: isPopoverOpen,
|
|
@@ -4428,9 +5138,9 @@ var MyAvatarComponent = ({
|
|
|
4428
5138
|
}
|
|
4429
5139
|
}
|
|
4430
5140
|
},
|
|
4431
|
-
children: /* @__PURE__ */ (0,
|
|
4432
|
-
/* @__PURE__ */ (0,
|
|
4433
|
-
userProfile?.email && /* @__PURE__ */ (0,
|
|
5141
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_material23.Box, { sx: { display: "flex", flexDirection: "column", alignItems: "center", gap: 0.5 }, children: [
|
|
5142
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_material23.Typography, { variant: "subtitle2", sx: { fontWeight: 600 }, children: userProfile?.display_name }),
|
|
5143
|
+
userProfile?.email && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_material23.Typography, { variant: "caption", color: "text.secondary", children: userProfile.email })
|
|
4434
5144
|
] })
|
|
4435
5145
|
}
|
|
4436
5146
|
)
|
|
@@ -4438,10 +5148,10 @@ var MyAvatarComponent = ({
|
|
|
4438
5148
|
};
|
|
4439
5149
|
|
|
4440
5150
|
// src/UI/components/data.display/ExpandableNoteComponent.tsx
|
|
4441
|
-
var
|
|
4442
|
-
var
|
|
5151
|
+
var import_react29 = require("react");
|
|
5152
|
+
var import_material24 = require("@mui/material");
|
|
4443
5153
|
init_context();
|
|
4444
|
-
var
|
|
5154
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
4445
5155
|
var ExpandableNoteComponent = ({
|
|
4446
5156
|
overrideNamespace,
|
|
4447
5157
|
text,
|
|
@@ -4450,7 +5160,7 @@ var ExpandableNoteComponent = ({
|
|
|
4450
5160
|
sx,
|
|
4451
5161
|
...restProps
|
|
4452
5162
|
}) => {
|
|
4453
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
5163
|
+
const [isExpanded, setIsExpanded] = (0, import_react29.useState)(false);
|
|
4454
5164
|
if (!text) return null;
|
|
4455
5165
|
const isLong = text.length > maxLength;
|
|
4456
5166
|
const displayedText = isExpanded || !isLong ? text : `${text.slice(0, maxLength).trim()}...`;
|
|
@@ -4458,8 +5168,8 @@ var ExpandableNoteComponent = ({
|
|
|
4458
5168
|
e.stopPropagation();
|
|
4459
5169
|
setIsExpanded((prev) => !prev);
|
|
4460
5170
|
};
|
|
4461
|
-
return /* @__PURE__ */ (0,
|
|
4462
|
-
|
|
5171
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
5172
|
+
import_material24.Typography,
|
|
4463
5173
|
{
|
|
4464
5174
|
variant: "caption",
|
|
4465
5175
|
sx: {
|
|
@@ -4470,15 +5180,15 @@ var ExpandableNoteComponent = ({
|
|
|
4470
5180
|
},
|
|
4471
5181
|
...restProps,
|
|
4472
5182
|
children: [
|
|
4473
|
-
label !== void 0 ? label : /* @__PURE__ */ (0,
|
|
4474
|
-
/* @__PURE__ */ (0,
|
|
5183
|
+
label !== void 0 ? label : /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
5184
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(TranslateText, { overrideNamespace: overrideNamespace || "form_components", children: "Note" }),
|
|
4475
5185
|
": "
|
|
4476
5186
|
] }),
|
|
4477
5187
|
" ",
|
|
4478
5188
|
displayedText,
|
|
4479
5189
|
" ",
|
|
4480
|
-
isLong && /* @__PURE__ */ (0,
|
|
4481
|
-
|
|
5190
|
+
isLong && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5191
|
+
import_material24.Link,
|
|
4482
5192
|
{
|
|
4483
5193
|
component: "button",
|
|
4484
5194
|
type: "button",
|
|
@@ -4492,8 +5202,8 @@ var ExpandableNoteComponent = ({
|
|
|
4492
5202
|
cursor: "pointer",
|
|
4493
5203
|
verticalAlign: "baseline"
|
|
4494
5204
|
},
|
|
4495
|
-
children: isExpanded ? /* @__PURE__ */ (0,
|
|
4496
|
-
/* @__PURE__ */ (0,
|
|
5205
|
+
children: isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(TranslateText, { overrideNamespace: overrideNamespace || "form_components", children: "less" }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
5206
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(TranslateText, { overrideNamespace: overrideNamespace || "form_components", children: "more" }),
|
|
4497
5207
|
"..."
|
|
4498
5208
|
] })
|
|
4499
5209
|
}
|
|
@@ -4504,16 +5214,16 @@ var ExpandableNoteComponent = ({
|
|
|
4504
5214
|
};
|
|
4505
5215
|
|
|
4506
5216
|
// src/UI/components/data.display/ErrorAlertComponent.tsx
|
|
4507
|
-
var
|
|
5217
|
+
var import_material25 = require("@mui/material");
|
|
4508
5218
|
var import_Replay = __toESM(require("@mui/icons-material/Replay"));
|
|
4509
5219
|
init_context();
|
|
4510
|
-
var
|
|
5220
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
4511
5221
|
var ErrorIllustration = ({ size = 64 }) => {
|
|
4512
|
-
const theme = (0,
|
|
5222
|
+
const theme = (0, import_material25.useTheme)();
|
|
4513
5223
|
const mainColor = theme.palette.error.main;
|
|
4514
5224
|
const lightColor = theme.palette.error.light;
|
|
4515
|
-
return /* @__PURE__ */ (0,
|
|
4516
|
-
|
|
5225
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5226
|
+
import_material25.Box,
|
|
4517
5227
|
{
|
|
4518
5228
|
sx: {
|
|
4519
5229
|
display: "flex",
|
|
@@ -4521,7 +5231,7 @@ var ErrorIllustration = ({ size = 64 }) => {
|
|
|
4521
5231
|
justifyContent: "center",
|
|
4522
5232
|
flexShrink: 0
|
|
4523
5233
|
},
|
|
4524
|
-
children: /* @__PURE__ */ (0,
|
|
5234
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
4525
5235
|
"svg",
|
|
4526
5236
|
{
|
|
4527
5237
|
width: size,
|
|
@@ -4530,7 +5240,7 @@ var ErrorIllustration = ({ size = 64 }) => {
|
|
|
4530
5240
|
fill: "none",
|
|
4531
5241
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4532
5242
|
children: [
|
|
4533
|
-
/* @__PURE__ */ (0,
|
|
5243
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
4534
5244
|
"circle",
|
|
4535
5245
|
{
|
|
4536
5246
|
cx: "50",
|
|
@@ -4539,7 +5249,7 @@ var ErrorIllustration = ({ size = 64 }) => {
|
|
|
4539
5249
|
fill: lightColor,
|
|
4540
5250
|
fillOpacity: "0.25",
|
|
4541
5251
|
children: [
|
|
4542
|
-
/* @__PURE__ */ (0,
|
|
5252
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4543
5253
|
"animate",
|
|
4544
5254
|
{
|
|
4545
5255
|
attributeName: "r",
|
|
@@ -4548,7 +5258,7 @@ var ErrorIllustration = ({ size = 64 }) => {
|
|
|
4548
5258
|
repeatCount: "indefinite"
|
|
4549
5259
|
}
|
|
4550
5260
|
),
|
|
4551
|
-
/* @__PURE__ */ (0,
|
|
5261
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4552
5262
|
"animate",
|
|
4553
5263
|
{
|
|
4554
5264
|
attributeName: "fill-opacity",
|
|
@@ -4560,8 +5270,8 @@ var ErrorIllustration = ({ size = 64 }) => {
|
|
|
4560
5270
|
]
|
|
4561
5271
|
}
|
|
4562
5272
|
),
|
|
4563
|
-
/* @__PURE__ */ (0,
|
|
4564
|
-
/* @__PURE__ */ (0,
|
|
5273
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("circle", { cx: "50", cy: "50", r: "34", fill: lightColor, fillOpacity: "0.35" }),
|
|
5274
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4565
5275
|
"path",
|
|
4566
5276
|
{
|
|
4567
5277
|
d: "M50 20L80 72H20L50 20Z",
|
|
@@ -4571,7 +5281,7 @@ var ErrorIllustration = ({ size = 64 }) => {
|
|
|
4571
5281
|
strokeLinejoin: "round"
|
|
4572
5282
|
}
|
|
4573
5283
|
),
|
|
4574
|
-
/* @__PURE__ */ (0,
|
|
5284
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4575
5285
|
"path",
|
|
4576
5286
|
{
|
|
4577
5287
|
d: "M50 36V54",
|
|
@@ -4580,10 +5290,10 @@ var ErrorIllustration = ({ size = 64 }) => {
|
|
|
4580
5290
|
strokeLinecap: "round"
|
|
4581
5291
|
}
|
|
4582
5292
|
),
|
|
4583
|
-
/* @__PURE__ */ (0,
|
|
4584
|
-
/* @__PURE__ */ (0,
|
|
4585
|
-
/* @__PURE__ */ (0,
|
|
4586
|
-
/* @__PURE__ */ (0,
|
|
5293
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("circle", { cx: "50", cy: "62", r: "2.5", fill: "#FFFFFF" }),
|
|
5294
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("circle", { cx: "16", cy: "30", r: "3", fill: mainColor, opacity: "0.4" }),
|
|
5295
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("circle", { cx: "84", cy: "30", r: "2", fill: mainColor, opacity: "0.6" }),
|
|
5296
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("circle", { cx: "88", cy: "68", r: "3", fill: mainColor, opacity: "0.3" })
|
|
4587
5297
|
]
|
|
4588
5298
|
}
|
|
4589
5299
|
)
|
|
@@ -4598,8 +5308,8 @@ var ErrorAlertComponent = ({
|
|
|
4598
5308
|
retryText = "Retry",
|
|
4599
5309
|
isRetrying = false
|
|
4600
5310
|
}) => {
|
|
4601
|
-
return /* @__PURE__ */ (0,
|
|
4602
|
-
|
|
5311
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5312
|
+
import_material25.Alert,
|
|
4603
5313
|
{
|
|
4604
5314
|
severity: "error",
|
|
4605
5315
|
icon: false,
|
|
@@ -4616,8 +5326,8 @@ var ErrorAlertComponent = ({
|
|
|
4616
5326
|
p: 0
|
|
4617
5327
|
}
|
|
4618
5328
|
},
|
|
4619
|
-
children: /* @__PURE__ */ (0,
|
|
4620
|
-
|
|
5329
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
5330
|
+
import_material25.Box,
|
|
4621
5331
|
{
|
|
4622
5332
|
sx: {
|
|
4623
5333
|
display: "flex",
|
|
@@ -4626,34 +5336,34 @@ var ErrorAlertComponent = ({
|
|
|
4626
5336
|
gap: 2
|
|
4627
5337
|
},
|
|
4628
5338
|
children: [
|
|
4629
|
-
/* @__PURE__ */ (0,
|
|
4630
|
-
/* @__PURE__ */ (0,
|
|
4631
|
-
typeof title === "string" ? /* @__PURE__ */ (0,
|
|
4632
|
-
|
|
5339
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ErrorIllustration, { size: 68 }),
|
|
5340
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_material25.Box, { sx: { flexGrow: 1 }, children: [
|
|
5341
|
+
typeof title === "string" ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5342
|
+
import_material25.Typography,
|
|
4633
5343
|
{
|
|
4634
5344
|
variant: "subtitle1",
|
|
4635
5345
|
sx: { fontWeight: 600, color: "error.main", mb: 0.5 },
|
|
4636
|
-
children: /* @__PURE__ */ (0,
|
|
5346
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TranslateText, { overrideNamespace, children: title })
|
|
4637
5347
|
}
|
|
4638
5348
|
) : title,
|
|
4639
|
-
typeof message === "string" ? /* @__PURE__ */ (0,
|
|
5349
|
+
typeof message === "string" ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_material25.Typography, { variant: "body2", color: "text.secondary", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TranslateText, { overrideNamespace, children: message }) }) : message
|
|
4640
5350
|
] }),
|
|
4641
|
-
onRetry && /* @__PURE__ */ (0,
|
|
4642
|
-
|
|
5351
|
+
onRetry && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5352
|
+
import_material25.Box,
|
|
4643
5353
|
{
|
|
4644
5354
|
sx: {
|
|
4645
5355
|
alignSelf: { xs: "flex-end", sm: "center" },
|
|
4646
5356
|
mt: { xs: 1, sm: 0 }
|
|
4647
5357
|
},
|
|
4648
|
-
children: /* @__PURE__ */ (0,
|
|
4649
|
-
|
|
5358
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5359
|
+
import_material25.Button,
|
|
4650
5360
|
{
|
|
4651
5361
|
variant: "outlined",
|
|
4652
5362
|
color: "error",
|
|
4653
5363
|
size: "small",
|
|
4654
5364
|
disabled: isRetrying,
|
|
4655
5365
|
onClick: onRetry,
|
|
4656
|
-
startIcon: /* @__PURE__ */ (0,
|
|
5366
|
+
startIcon: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4657
5367
|
import_Replay.default,
|
|
4658
5368
|
{
|
|
4659
5369
|
sx: {
|
|
@@ -4685,12 +5395,12 @@ var ErrorAlertComponent = ({
|
|
|
4685
5395
|
);
|
|
4686
5396
|
};
|
|
4687
5397
|
|
|
4688
|
-
// src/UI/components/data.display/
|
|
4689
|
-
var
|
|
4690
|
-
var
|
|
5398
|
+
// src/UI/components/data.display/TruncatedTypographyComponent.tsx
|
|
5399
|
+
var import_react30 = require("react");
|
|
5400
|
+
var import_material26 = require("@mui/material");
|
|
4691
5401
|
init_TranslatableTooltipComponent();
|
|
4692
|
-
var
|
|
4693
|
-
var
|
|
5402
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
5403
|
+
var TruncatedTypographyComponent = ({
|
|
4694
5404
|
children,
|
|
4695
5405
|
lines = 1,
|
|
4696
5406
|
tooltipProps,
|
|
@@ -4698,8 +5408,8 @@ var TruncatedTypography = ({
|
|
|
4698
5408
|
sx,
|
|
4699
5409
|
...typographyProps
|
|
4700
5410
|
}) => {
|
|
4701
|
-
const textRef = (0,
|
|
4702
|
-
const [isTruncated, setIsTruncated] = (0,
|
|
5411
|
+
const textRef = (0, import_react30.useRef)(null);
|
|
5412
|
+
const [isTruncated, setIsTruncated] = (0, import_react30.useState)(false);
|
|
4703
5413
|
const checkOverflow = () => {
|
|
4704
5414
|
const element = textRef.current;
|
|
4705
5415
|
if (!element) return;
|
|
@@ -4709,7 +5419,7 @@ var TruncatedTypography = ({
|
|
|
4709
5419
|
setIsTruncated(element.scrollHeight > element.clientHeight);
|
|
4710
5420
|
}
|
|
4711
5421
|
};
|
|
4712
|
-
(0,
|
|
5422
|
+
(0, import_react30.useEffect)(() => {
|
|
4713
5423
|
checkOverflow();
|
|
4714
5424
|
window.addEventListener("resize", checkOverflow);
|
|
4715
5425
|
return () => window.removeEventListener("resize", checkOverflow);
|
|
@@ -4727,14 +5437,14 @@ var TruncatedTypography = ({
|
|
|
4727
5437
|
whiteSpace: "nowrap"
|
|
4728
5438
|
};
|
|
4729
5439
|
const textContent = typeof children === "string" ? children : void 0;
|
|
4730
|
-
return /* @__PURE__ */ (0,
|
|
5440
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4731
5441
|
TranslatableTooltipComponent,
|
|
4732
5442
|
{
|
|
4733
5443
|
title: alwaysShowTooltip || isTruncated ? textContent || children : "",
|
|
4734
5444
|
disableHoverListener: !alwaysShowTooltip && !isTruncated,
|
|
4735
5445
|
...tooltipProps,
|
|
4736
|
-
children: /* @__PURE__ */ (0,
|
|
4737
|
-
|
|
5446
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5447
|
+
import_material26.Typography,
|
|
4738
5448
|
{
|
|
4739
5449
|
ref: textRef,
|
|
4740
5450
|
sx: {
|
|
@@ -4750,14 +5460,14 @@ var TruncatedTypography = ({
|
|
|
4750
5460
|
};
|
|
4751
5461
|
|
|
4752
5462
|
// src/UI/components/layout/PageComponent.tsx
|
|
4753
|
-
var
|
|
4754
|
-
var
|
|
5463
|
+
var import_react31 = __toESM(require("react"));
|
|
5464
|
+
var import_material27 = require("@mui/material");
|
|
4755
5465
|
var import_MoreVert = __toESM(require("@mui/icons-material/MoreVert"));
|
|
4756
5466
|
var import_KeyboardArrowDown = __toESM(require("@mui/icons-material/KeyboardArrowDown"));
|
|
4757
|
-
var
|
|
5467
|
+
var import_icons_material4 = require("@mui/icons-material");
|
|
4758
5468
|
init_context();
|
|
4759
5469
|
init_TranslatableTooltipComponent();
|
|
4760
|
-
var
|
|
5470
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
4761
5471
|
var getTruncateStyles = (mode = "truncate") => {
|
|
4762
5472
|
switch (mode) {
|
|
4763
5473
|
case "truncate":
|
|
@@ -4785,10 +5495,10 @@ var PageHeader = ({
|
|
|
4785
5495
|
forceMobileView,
|
|
4786
5496
|
sx = []
|
|
4787
5497
|
}) => {
|
|
4788
|
-
const theme = (0,
|
|
4789
|
-
const mediaIsMobile = (0,
|
|
5498
|
+
const theme = (0, import_material27.useTheme)();
|
|
5499
|
+
const mediaIsMobile = (0, import_material27.useMediaQuery)(theme.breakpoints.down(mobileBreakpoint));
|
|
4790
5500
|
const isMobile = forceMobileView ?? mediaIsMobile;
|
|
4791
|
-
const [anchorEl, setAnchorEl] = (0,
|
|
5501
|
+
const [anchorEl, setAnchorEl] = (0, import_react31.useState)(null);
|
|
4792
5502
|
const isMenuOpen = Boolean(anchorEl);
|
|
4793
5503
|
const handleOpenMenu = (e) => setAnchorEl(e.currentTarget);
|
|
4794
5504
|
const handleCloseMenu = () => setAnchorEl(null);
|
|
@@ -4798,8 +5508,8 @@ var PageHeader = ({
|
|
|
4798
5508
|
};
|
|
4799
5509
|
const hasSecondaryActions = secondaryActions.length > 0;
|
|
4800
5510
|
const hasActions = Boolean(primaryAction || hasSecondaryActions || refreshAction);
|
|
4801
|
-
return /* @__PURE__ */ (0,
|
|
4802
|
-
|
|
5511
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
5512
|
+
import_material27.Box,
|
|
4803
5513
|
{
|
|
4804
5514
|
sx: [
|
|
4805
5515
|
{
|
|
@@ -4817,9 +5527,9 @@ var PageHeader = ({
|
|
|
4817
5527
|
...Array.isArray(sx) ? sx : [sx]
|
|
4818
5528
|
],
|
|
4819
5529
|
children: [
|
|
4820
|
-
/* @__PURE__ */ (0,
|
|
4821
|
-
icon && /* @__PURE__ */ (0,
|
|
4822
|
-
|
|
5530
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_material27.Box, { sx: { display: "flex", alignItems: "center", gap: { xs: 1.5, sm: 2 }, minWidth: 0, flex: 1 }, children: [
|
|
5531
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
5532
|
+
import_material27.Box,
|
|
4823
5533
|
{
|
|
4824
5534
|
sx: {
|
|
4825
5535
|
display: "flex",
|
|
@@ -4838,10 +5548,10 @@ var PageHeader = ({
|
|
|
4838
5548
|
children: icon
|
|
4839
5549
|
}
|
|
4840
5550
|
),
|
|
4841
|
-
/* @__PURE__ */ (0,
|
|
4842
|
-
tag && /* @__PURE__ */ (0,
|
|
4843
|
-
/* @__PURE__ */ (0,
|
|
4844
|
-
|
|
5551
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_material27.Box, { sx: { minWidth: 0, flex: 1 }, children: [
|
|
5552
|
+
tag && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_material27.Box, { sx: { mb: 0.5, display: "flex", alignItems: "center" }, children: tag }),
|
|
5553
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_material27.Tooltip, { title: titleTruncateMode === "truncate" ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TranslateText, { children: title }) : void 0, arrow: true, placement: "top", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
5554
|
+
import_material27.Typography,
|
|
4845
5555
|
{
|
|
4846
5556
|
variant: "h5",
|
|
4847
5557
|
component: "h1",
|
|
@@ -4852,11 +5562,11 @@ var PageHeader = ({
|
|
|
4852
5562
|
lineHeight: 1.3,
|
|
4853
5563
|
...getTruncateStyles(titleTruncateMode)
|
|
4854
5564
|
},
|
|
4855
|
-
children: /* @__PURE__ */ (0,
|
|
5565
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TranslateText, { children: title })
|
|
4856
5566
|
}
|
|
4857
5567
|
) }),
|
|
4858
|
-
subtitle && /* @__PURE__ */ (0,
|
|
4859
|
-
|
|
5568
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_material27.Tooltip, { title: subtitleTruncateMode === "truncate" ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TranslateText, { children: subtitle }) : void 0, arrow: true, placement: "top", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
5569
|
+
import_material27.Typography,
|
|
4860
5570
|
{
|
|
4861
5571
|
variant: "body2",
|
|
4862
5572
|
sx: {
|
|
@@ -4866,24 +5576,24 @@ var PageHeader = ({
|
|
|
4866
5576
|
lineHeight: 1.4,
|
|
4867
5577
|
...getTruncateStyles(subtitleTruncateMode)
|
|
4868
5578
|
},
|
|
4869
|
-
children: /* @__PURE__ */ (0,
|
|
5579
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TranslateText, { children: subtitle })
|
|
4870
5580
|
}
|
|
4871
5581
|
) })
|
|
4872
5582
|
] })
|
|
4873
5583
|
] }),
|
|
4874
|
-
hasActions && /* @__PURE__ */ (0,
|
|
5584
|
+
hasActions && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_material27.Box, { sx: { flexShrink: 0, display: "flex", alignItems: "center", gap: 1 }, children: isMobile ? (
|
|
4875
5585
|
/* MOBILE: IconButton with MoreVertIcon showing ALL actions inside Menu */
|
|
4876
|
-
/* @__PURE__ */ (0,
|
|
4877
|
-
/* @__PURE__ */ (0,
|
|
4878
|
-
|
|
5586
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
5587
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TranslatableTooltipComponent, { title: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TranslateText, { overrideNamespace: overrideNamespace || "form_components", children: "Actions" }), children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
5588
|
+
import_material27.IconButton,
|
|
4879
5589
|
{
|
|
4880
5590
|
onClick: handleOpenMenu,
|
|
4881
5591
|
sx: { border: "1px solid", borderColor: "divider", borderRadius: 2, p: 1 },
|
|
4882
|
-
children: /* @__PURE__ */ (0,
|
|
5592
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_MoreVert.default, {})
|
|
4883
5593
|
}
|
|
4884
5594
|
) }),
|
|
4885
|
-
/* @__PURE__ */ (0,
|
|
4886
|
-
|
|
5595
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
5596
|
+
import_material27.Menu,
|
|
4887
5597
|
{
|
|
4888
5598
|
anchorEl,
|
|
4889
5599
|
open: isMenuOpen,
|
|
@@ -4892,9 +5602,9 @@ var PageHeader = ({
|
|
|
4892
5602
|
anchorOrigin: { horizontal: "right", vertical: "bottom" },
|
|
4893
5603
|
slotProps: { paper: { elevation: 4, sx: { minWidth: 200, borderRadius: 2, mt: 1, p: 0.5 } } },
|
|
4894
5604
|
children: [
|
|
4895
|
-
primaryAction && /* @__PURE__ */ (0,
|
|
4896
|
-
/* @__PURE__ */ (0,
|
|
4897
|
-
|
|
5605
|
+
primaryAction && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
5606
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
5607
|
+
import_material27.MenuItem,
|
|
4898
5608
|
{
|
|
4899
5609
|
onClick: () => handleMenuAction(primaryAction.onClick),
|
|
4900
5610
|
disabled: primaryAction.disabled,
|
|
@@ -4907,32 +5617,32 @@ var PageHeader = ({
|
|
|
4907
5617
|
px: 1.5
|
|
4908
5618
|
},
|
|
4909
5619
|
children: [
|
|
4910
|
-
primaryAction.icon && /* @__PURE__ */ (0,
|
|
4911
|
-
/* @__PURE__ */ (0,
|
|
5620
|
+
primaryAction.icon && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_material27.ListItemIcon, { sx: { color: "inherit", minWidth: 32 }, children: primaryAction.icon }),
|
|
5621
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_material27.ListItemText, { primary: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TranslateText, { children: primaryAction.label }), slotProps: { primary: { sx: { fontWeight: 700, fontSize: "0.9rem" } } } })
|
|
4912
5622
|
]
|
|
4913
5623
|
}
|
|
4914
5624
|
),
|
|
4915
|
-
hasSecondaryActions && /* @__PURE__ */ (0,
|
|
5625
|
+
hasSecondaryActions && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_material27.Divider, { sx: { my: 0.75 } })
|
|
4916
5626
|
] }),
|
|
4917
|
-
secondaryActions.map((action) => /* @__PURE__ */ (0,
|
|
4918
|
-
action.divider && /* @__PURE__ */ (0,
|
|
4919
|
-
/* @__PURE__ */ (0,
|
|
4920
|
-
|
|
5627
|
+
secondaryActions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_react31.default.Fragment, { children: [
|
|
5628
|
+
action.divider && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_material27.Divider, { sx: { my: 0.5 } }),
|
|
5629
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
5630
|
+
import_material27.MenuItem,
|
|
4921
5631
|
{
|
|
4922
5632
|
onClick: () => handleMenuAction(action.onClick),
|
|
4923
5633
|
disabled: action.disabled,
|
|
4924
5634
|
sx: { borderRadius: 1, py: 1, px: 1.5, color: action.color ? `${action.color}.main` : "text.primary" },
|
|
4925
5635
|
children: [
|
|
4926
|
-
action.icon && /* @__PURE__ */ (0,
|
|
4927
|
-
/* @__PURE__ */ (0,
|
|
5636
|
+
action.icon && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_material27.ListItemIcon, { sx: { color: action.color ? `${action.color}.main` : "text.secondary", minWidth: 32 }, children: action.icon }),
|
|
5637
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_material27.ListItemText, { primary: action.label, slotProps: { primary: { sx: { fontSize: "0.875rem" } } } })
|
|
4928
5638
|
]
|
|
4929
5639
|
}
|
|
4930
5640
|
)
|
|
4931
5641
|
] }, action.id)),
|
|
4932
|
-
refreshAction && /* @__PURE__ */ (0,
|
|
4933
|
-
/* @__PURE__ */ (0,
|
|
4934
|
-
/* @__PURE__ */ (0,
|
|
4935
|
-
|
|
5642
|
+
refreshAction && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
5643
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_material27.Divider, { sx: { my: 0.5 } }),
|
|
5644
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
5645
|
+
import_material27.MenuItem,
|
|
4936
5646
|
{
|
|
4937
5647
|
onClick: () => handleMenuAction(refreshAction.onClick),
|
|
4938
5648
|
disabled: refreshAction.disabled,
|
|
@@ -4944,8 +5654,8 @@ var PageHeader = ({
|
|
|
4944
5654
|
px: 1.5
|
|
4945
5655
|
},
|
|
4946
5656
|
children: [
|
|
4947
|
-
/* @__PURE__ */ (0,
|
|
4948
|
-
/* @__PURE__ */ (0,
|
|
5657
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_material27.ListItemIcon, { sx: { color: "inherit", minWidth: 32 }, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_icons_material4.Refresh, {}) }),
|
|
5658
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_material27.ListItemText, { primary: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TranslateText, { overrideNamespace: overrideNamespace || "form_components", children: "Refresh" }), slotProps: { primary: { sx: { fontWeight: 700, fontSize: "0.9rem" } } } })
|
|
4949
5659
|
]
|
|
4950
5660
|
}
|
|
4951
5661
|
)
|
|
@@ -4956,10 +5666,10 @@ var PageHeader = ({
|
|
|
4956
5666
|
] })
|
|
4957
5667
|
) : (
|
|
4958
5668
|
/* DESKTOP: Primary Action Button + Secondary Actions Dropdown Button */
|
|
4959
|
-
/* @__PURE__ */ (0,
|
|
4960
|
-
(primaryAction || refreshAction) && /* @__PURE__ */ (0,
|
|
4961
|
-
primaryAction && /* @__PURE__ */ (0,
|
|
4962
|
-
|
|
5669
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_material27.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
5670
|
+
(primaryAction || refreshAction) && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_material27.Stack, { direction: "row", spacing: 2, children: [
|
|
5671
|
+
primaryAction && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
5672
|
+
import_material27.Button,
|
|
4963
5673
|
{
|
|
4964
5674
|
variant: primaryAction.variant || "contained",
|
|
4965
5675
|
color: primaryAction.color || "primary",
|
|
@@ -4967,32 +5677,32 @@ var PageHeader = ({
|
|
|
4967
5677
|
disabled: primaryAction.disabled,
|
|
4968
5678
|
startIcon: primaryAction.icon,
|
|
4969
5679
|
sx: { borderRadius: 2, textTransform: "none", fontWeight: 600, px: 2, py: 0.85 },
|
|
4970
|
-
children: /* @__PURE__ */ (0,
|
|
5680
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TranslateText, { children: primaryAction.label })
|
|
4971
5681
|
}
|
|
4972
5682
|
),
|
|
4973
|
-
refreshAction && /* @__PURE__ */ (0,
|
|
4974
|
-
|
|
5683
|
+
refreshAction && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TranslatableTooltipComponent, { title: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TranslateText, { overrideNamespace: overrideNamespace || "form_components", children: "Refresh" }), children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
5684
|
+
import_material27.Fab,
|
|
4975
5685
|
{
|
|
4976
5686
|
color: "default",
|
|
4977
5687
|
onClick: refreshAction.onClick,
|
|
4978
5688
|
disabled: refreshAction.disabled,
|
|
4979
5689
|
"aria-label": "refresh",
|
|
4980
5690
|
size: "small",
|
|
4981
|
-
children: /* @__PURE__ */ (0,
|
|
5691
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_icons_material4.Refresh, {})
|
|
4982
5692
|
}
|
|
4983
5693
|
) })
|
|
4984
5694
|
] }),
|
|
4985
|
-
hasSecondaryActions && /* @__PURE__ */ (0,
|
|
4986
|
-
/* @__PURE__ */ (0,
|
|
4987
|
-
|
|
5695
|
+
hasSecondaryActions && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
5696
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
5697
|
+
import_material27.IconButton,
|
|
4988
5698
|
{
|
|
4989
5699
|
onClick: handleOpenMenu,
|
|
4990
5700
|
sx: { border: "1px solid", borderColor: "divider", borderRadius: 2, p: 1 },
|
|
4991
|
-
children: /* @__PURE__ */ (0,
|
|
5701
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_KeyboardArrowDown.default, {})
|
|
4992
5702
|
}
|
|
4993
5703
|
),
|
|
4994
|
-
/* @__PURE__ */ (0,
|
|
4995
|
-
|
|
5704
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
5705
|
+
import_material27.Menu,
|
|
4996
5706
|
{
|
|
4997
5707
|
anchorEl,
|
|
4998
5708
|
open: isMenuOpen,
|
|
@@ -5000,17 +5710,17 @@ var PageHeader = ({
|
|
|
5000
5710
|
transformOrigin: { horizontal: "right", vertical: "top" },
|
|
5001
5711
|
anchorOrigin: { horizontal: "right", vertical: "bottom" },
|
|
5002
5712
|
slotProps: { paper: { elevation: 4, sx: { minWidth: 180, borderRadius: 2, mt: 1, p: 0.5 } } },
|
|
5003
|
-
children: secondaryActions.map((action) => /* @__PURE__ */ (0,
|
|
5004
|
-
action.divider && /* @__PURE__ */ (0,
|
|
5005
|
-
/* @__PURE__ */ (0,
|
|
5006
|
-
|
|
5713
|
+
children: secondaryActions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_react31.default.Fragment, { children: [
|
|
5714
|
+
action.divider && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_material27.Divider, { sx: { my: 0.5 } }),
|
|
5715
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
5716
|
+
import_material27.MenuItem,
|
|
5007
5717
|
{
|
|
5008
5718
|
onClick: () => handleMenuAction(action.onClick),
|
|
5009
5719
|
disabled: action.disabled,
|
|
5010
5720
|
sx: { borderRadius: 1, py: 0.85, color: action.color ? `${action.color}.main` : "text.primary" },
|
|
5011
5721
|
children: [
|
|
5012
|
-
action.icon && /* @__PURE__ */ (0,
|
|
5013
|
-
/* @__PURE__ */ (0,
|
|
5722
|
+
action.icon && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_material27.ListItemIcon, { sx: { color: action.color ? `${action.color}.main` : "text.secondary", minWidth: 32 }, children: action.icon }),
|
|
5723
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_material27.ListItemText, { primary: action.label, slotProps: { primary: { sx: { fontSize: "0.875rem" } } } })
|
|
5014
5724
|
]
|
|
5015
5725
|
}
|
|
5016
5726
|
)
|
|
@@ -5020,14 +5730,14 @@ var PageHeader = ({
|
|
|
5020
5730
|
] })
|
|
5021
5731
|
] })
|
|
5022
5732
|
) }),
|
|
5023
|
-
customFragment && /* @__PURE__ */ (0,
|
|
5733
|
+
customFragment && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_jsx_runtime37.Fragment, { children: customFragment })
|
|
5024
5734
|
]
|
|
5025
5735
|
}
|
|
5026
5736
|
);
|
|
5027
5737
|
};
|
|
5028
5738
|
var PageContainer = ({ children }) => {
|
|
5029
|
-
return /* @__PURE__ */ (0,
|
|
5030
|
-
|
|
5739
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
5740
|
+
import_material27.Box,
|
|
5031
5741
|
{
|
|
5032
5742
|
sx: {
|
|
5033
5743
|
width: "100%",
|
|
@@ -5043,8 +5753,8 @@ var PageComponent = ({
|
|
|
5043
5753
|
header,
|
|
5044
5754
|
children
|
|
5045
5755
|
}) => {
|
|
5046
|
-
return /* @__PURE__ */ (0,
|
|
5047
|
-
|
|
5756
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
5757
|
+
import_material27.Box,
|
|
5048
5758
|
{
|
|
5049
5759
|
sx: {
|
|
5050
5760
|
//pt: 2,
|
|
@@ -5053,8 +5763,8 @@ var PageComponent = ({
|
|
|
5053
5763
|
overflowY: "auto",
|
|
5054
5764
|
boxSizing: "border-box"
|
|
5055
5765
|
},
|
|
5056
|
-
children: /* @__PURE__ */ (0,
|
|
5057
|
-
header && /* @__PURE__ */ (0,
|
|
5766
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(PageContainer, { children: [
|
|
5767
|
+
header && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(PageHeader, { ...header }),
|
|
5058
5768
|
children
|
|
5059
5769
|
] })
|
|
5060
5770
|
}
|
|
@@ -5062,9 +5772,9 @@ var PageComponent = ({
|
|
|
5062
5772
|
};
|
|
5063
5773
|
|
|
5064
5774
|
// src/UI/components/layout/FilterContainerComponent.tsx
|
|
5065
|
-
var
|
|
5066
|
-
var
|
|
5067
|
-
var
|
|
5775
|
+
var import_react32 = __toESM(require("react"));
|
|
5776
|
+
var import_material28 = require("@mui/material");
|
|
5777
|
+
var import_jsx_runtime38 = (
|
|
5068
5778
|
/* Автоматическая обертка каждого дочернего элемента в Grid size */
|
|
5069
5779
|
require("react/jsx-runtime")
|
|
5070
5780
|
);
|
|
@@ -5073,26 +5783,26 @@ var FilterContainerComponent = ({
|
|
|
5073
5783
|
children,
|
|
5074
5784
|
sx
|
|
5075
5785
|
}) => {
|
|
5076
|
-
return /* @__PURE__ */ (0,
|
|
5077
|
-
|
|
5786
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
5787
|
+
import_material28.Paper,
|
|
5078
5788
|
{
|
|
5079
5789
|
variant: "outlined",
|
|
5080
5790
|
sx: [
|
|
5081
5791
|
{ p: 2, mb: 3 },
|
|
5082
5792
|
...Array.isArray(sx) ? sx : [sx]
|
|
5083
5793
|
],
|
|
5084
|
-
children: /* @__PURE__ */ (0,
|
|
5794
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_material28.Grid, { container: true, spacing: 2, sx: { alignItems: "center" }, children: sections ? sections.map((sec, idx) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react32.default.Fragment, { children: sec }, idx)) : children })
|
|
5085
5795
|
}
|
|
5086
5796
|
);
|
|
5087
5797
|
};
|
|
5088
5798
|
|
|
5089
5799
|
// src/UI/components/layout/PageLinkComponent.tsx
|
|
5090
|
-
var
|
|
5091
|
-
var
|
|
5092
|
-
var
|
|
5800
|
+
var import_icons_material5 = require("@mui/icons-material");
|
|
5801
|
+
var import_material29 = require("@mui/material");
|
|
5802
|
+
var import_react33 = __toESM(require("react"));
|
|
5093
5803
|
var import_react_router_dom = require("react-router-dom");
|
|
5094
5804
|
init_context();
|
|
5095
|
-
var
|
|
5805
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
5096
5806
|
var PageLinkComponent = ({
|
|
5097
5807
|
overrideNamespace,
|
|
5098
5808
|
title,
|
|
@@ -5105,8 +5815,8 @@ var PageLinkComponent = ({
|
|
|
5105
5815
|
bgcolor
|
|
5106
5816
|
}) => {
|
|
5107
5817
|
const navigate = (0, import_react_router_dom.useNavigate)();
|
|
5108
|
-
return /* @__PURE__ */ (0,
|
|
5109
|
-
|
|
5818
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
5819
|
+
import_material29.Card,
|
|
5110
5820
|
{
|
|
5111
5821
|
sx: (theme) => ({
|
|
5112
5822
|
height: "100%",
|
|
@@ -5119,21 +5829,21 @@ var PageLinkComponent = ({
|
|
|
5119
5829
|
) : typeof bgcolor === "function" ? theme.palette.getContrastText(bgcolor(theme)) : theme.palette.getContrastText(bgcolor) : "text.primary"
|
|
5120
5830
|
}),
|
|
5121
5831
|
children: [
|
|
5122
|
-
/* @__PURE__ */ (0,
|
|
5123
|
-
|
|
5832
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
5833
|
+
import_material29.CardHeader,
|
|
5124
5834
|
{
|
|
5125
|
-
avatar: icon ?
|
|
5835
|
+
avatar: icon ? import_react33.default.cloneElement(icon, {
|
|
5126
5836
|
sx: { color: bgcolor ? "inherit" : "primary", ...icon.props.sx }
|
|
5127
|
-
}) : /* @__PURE__ */ (0,
|
|
5128
|
-
title: /* @__PURE__ */ (0,
|
|
5129
|
-
subheader: subheader && /* @__PURE__ */ (0,
|
|
5837
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_icons_material5.Settings, { color: bgcolor ? "inherit" : "primary" }),
|
|
5838
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_material29.Typography, { variant: "h6", component: "div", color: "inherit", children: typeof title === "string" ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TranslateText, { overrideNamespace, children: title }) : title }),
|
|
5839
|
+
subheader: subheader && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_material29.Typography, { variant: "body2", sx: { opacity: 0.8, color: "inherit" }, children: typeof subheader === "string" ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TranslateText, { overrideNamespace, children: subheader }) : subheader })
|
|
5130
5840
|
}
|
|
5131
5841
|
),
|
|
5132
|
-
/* @__PURE__ */ (0,
|
|
5133
|
-
/* @__PURE__ */ (0,
|
|
5134
|
-
/* @__PURE__ */ (0,
|
|
5135
|
-
links && links.length > 0 && /* @__PURE__ */ (0,
|
|
5136
|
-
|
|
5842
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_material29.Divider, { sx: { borderColor: "inherit", opacity: 0.2 } }),
|
|
5843
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_material29.CardContent, { sx: { flexGrow: 1 }, children: [
|
|
5844
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_material29.Typography, { variant: "body2", sx: { opacity: 0.85, color: "inherit" }, children: typeof description === "string" ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TranslateText, { overrideNamespace, children: description }) : description }),
|
|
5845
|
+
links && links.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_material29.List, { dense: true, disablePadding: true, children: links.filter((f) => !f.hidden).map((link, index) => /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
5846
|
+
import_material29.ListItem,
|
|
5137
5847
|
{
|
|
5138
5848
|
disablePadding: true,
|
|
5139
5849
|
sx: {
|
|
@@ -5144,18 +5854,18 @@ var PageLinkComponent = ({
|
|
|
5144
5854
|
}
|
|
5145
5855
|
},
|
|
5146
5856
|
children: [
|
|
5147
|
-
/* @__PURE__ */ (0,
|
|
5148
|
-
|
|
5857
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
5858
|
+
import_material29.ListItemIcon,
|
|
5149
5859
|
{
|
|
5150
5860
|
sx: { minWidth: 30, cursor: "pointer", color: "inherit" },
|
|
5151
5861
|
onClick: () => {
|
|
5152
5862
|
if (link?.href) navigate(link.href);
|
|
5153
5863
|
},
|
|
5154
|
-
children: /* @__PURE__ */ (0,
|
|
5864
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_icons_material5.ArrowRight, { fontSize: "small", color: "inherit" })
|
|
5155
5865
|
}
|
|
5156
5866
|
),
|
|
5157
|
-
/* @__PURE__ */ (0,
|
|
5158
|
-
|
|
5867
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_material29.ListItemText, { children: link.onClick ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
5868
|
+
import_material29.Button,
|
|
5159
5869
|
{
|
|
5160
5870
|
size: "small",
|
|
5161
5871
|
variant: "text",
|
|
@@ -5178,10 +5888,10 @@ var PageLinkComponent = ({
|
|
|
5178
5888
|
// Эффект подчеркивания, как у ссылки
|
|
5179
5889
|
}
|
|
5180
5890
|
},
|
|
5181
|
-
children: typeof link.text === "string" ? /* @__PURE__ */ (0,
|
|
5891
|
+
children: typeof link.text === "string" ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TranslateText, { overrideNamespace, children: link.text }) : link.text
|
|
5182
5892
|
}
|
|
5183
|
-
) : link.href ? /* @__PURE__ */ (0,
|
|
5184
|
-
|
|
5893
|
+
) : link.href ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
5894
|
+
import_material29.Link,
|
|
5185
5895
|
{
|
|
5186
5896
|
component: import_react_router_dom.Link,
|
|
5187
5897
|
to: link.href,
|
|
@@ -5198,29 +5908,29 @@ var PageLinkComponent = ({
|
|
|
5198
5908
|
backgroundColor: "transparent"
|
|
5199
5909
|
}
|
|
5200
5910
|
},
|
|
5201
|
-
children: typeof link.text === "string" ? /* @__PURE__ */ (0,
|
|
5911
|
+
children: typeof link.text === "string" ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TranslateText, { overrideNamespace, children: link.text }) : link.text
|
|
5202
5912
|
}
|
|
5203
|
-
) : /* @__PURE__ */ (0,
|
|
5913
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_material29.Typography, { variant: "body2", sx: { fontWeight: 500, color: "inherit" }, children: typeof link.text === "string" ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TranslateText, { overrideNamespace, children: link.text }) : link.text }) })
|
|
5204
5914
|
]
|
|
5205
5915
|
},
|
|
5206
5916
|
index
|
|
5207
5917
|
)) })
|
|
5208
5918
|
] }),
|
|
5209
|
-
actionButtonText && onActionButtonClick && /* @__PURE__ */ (0,
|
|
5919
|
+
actionButtonText && onActionButtonClick && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_material29.CardActions, { sx: { justifyContent: "flex-end", padding: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_material29.Button, { size: "small", variant: "contained", onClick: onActionButtonClick, children: typeof actionButtonText === "string" ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TranslateText, { overrideNamespace, children: actionButtonText }) : actionButtonText }) })
|
|
5210
5920
|
]
|
|
5211
5921
|
}
|
|
5212
5922
|
);
|
|
5213
5923
|
};
|
|
5214
5924
|
|
|
5215
5925
|
// src/UI/components/layout/CollapsedContainerComponent.tsx
|
|
5216
|
-
var
|
|
5217
|
-
var
|
|
5218
|
-
var
|
|
5926
|
+
var import_icons_material6 = require("@mui/icons-material");
|
|
5927
|
+
var import_material30 = require("@mui/material");
|
|
5928
|
+
var import_react34 = require("react");
|
|
5219
5929
|
init_context();
|
|
5220
|
-
var
|
|
5221
|
-
var ExpandMore = (0,
|
|
5930
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
5931
|
+
var ExpandMore = (0, import_material30.styled)((props) => {
|
|
5222
5932
|
const { expand, ...other } = props;
|
|
5223
|
-
return /* @__PURE__ */ (0,
|
|
5933
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_material30.IconButton, { size: "small", ...other, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_icons_material6.ExpandMore, {}) });
|
|
5224
5934
|
})(({ theme, expand }) => ({
|
|
5225
5935
|
transform: !expand ? "rotate(0deg)" : "rotate(180deg)",
|
|
5226
5936
|
transition: theme.transitions.create("transform", {
|
|
@@ -5235,14 +5945,14 @@ var ExpandMore = (0, import_material29.styled)((props) => {
|
|
|
5235
5945
|
}));
|
|
5236
5946
|
var CollapsedContainerComponent = (props) => {
|
|
5237
5947
|
const { displayState } = useAppTheme();
|
|
5238
|
-
const [expanded, setExpanded] = (0,
|
|
5948
|
+
const [expanded, setExpanded] = (0, import_react34.useState)(props.expanded === void 0 ? false : props.expanded);
|
|
5239
5949
|
const handleExpandClick = () => {
|
|
5240
5950
|
setExpanded(!expanded);
|
|
5241
5951
|
props.onExpanded && props.onExpanded(!expanded);
|
|
5242
5952
|
};
|
|
5243
|
-
return /* @__PURE__ */ (0,
|
|
5244
|
-
/* @__PURE__ */ (0,
|
|
5245
|
-
|
|
5953
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_material30.Card, { sx: { width: "100%", overflow: "hidden", mb: 2, boxShadow: displayState.isMobile ? "none" : props.disableShadow ? "none" : "0 20px 25px -5px rgb(0 0 0 / 0.1)", borderRadius: displayState.isMobile ? 0 : 1 }, children: [
|
|
5954
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
5955
|
+
import_material30.Box,
|
|
5246
5956
|
{
|
|
5247
5957
|
onClick: () => handleExpandClick(),
|
|
5248
5958
|
sx: {
|
|
@@ -5253,16 +5963,16 @@ var CollapsedContainerComponent = (props) => {
|
|
|
5253
5963
|
pr: 2
|
|
5254
5964
|
},
|
|
5255
5965
|
children: [
|
|
5256
|
-
/* @__PURE__ */ (0,
|
|
5257
|
-
|
|
5966
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
5967
|
+
import_material30.CardHeader,
|
|
5258
5968
|
{
|
|
5259
5969
|
sx: { flexGrow: 1 },
|
|
5260
|
-
avatar: /* @__PURE__ */ (0,
|
|
5261
|
-
title: typeof props.title === "string" ? /* @__PURE__ */ (0,
|
|
5262
|
-
subheader: typeof props.subtitle === "string" ? /* @__PURE__ */ (0,
|
|
5970
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_material30.Avatar, { sx: { bgcolor: "primary.main" }, children: props.icon }),
|
|
5971
|
+
title: typeof props.title === "string" ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_material30.Typography, { variant: "subtitle1", sx: { fontWeight: "700" }, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TranslateText, { overrideNamespace: props.overrideNamespace, children: props.title }) }) : props.title,
|
|
5972
|
+
subheader: typeof props.subtitle === "string" ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TranslateText, { overrideNamespace: props.overrideNamespace, children: props.subtitle }) : props.subtitle
|
|
5263
5973
|
}
|
|
5264
5974
|
),
|
|
5265
|
-
/* @__PURE__ */ (0,
|
|
5975
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_material30.Tooltip, { title: expanded ? "Show Less" : "Show More", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_material30.Box, { sx: { ml: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
5266
5976
|
ExpandMore,
|
|
5267
5977
|
{
|
|
5268
5978
|
expand: expanded,
|
|
@@ -5273,31 +5983,31 @@ var CollapsedContainerComponent = (props) => {
|
|
|
5273
5983
|
]
|
|
5274
5984
|
}
|
|
5275
5985
|
),
|
|
5276
|
-
/* @__PURE__ */ (0,
|
|
5277
|
-
/* @__PURE__ */ (0,
|
|
5278
|
-
/* @__PURE__ */ (0,
|
|
5986
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_material30.Collapse, { in: expanded, timeout: "auto", children: [
|
|
5987
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_material30.Divider, { variant: "middle" }),
|
|
5988
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_material30.CardContent, { children: props.children })
|
|
5279
5989
|
] })
|
|
5280
5990
|
] });
|
|
5281
5991
|
};
|
|
5282
5992
|
|
|
5283
5993
|
// src/i18n/LanguageSelector.tsx
|
|
5284
|
-
var
|
|
5994
|
+
var import_react35 = require("react");
|
|
5285
5995
|
var import_react_i18next6 = require("react-i18next");
|
|
5286
|
-
var
|
|
5996
|
+
var import_material31 = require("@mui/material");
|
|
5287
5997
|
init_LocalizationProvider();
|
|
5288
5998
|
init_UserSettingsProvider();
|
|
5289
5999
|
init_SupabaseProvider();
|
|
5290
|
-
var
|
|
6000
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
5291
6001
|
var LanguageSelector = () => {
|
|
5292
6002
|
const supabase = useSupabase();
|
|
5293
6003
|
const { i18n: i18n2 } = (0, import_react_i18next6.useTranslation)();
|
|
5294
|
-
const [languages, setLanguages] = (0,
|
|
5295
|
-
const [loading, setLoading] = (0,
|
|
6004
|
+
const [languages, setLanguages] = (0, import_react35.useState)([]);
|
|
6005
|
+
const [loading, setLoading] = (0, import_react35.useState)(true);
|
|
5296
6006
|
const { changeLanguage } = useLocalization();
|
|
5297
6007
|
const { settings: userSettings, setLanguage } = useUserSettings();
|
|
5298
|
-
const [anchorEl, setAnchorEl] = (0,
|
|
6008
|
+
const [anchorEl, setAnchorEl] = (0, import_react35.useState)(null);
|
|
5299
6009
|
const open = Boolean(anchorEl);
|
|
5300
|
-
(0,
|
|
6010
|
+
(0, import_react35.useEffect)(() => {
|
|
5301
6011
|
const fetchLanguages = async () => {
|
|
5302
6012
|
try {
|
|
5303
6013
|
const { data, error } = await supabase.from("languages").select("code, name, svg_flag").eq("enabled", true);
|
|
@@ -5324,14 +6034,14 @@ var LanguageSelector = () => {
|
|
|
5324
6034
|
handleClose();
|
|
5325
6035
|
};
|
|
5326
6036
|
if (loading) {
|
|
5327
|
-
return /* @__PURE__ */ (0,
|
|
6037
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material31.CircularProgress, { size: 20, color: "inherit", sx: { mx: 1 } });
|
|
5328
6038
|
}
|
|
5329
6039
|
const rawCurrentLang = i18n2.language || "uk";
|
|
5330
6040
|
const currentLangCode = rawCurrentLang.split("-")[0];
|
|
5331
6041
|
const currentLang = languages.find((l) => l.code === currentLangCode) || languages[0];
|
|
5332
|
-
return /* @__PURE__ */ (0,
|
|
5333
|
-
/* @__PURE__ */ (0,
|
|
5334
|
-
|
|
6042
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
|
|
6043
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material31.Tooltip, { title: currentLang ? currentLang.name : "\u041C\u043E\u0432\u0430", arrow: true, placement: "bottom", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6044
|
+
import_material31.IconButton,
|
|
5335
6045
|
{
|
|
5336
6046
|
onClick: handleClick,
|
|
5337
6047
|
size: "small",
|
|
@@ -5346,8 +6056,8 @@ var LanguageSelector = () => {
|
|
|
5346
6056
|
backgroundColor: "action.hover"
|
|
5347
6057
|
}
|
|
5348
6058
|
},
|
|
5349
|
-
children: currentLang?.svg_flag && /* @__PURE__ */ (0,
|
|
5350
|
-
|
|
6059
|
+
children: currentLang?.svg_flag && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6060
|
+
import_material31.Box,
|
|
5351
6061
|
{
|
|
5352
6062
|
sx: {
|
|
5353
6063
|
width: 24,
|
|
@@ -5366,8 +6076,8 @@ var LanguageSelector = () => {
|
|
|
5366
6076
|
)
|
|
5367
6077
|
}
|
|
5368
6078
|
) }),
|
|
5369
|
-
/* @__PURE__ */ (0,
|
|
5370
|
-
|
|
6079
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6080
|
+
import_material31.Menu,
|
|
5371
6081
|
{
|
|
5372
6082
|
id: "language-menu",
|
|
5373
6083
|
anchorEl,
|
|
@@ -5387,8 +6097,8 @@ var LanguageSelector = () => {
|
|
|
5387
6097
|
anchorOrigin: { horizontal: "right", vertical: "bottom" },
|
|
5388
6098
|
children: languages.map((lang) => {
|
|
5389
6099
|
const isSelected = lang.code === currentLangCode;
|
|
5390
|
-
return /* @__PURE__ */ (0,
|
|
5391
|
-
|
|
6100
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
6101
|
+
import_material31.MenuItem,
|
|
5392
6102
|
{
|
|
5393
6103
|
selected: isSelected,
|
|
5394
6104
|
onClick: () => handleSelectLanguage(lang.code),
|
|
@@ -5400,8 +6110,8 @@ var LanguageSelector = () => {
|
|
|
5400
6110
|
px: 2
|
|
5401
6111
|
},
|
|
5402
6112
|
children: [
|
|
5403
|
-
/* @__PURE__ */ (0,
|
|
5404
|
-
|
|
6113
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6114
|
+
import_material31.Box,
|
|
5405
6115
|
{
|
|
5406
6116
|
sx: {
|
|
5407
6117
|
width: 22,
|
|
@@ -5415,7 +6125,7 @@ var LanguageSelector = () => {
|
|
|
5415
6125
|
dangerouslySetInnerHTML: { __html: lang.svg_flag }
|
|
5416
6126
|
}
|
|
5417
6127
|
),
|
|
5418
|
-
/* @__PURE__ */ (0,
|
|
6128
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material31.Typography, { variant: "body2", sx: { fontWeight: isSelected ? 600 : 400 }, children: lang.name })
|
|
5419
6129
|
]
|
|
5420
6130
|
},
|
|
5421
6131
|
lang.code
|
|
@@ -5429,11 +6139,11 @@ var PublicLanguageSelector = () => {
|
|
|
5429
6139
|
const supabase = useSupabase();
|
|
5430
6140
|
const { i18n: i18n2 } = (0, import_react_i18next6.useTranslation)();
|
|
5431
6141
|
const { changeLanguage } = useLocalization();
|
|
5432
|
-
const [languages, setLanguages] = (0,
|
|
5433
|
-
const [loading, setLoading] = (0,
|
|
5434
|
-
const [anchorEl, setAnchorEl] = (0,
|
|
6142
|
+
const [languages, setLanguages] = (0, import_react35.useState)([]);
|
|
6143
|
+
const [loading, setLoading] = (0, import_react35.useState)(true);
|
|
6144
|
+
const [anchorEl, setAnchorEl] = (0, import_react35.useState)(null);
|
|
5435
6145
|
const open = Boolean(anchorEl);
|
|
5436
|
-
(0,
|
|
6146
|
+
(0, import_react35.useEffect)(() => {
|
|
5437
6147
|
const fetchLanguages = async () => {
|
|
5438
6148
|
try {
|
|
5439
6149
|
const { data, error } = await supabase.from("languages").select("code, name, svg_flag").eq("enabled", true);
|
|
@@ -5458,14 +6168,14 @@ var PublicLanguageSelector = () => {
|
|
|
5458
6168
|
handleClose();
|
|
5459
6169
|
};
|
|
5460
6170
|
if (loading) {
|
|
5461
|
-
return /* @__PURE__ */ (0,
|
|
6171
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material31.CircularProgress, { size: 20, color: "inherit", sx: { mx: 1 } });
|
|
5462
6172
|
}
|
|
5463
6173
|
const rawCurrentLang = i18n2.language || "uk";
|
|
5464
6174
|
const currentLangCode = rawCurrentLang.split("-")[0];
|
|
5465
6175
|
const currentLang = languages.find((l) => l.code === currentLangCode) || languages[0];
|
|
5466
|
-
return /* @__PURE__ */ (0,
|
|
5467
|
-
/* @__PURE__ */ (0,
|
|
5468
|
-
|
|
6176
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
|
|
6177
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material31.Tooltip, { title: currentLang ? currentLang.name : "\u041C\u043E\u0432\u0430", arrow: true, placement: "bottom", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6178
|
+
import_material31.IconButton,
|
|
5469
6179
|
{
|
|
5470
6180
|
onClick: handleClick,
|
|
5471
6181
|
size: "small",
|
|
@@ -5480,8 +6190,8 @@ var PublicLanguageSelector = () => {
|
|
|
5480
6190
|
backgroundColor: "action.hover"
|
|
5481
6191
|
}
|
|
5482
6192
|
},
|
|
5483
|
-
children: currentLang?.svg_flag && /* @__PURE__ */ (0,
|
|
5484
|
-
|
|
6193
|
+
children: currentLang?.svg_flag && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6194
|
+
import_material31.Box,
|
|
5485
6195
|
{
|
|
5486
6196
|
sx: {
|
|
5487
6197
|
width: 24,
|
|
@@ -5500,8 +6210,8 @@ var PublicLanguageSelector = () => {
|
|
|
5500
6210
|
)
|
|
5501
6211
|
}
|
|
5502
6212
|
) }),
|
|
5503
|
-
/* @__PURE__ */ (0,
|
|
5504
|
-
|
|
6213
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6214
|
+
import_material31.Menu,
|
|
5505
6215
|
{
|
|
5506
6216
|
id: "language-menu",
|
|
5507
6217
|
anchorEl,
|
|
@@ -5521,8 +6231,8 @@ var PublicLanguageSelector = () => {
|
|
|
5521
6231
|
anchorOrigin: { horizontal: "right", vertical: "bottom" },
|
|
5522
6232
|
children: languages.map((lang) => {
|
|
5523
6233
|
const isSelected = lang.code === currentLangCode;
|
|
5524
|
-
return /* @__PURE__ */ (0,
|
|
5525
|
-
|
|
6234
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
6235
|
+
import_material31.MenuItem,
|
|
5526
6236
|
{
|
|
5527
6237
|
selected: isSelected,
|
|
5528
6238
|
onClick: () => handleSelectLanguage(lang.code),
|
|
@@ -5534,8 +6244,8 @@ var PublicLanguageSelector = () => {
|
|
|
5534
6244
|
px: 2
|
|
5535
6245
|
},
|
|
5536
6246
|
children: [
|
|
5537
|
-
/* @__PURE__ */ (0,
|
|
5538
|
-
|
|
6247
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6248
|
+
import_material31.Box,
|
|
5539
6249
|
{
|
|
5540
6250
|
sx: {
|
|
5541
6251
|
width: 22,
|
|
@@ -5549,7 +6259,7 @@ var PublicLanguageSelector = () => {
|
|
|
5549
6259
|
dangerouslySetInnerHTML: { __html: lang.svg_flag }
|
|
5550
6260
|
}
|
|
5551
6261
|
),
|
|
5552
|
-
/* @__PURE__ */ (0,
|
|
6262
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material31.Typography, { variant: "body2", sx: { fontWeight: isSelected ? 600 : 400 }, children: lang.name })
|
|
5553
6263
|
]
|
|
5554
6264
|
},
|
|
5555
6265
|
lang.code
|
|
@@ -5561,14 +6271,14 @@ var PublicLanguageSelector = () => {
|
|
|
5561
6271
|
};
|
|
5562
6272
|
|
|
5563
6273
|
// src/UI/components/tables/TablePaginationComponent.tsx
|
|
5564
|
-
var
|
|
6274
|
+
var import_material32 = require("@mui/material");
|
|
5565
6275
|
var import_FirstPage = __toESM(require("@mui/icons-material/FirstPage"));
|
|
5566
6276
|
var import_KeyboardArrowLeft = __toESM(require("@mui/icons-material/KeyboardArrowLeft"));
|
|
5567
6277
|
var import_KeyboardArrowRight = __toESM(require("@mui/icons-material/KeyboardArrowRight"));
|
|
5568
6278
|
var import_LastPage = __toESM(require("@mui/icons-material/LastPage"));
|
|
5569
6279
|
init_TranslatableTooltipComponent();
|
|
5570
6280
|
init_context();
|
|
5571
|
-
var
|
|
6281
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
5572
6282
|
var CustomPaginationActions = (props) => {
|
|
5573
6283
|
const {
|
|
5574
6284
|
count,
|
|
@@ -5586,11 +6296,11 @@ var CustomPaginationActions = (props) => {
|
|
|
5586
6296
|
const handleLast = (e) => onPageChange(e, Math.max(0, Math.ceil(count / rowsPerPage) - 1));
|
|
5587
6297
|
const isFirstDisabled = page === 0;
|
|
5588
6298
|
const isLastDisabled = page >= Math.ceil(count / rowsPerPage) - 1;
|
|
5589
|
-
return /* @__PURE__ */ (0,
|
|
5590
|
-
showFirstButton && /* @__PURE__ */ (0,
|
|
5591
|
-
/* @__PURE__ */ (0,
|
|
5592
|
-
/* @__PURE__ */ (0,
|
|
5593
|
-
showLastButton && /* @__PURE__ */ (0,
|
|
6299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material32.Box, { sx: { flexShrink: 0, ml: 2, display: "flex", alignItems: "center" }, children: [
|
|
6300
|
+
showFirstButton && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TranslatableTooltipComponent, { title: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TranslateText, { overrideNamespace: ns, children: "First page" }), children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material32.IconButton, { onClick: handleFirstPage, disabled: isFirstDisabled, size: "small", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_FirstPage.default, {}) }) }) }),
|
|
6301
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TranslatableTooltipComponent, { title: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TranslateText, { overrideNamespace: ns, children: "Previous page" }), children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material32.IconButton, { onClick: handleBack, disabled: isFirstDisabled, size: "small", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_KeyboardArrowLeft.default, {}) }) }) }),
|
|
6302
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TranslatableTooltipComponent, { title: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TranslateText, { overrideNamespace: ns, children: "Next page" }), children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material32.IconButton, { onClick: handleNext, disabled: isLastDisabled, size: "small", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_KeyboardArrowRight.default, {}) }) }) }),
|
|
6303
|
+
showLastButton && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TranslatableTooltipComponent, { title: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TranslateText, { overrideNamespace: ns, children: "Last page" }), children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material32.IconButton, { onClick: handleLast, disabled: isLastDisabled, size: "small", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_LastPage.default, {}) }) }) })
|
|
5594
6304
|
] });
|
|
5595
6305
|
};
|
|
5596
6306
|
var TablePaginationComponent = ({
|
|
@@ -5604,8 +6314,8 @@ var TablePaginationComponent = ({
|
|
|
5604
6314
|
}) => {
|
|
5605
6315
|
const { displayState } = useAppTheme();
|
|
5606
6316
|
const activeNamespace = overrideNamespace || "form_components";
|
|
5607
|
-
return /* @__PURE__ */ (0,
|
|
5608
|
-
|
|
6317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
6318
|
+
import_material32.TablePagination,
|
|
5609
6319
|
{
|
|
5610
6320
|
rowsPerPageOptions,
|
|
5611
6321
|
component: "div",
|
|
@@ -5616,8 +6326,8 @@ var TablePaginationComponent = ({
|
|
|
5616
6326
|
onRowsPerPageChange,
|
|
5617
6327
|
showFirstButton: true,
|
|
5618
6328
|
showLastButton: true,
|
|
5619
|
-
labelRowsPerPage: displayState.isMobile ? /* @__PURE__ */ (0,
|
|
5620
|
-
/* @__PURE__ */ (0,
|
|
6329
|
+
labelRowsPerPage: displayState.isMobile ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_jsx_runtime42.Fragment, {}) : /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
|
|
6330
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TranslateText, { overrideNamespace: activeNamespace, children: "Rows per page" }),
|
|
5621
6331
|
":"
|
|
5622
6332
|
] }),
|
|
5623
6333
|
ActionsComponent: CustomPaginationActions,
|
|
@@ -5653,16 +6363,16 @@ var Services = {
|
|
|
5653
6363
|
};
|
|
5654
6364
|
|
|
5655
6365
|
// src/hooks/useUserStatus.ts
|
|
5656
|
-
var
|
|
6366
|
+
var import_react36 = require("react");
|
|
5657
6367
|
init_deviceId();
|
|
5658
6368
|
init_context();
|
|
5659
6369
|
var ONLINE_THRESHOLD_MINUTES = 2;
|
|
5660
6370
|
var AWAY_THRESHOLD_MINUTES = 15;
|
|
5661
6371
|
var useUserStatus2 = (userId, initialLastSeenAt, currentAuthUserId) => {
|
|
5662
6372
|
const supabase = useSupabase();
|
|
5663
|
-
const [status, setStatus] = (0,
|
|
5664
|
-
const [lastSeen, setLastSeen] = (0,
|
|
5665
|
-
const lastSeenRef = (0,
|
|
6373
|
+
const [status, setStatus] = (0, import_react36.useState)("offline");
|
|
6374
|
+
const [lastSeen, setLastSeen] = (0, import_react36.useState)(initialLastSeenAt ?? null);
|
|
6375
|
+
const lastSeenRef = (0, import_react36.useRef)(initialLastSeenAt ?? null);
|
|
5666
6376
|
lastSeenRef.current = lastSeen;
|
|
5667
6377
|
const calculateStatus = (isOnline, lastSeenIso) => {
|
|
5668
6378
|
if (isOnline) return "online";
|
|
@@ -5678,7 +6388,7 @@ var useUserStatus2 = (userId, initialLastSeenAt, currentAuthUserId) => {
|
|
|
5678
6388
|
}
|
|
5679
6389
|
return "offline";
|
|
5680
6390
|
};
|
|
5681
|
-
(0,
|
|
6391
|
+
(0, import_react36.useEffect)(() => {
|
|
5682
6392
|
if (!userId) return;
|
|
5683
6393
|
let isMounted = true;
|
|
5684
6394
|
const isSelf = currentAuthUserId && userId === currentAuthUserId;
|
|
@@ -5788,6 +6498,7 @@ var Utils = {
|
|
|
5788
6498
|
CollapsedContainerComponent,
|
|
5789
6499
|
ConfirmationProvider,
|
|
5790
6500
|
CopyClipboardButtonComponent,
|
|
6501
|
+
DateTimePickerComponent,
|
|
5791
6502
|
EmailInputComponent,
|
|
5792
6503
|
ErrorAlertComponent,
|
|
5793
6504
|
ExpandableNoteComponent,
|
|
@@ -5815,7 +6526,7 @@ var Utils = {
|
|
|
5815
6526
|
TranslateProvider,
|
|
5816
6527
|
TranslateText,
|
|
5817
6528
|
TranslationEditProvider,
|
|
5818
|
-
|
|
6529
|
+
TruncatedTypographyComponent,
|
|
5819
6530
|
UrlComponent,
|
|
5820
6531
|
UserAvatarComponent,
|
|
5821
6532
|
UserPopoverComponent,
|