@serhii.olishevskyi/docs 1.2.24 → 1.2.26
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 +31 -2
- package/dist/index.d.ts +31 -2
- package/dist/index.js +549 -127
- package/dist/index.mjs +504 -80
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1725,11 +1725,74 @@ var ErrorAlertComponent = ({
|
|
|
1725
1725
|
);
|
|
1726
1726
|
};
|
|
1727
1727
|
|
|
1728
|
+
// src/UI/components/data.display/TruncatedTypography.tsx
|
|
1729
|
+
import { useRef, useState as useState11, useEffect as useEffect5 } from "react";
|
|
1730
|
+
import { Typography as Typography6 } from "@mui/material";
|
|
1731
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1732
|
+
var TruncatedTypography = ({
|
|
1733
|
+
children,
|
|
1734
|
+
lines = 1,
|
|
1735
|
+
tooltipProps,
|
|
1736
|
+
alwaysShowTooltip = false,
|
|
1737
|
+
sx,
|
|
1738
|
+
...typographyProps
|
|
1739
|
+
}) => {
|
|
1740
|
+
const textRef = useRef(null);
|
|
1741
|
+
const [isTruncated, setIsTruncated] = useState11(false);
|
|
1742
|
+
const checkOverflow = () => {
|
|
1743
|
+
const element = textRef.current;
|
|
1744
|
+
if (!element) return;
|
|
1745
|
+
if (lines === 1) {
|
|
1746
|
+
setIsTruncated(element.scrollWidth > element.clientWidth);
|
|
1747
|
+
} else {
|
|
1748
|
+
setIsTruncated(element.scrollHeight > element.clientHeight);
|
|
1749
|
+
}
|
|
1750
|
+
};
|
|
1751
|
+
useEffect5(() => {
|
|
1752
|
+
checkOverflow();
|
|
1753
|
+
window.addEventListener("resize", checkOverflow);
|
|
1754
|
+
return () => window.removeEventListener("resize", checkOverflow);
|
|
1755
|
+
}, [children, lines]);
|
|
1756
|
+
const truncationStyles = lines > 1 ? {
|
|
1757
|
+
display: "-webkit-box",
|
|
1758
|
+
WebkitLineClamp: lines,
|
|
1759
|
+
WebkitBoxOrient: "vertical",
|
|
1760
|
+
overflow: "hidden",
|
|
1761
|
+
textOverflow: "ellipsis",
|
|
1762
|
+
wordBreak: "break-word"
|
|
1763
|
+
} : {
|
|
1764
|
+
overflow: "hidden",
|
|
1765
|
+
textOverflow: "ellipsis",
|
|
1766
|
+
whiteSpace: "nowrap"
|
|
1767
|
+
};
|
|
1768
|
+
const textContent = typeof children === "string" ? children : void 0;
|
|
1769
|
+
return /* @__PURE__ */ jsx15(
|
|
1770
|
+
TranslatableTooltipComponent,
|
|
1771
|
+
{
|
|
1772
|
+
title: alwaysShowTooltip || isTruncated ? textContent || children : "",
|
|
1773
|
+
disableHoverListener: !alwaysShowTooltip && !isTruncated,
|
|
1774
|
+
...tooltipProps,
|
|
1775
|
+
children: /* @__PURE__ */ jsx15(
|
|
1776
|
+
Typography6,
|
|
1777
|
+
{
|
|
1778
|
+
ref: textRef,
|
|
1779
|
+
sx: {
|
|
1780
|
+
...truncationStyles,
|
|
1781
|
+
...sx
|
|
1782
|
+
},
|
|
1783
|
+
...typographyProps,
|
|
1784
|
+
children
|
|
1785
|
+
}
|
|
1786
|
+
)
|
|
1787
|
+
}
|
|
1788
|
+
);
|
|
1789
|
+
};
|
|
1790
|
+
|
|
1728
1791
|
// src/UI/components/layout/PageComponent.tsx
|
|
1729
|
-
import
|
|
1792
|
+
import React11, { useState as useState12 } from "react";
|
|
1730
1793
|
import {
|
|
1731
1794
|
Box as Box8,
|
|
1732
|
-
Typography as
|
|
1795
|
+
Typography as Typography7,
|
|
1733
1796
|
Button as Button5,
|
|
1734
1797
|
IconButton as IconButton6,
|
|
1735
1798
|
Menu,
|
|
@@ -1746,7 +1809,7 @@ import {
|
|
|
1746
1809
|
import MoreVertIcon from "@mui/icons-material/MoreVert";
|
|
1747
1810
|
import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
|
|
1748
1811
|
import { Refresh as RefreshIcon } from "@mui/icons-material";
|
|
1749
|
-
import { Fragment as Fragment9, jsx as
|
|
1812
|
+
import { Fragment as Fragment9, jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1750
1813
|
var getTruncateStyles = (mode = "truncate") => {
|
|
1751
1814
|
switch (mode) {
|
|
1752
1815
|
case "truncate":
|
|
@@ -1777,7 +1840,7 @@ var PageHeader = ({
|
|
|
1777
1840
|
const theme = useTheme2();
|
|
1778
1841
|
const mediaIsMobile = useMediaQuery(theme.breakpoints.down(mobileBreakpoint));
|
|
1779
1842
|
const isMobile = forceMobileView ?? mediaIsMobile;
|
|
1780
|
-
const [anchorEl, setAnchorEl] =
|
|
1843
|
+
const [anchorEl, setAnchorEl] = useState12(null);
|
|
1781
1844
|
const isMenuOpen = Boolean(anchorEl);
|
|
1782
1845
|
const handleOpenMenu = (e) => setAnchorEl(e.currentTarget);
|
|
1783
1846
|
const handleCloseMenu = () => setAnchorEl(null);
|
|
@@ -1807,7 +1870,7 @@ var PageHeader = ({
|
|
|
1807
1870
|
],
|
|
1808
1871
|
children: [
|
|
1809
1872
|
/* @__PURE__ */ jsxs10(Box8, { sx: { display: "flex", alignItems: "center", gap: { xs: 1.5, sm: 2 }, minWidth: 0, flex: 1 }, children: [
|
|
1810
|
-
icon && /* @__PURE__ */
|
|
1873
|
+
icon && /* @__PURE__ */ jsx16(
|
|
1811
1874
|
Box8,
|
|
1812
1875
|
{
|
|
1813
1876
|
sx: {
|
|
@@ -1828,9 +1891,9 @@ var PageHeader = ({
|
|
|
1828
1891
|
}
|
|
1829
1892
|
),
|
|
1830
1893
|
/* @__PURE__ */ jsxs10(Box8, { sx: { minWidth: 0, flex: 1 }, children: [
|
|
1831
|
-
tag && /* @__PURE__ */
|
|
1832
|
-
/* @__PURE__ */
|
|
1833
|
-
|
|
1894
|
+
tag && /* @__PURE__ */ jsx16(Box8, { sx: { mb: 0.5, display: "flex", alignItems: "center" }, children: tag }),
|
|
1895
|
+
/* @__PURE__ */ jsx16(Tooltip6, { title: titleTruncateMode === "truncate" ? /* @__PURE__ */ jsx16(TranslateText, { children: title }) : void 0, arrow: true, placement: "top", children: /* @__PURE__ */ jsx16(
|
|
1896
|
+
Typography7,
|
|
1834
1897
|
{
|
|
1835
1898
|
variant: "h5",
|
|
1836
1899
|
component: "h1",
|
|
@@ -1841,11 +1904,11 @@ var PageHeader = ({
|
|
|
1841
1904
|
lineHeight: 1.3,
|
|
1842
1905
|
...getTruncateStyles(titleTruncateMode)
|
|
1843
1906
|
},
|
|
1844
|
-
children: /* @__PURE__ */
|
|
1907
|
+
children: /* @__PURE__ */ jsx16(TranslateText, { children: title })
|
|
1845
1908
|
}
|
|
1846
1909
|
) }),
|
|
1847
|
-
subtitle && /* @__PURE__ */
|
|
1848
|
-
|
|
1910
|
+
subtitle && /* @__PURE__ */ jsx16(Tooltip6, { title: subtitleTruncateMode === "truncate" ? /* @__PURE__ */ jsx16(TranslateText, { children: subtitle }) : void 0, arrow: true, placement: "top", children: /* @__PURE__ */ jsx16(
|
|
1911
|
+
Typography7,
|
|
1849
1912
|
{
|
|
1850
1913
|
variant: "body2",
|
|
1851
1914
|
sx: {
|
|
@@ -1855,20 +1918,20 @@ var PageHeader = ({
|
|
|
1855
1918
|
lineHeight: 1.4,
|
|
1856
1919
|
...getTruncateStyles(subtitleTruncateMode)
|
|
1857
1920
|
},
|
|
1858
|
-
children: /* @__PURE__ */
|
|
1921
|
+
children: /* @__PURE__ */ jsx16(TranslateText, { children: subtitle })
|
|
1859
1922
|
}
|
|
1860
1923
|
) })
|
|
1861
1924
|
] })
|
|
1862
1925
|
] }),
|
|
1863
|
-
hasActions && /* @__PURE__ */
|
|
1926
|
+
hasActions && /* @__PURE__ */ jsx16(Box8, { sx: { flexShrink: 0, display: "flex", alignItems: "center", gap: 1 }, children: isMobile ? (
|
|
1864
1927
|
/* MOBILE: IconButton with MoreVertIcon showing ALL actions inside Menu */
|
|
1865
1928
|
/* @__PURE__ */ jsxs10(Fragment9, { children: [
|
|
1866
|
-
/* @__PURE__ */
|
|
1929
|
+
/* @__PURE__ */ jsx16(TranslatableTooltipComponent, { title: /* @__PURE__ */ jsx16(TranslateText, { overrideNamespace: overrideNamespace || "form_components", children: "Actions" }), children: /* @__PURE__ */ jsx16(
|
|
1867
1930
|
IconButton6,
|
|
1868
1931
|
{
|
|
1869
1932
|
onClick: handleOpenMenu,
|
|
1870
1933
|
sx: { border: "1px solid", borderColor: "divider", borderRadius: 2, p: 1 },
|
|
1871
|
-
children: /* @__PURE__ */
|
|
1934
|
+
children: /* @__PURE__ */ jsx16(MoreVertIcon, {})
|
|
1872
1935
|
}
|
|
1873
1936
|
) }),
|
|
1874
1937
|
/* @__PURE__ */ jsxs10(
|
|
@@ -1896,15 +1959,15 @@ var PageHeader = ({
|
|
|
1896
1959
|
px: 1.5
|
|
1897
1960
|
},
|
|
1898
1961
|
children: [
|
|
1899
|
-
primaryAction.icon && /* @__PURE__ */
|
|
1900
|
-
/* @__PURE__ */
|
|
1962
|
+
primaryAction.icon && /* @__PURE__ */ jsx16(ListItemIcon, { sx: { color: "inherit", minWidth: 32 }, children: primaryAction.icon }),
|
|
1963
|
+
/* @__PURE__ */ jsx16(ListItemText2, { primary: /* @__PURE__ */ jsx16(TranslateText, { children: primaryAction.label }), slotProps: { primary: { sx: { fontWeight: 700, fontSize: "0.9rem" } } } })
|
|
1901
1964
|
]
|
|
1902
1965
|
}
|
|
1903
1966
|
),
|
|
1904
|
-
hasSecondaryActions && /* @__PURE__ */
|
|
1967
|
+
hasSecondaryActions && /* @__PURE__ */ jsx16(Divider, { sx: { my: 0.75 } })
|
|
1905
1968
|
] }),
|
|
1906
|
-
secondaryActions.map((action) => /* @__PURE__ */ jsxs10(
|
|
1907
|
-
action.divider && /* @__PURE__ */
|
|
1969
|
+
secondaryActions.map((action) => /* @__PURE__ */ jsxs10(React11.Fragment, { children: [
|
|
1970
|
+
action.divider && /* @__PURE__ */ jsx16(Divider, { sx: { my: 0.5 } }),
|
|
1908
1971
|
/* @__PURE__ */ jsxs10(
|
|
1909
1972
|
MenuItem2,
|
|
1910
1973
|
{
|
|
@@ -1912,14 +1975,14 @@ var PageHeader = ({
|
|
|
1912
1975
|
disabled: action.disabled,
|
|
1913
1976
|
sx: { borderRadius: 1, py: 1, px: 1.5, color: action.color ? `${action.color}.main` : "text.primary" },
|
|
1914
1977
|
children: [
|
|
1915
|
-
action.icon && /* @__PURE__ */
|
|
1916
|
-
/* @__PURE__ */
|
|
1978
|
+
action.icon && /* @__PURE__ */ jsx16(ListItemIcon, { sx: { color: action.color ? `${action.color}.main` : "text.secondary", minWidth: 32 }, children: action.icon }),
|
|
1979
|
+
/* @__PURE__ */ jsx16(ListItemText2, { primary: action.label, slotProps: { primary: { sx: { fontSize: "0.875rem" } } } })
|
|
1917
1980
|
]
|
|
1918
1981
|
}
|
|
1919
1982
|
)
|
|
1920
1983
|
] }, action.id)),
|
|
1921
1984
|
refreshAction && /* @__PURE__ */ jsxs10(Fragment9, { children: [
|
|
1922
|
-
/* @__PURE__ */
|
|
1985
|
+
/* @__PURE__ */ jsx16(Divider, { sx: { my: 0.5 } }),
|
|
1923
1986
|
/* @__PURE__ */ jsxs10(
|
|
1924
1987
|
MenuItem2,
|
|
1925
1988
|
{
|
|
@@ -1933,8 +1996,8 @@ var PageHeader = ({
|
|
|
1933
1996
|
px: 1.5
|
|
1934
1997
|
},
|
|
1935
1998
|
children: [
|
|
1936
|
-
/* @__PURE__ */
|
|
1937
|
-
/* @__PURE__ */
|
|
1999
|
+
/* @__PURE__ */ jsx16(ListItemIcon, { sx: { color: "inherit", minWidth: 32 }, children: /* @__PURE__ */ jsx16(RefreshIcon, {}) }),
|
|
2000
|
+
/* @__PURE__ */ jsx16(ListItemText2, { primary: /* @__PURE__ */ jsx16(TranslateText, { overrideNamespace: overrideNamespace || "form_components", children: "Refresh" }), slotProps: { primary: { sx: { fontWeight: 700, fontSize: "0.9rem" } } } })
|
|
1938
2001
|
]
|
|
1939
2002
|
}
|
|
1940
2003
|
)
|
|
@@ -1947,7 +2010,7 @@ var PageHeader = ({
|
|
|
1947
2010
|
/* DESKTOP: Primary Action Button + Secondary Actions Dropdown Button */
|
|
1948
2011
|
/* @__PURE__ */ jsxs10(Box8, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
1949
2012
|
(primaryAction || refreshAction) && /* @__PURE__ */ jsxs10(Stack, { direction: "row", spacing: 2, children: [
|
|
1950
|
-
primaryAction && /* @__PURE__ */
|
|
2013
|
+
primaryAction && /* @__PURE__ */ jsx16(
|
|
1951
2014
|
Button5,
|
|
1952
2015
|
{
|
|
1953
2016
|
variant: primaryAction.variant || "contained",
|
|
@@ -1956,10 +2019,10 @@ var PageHeader = ({
|
|
|
1956
2019
|
disabled: primaryAction.disabled,
|
|
1957
2020
|
startIcon: primaryAction.icon,
|
|
1958
2021
|
sx: { borderRadius: 2, textTransform: "none", fontWeight: 600, px: 2, py: 0.85 },
|
|
1959
|
-
children: /* @__PURE__ */
|
|
2022
|
+
children: /* @__PURE__ */ jsx16(TranslateText, { children: primaryAction.label })
|
|
1960
2023
|
}
|
|
1961
2024
|
),
|
|
1962
|
-
refreshAction && /* @__PURE__ */
|
|
2025
|
+
refreshAction && /* @__PURE__ */ jsx16(TranslatableTooltipComponent, { title: /* @__PURE__ */ jsx16(TranslateText, { overrideNamespace: overrideNamespace || "form_components", children: "Refresh" }), children: /* @__PURE__ */ jsx16(
|
|
1963
2026
|
Fab2,
|
|
1964
2027
|
{
|
|
1965
2028
|
color: "default",
|
|
@@ -1967,20 +2030,20 @@ var PageHeader = ({
|
|
|
1967
2030
|
disabled: refreshAction.disabled,
|
|
1968
2031
|
"aria-label": "refresh",
|
|
1969
2032
|
size: "small",
|
|
1970
|
-
children: /* @__PURE__ */
|
|
2033
|
+
children: /* @__PURE__ */ jsx16(RefreshIcon, {})
|
|
1971
2034
|
}
|
|
1972
2035
|
) })
|
|
1973
2036
|
] }),
|
|
1974
2037
|
hasSecondaryActions && /* @__PURE__ */ jsxs10(Fragment9, { children: [
|
|
1975
|
-
/* @__PURE__ */
|
|
2038
|
+
/* @__PURE__ */ jsx16(
|
|
1976
2039
|
IconButton6,
|
|
1977
2040
|
{
|
|
1978
2041
|
onClick: handleOpenMenu,
|
|
1979
2042
|
sx: { border: "1px solid", borderColor: "divider", borderRadius: 2, p: 1 },
|
|
1980
|
-
children: /* @__PURE__ */
|
|
2043
|
+
children: /* @__PURE__ */ jsx16(KeyboardArrowDownIcon, {})
|
|
1981
2044
|
}
|
|
1982
2045
|
),
|
|
1983
|
-
/* @__PURE__ */
|
|
2046
|
+
/* @__PURE__ */ jsx16(
|
|
1984
2047
|
Menu,
|
|
1985
2048
|
{
|
|
1986
2049
|
anchorEl,
|
|
@@ -1989,8 +2052,8 @@ var PageHeader = ({
|
|
|
1989
2052
|
transformOrigin: { horizontal: "right", vertical: "top" },
|
|
1990
2053
|
anchorOrigin: { horizontal: "right", vertical: "bottom" },
|
|
1991
2054
|
slotProps: { paper: { elevation: 4, sx: { minWidth: 180, borderRadius: 2, mt: 1, p: 0.5 } } },
|
|
1992
|
-
children: secondaryActions.map((action) => /* @__PURE__ */ jsxs10(
|
|
1993
|
-
action.divider && /* @__PURE__ */
|
|
2055
|
+
children: secondaryActions.map((action) => /* @__PURE__ */ jsxs10(React11.Fragment, { children: [
|
|
2056
|
+
action.divider && /* @__PURE__ */ jsx16(Divider, { sx: { my: 0.5 } }),
|
|
1994
2057
|
/* @__PURE__ */ jsxs10(
|
|
1995
2058
|
MenuItem2,
|
|
1996
2059
|
{
|
|
@@ -1998,8 +2061,8 @@ var PageHeader = ({
|
|
|
1998
2061
|
disabled: action.disabled,
|
|
1999
2062
|
sx: { borderRadius: 1, py: 0.85, color: action.color ? `${action.color}.main` : "text.primary" },
|
|
2000
2063
|
children: [
|
|
2001
|
-
action.icon && /* @__PURE__ */
|
|
2002
|
-
/* @__PURE__ */
|
|
2064
|
+
action.icon && /* @__PURE__ */ jsx16(ListItemIcon, { sx: { color: action.color ? `${action.color}.main` : "text.secondary", minWidth: 32 }, children: action.icon }),
|
|
2065
|
+
/* @__PURE__ */ jsx16(ListItemText2, { primary: action.label, slotProps: { primary: { sx: { fontSize: "0.875rem" } } } })
|
|
2003
2066
|
]
|
|
2004
2067
|
}
|
|
2005
2068
|
)
|
|
@@ -2009,13 +2072,13 @@ var PageHeader = ({
|
|
|
2009
2072
|
] })
|
|
2010
2073
|
] })
|
|
2011
2074
|
) }),
|
|
2012
|
-
customFragment && /* @__PURE__ */
|
|
2075
|
+
customFragment && /* @__PURE__ */ jsx16(Fragment9, { children: customFragment })
|
|
2013
2076
|
]
|
|
2014
2077
|
}
|
|
2015
2078
|
);
|
|
2016
2079
|
};
|
|
2017
2080
|
var PageContainer = ({ children }) => {
|
|
2018
|
-
return /* @__PURE__ */
|
|
2081
|
+
return /* @__PURE__ */ jsx16(
|
|
2019
2082
|
Box8,
|
|
2020
2083
|
{
|
|
2021
2084
|
sx: {
|
|
@@ -2032,7 +2095,7 @@ var PageComponent = ({
|
|
|
2032
2095
|
header,
|
|
2033
2096
|
children
|
|
2034
2097
|
}) => {
|
|
2035
|
-
return /* @__PURE__ */
|
|
2098
|
+
return /* @__PURE__ */ jsx16(
|
|
2036
2099
|
Box8,
|
|
2037
2100
|
{
|
|
2038
2101
|
sx: {
|
|
@@ -2043,7 +2106,7 @@ var PageComponent = ({
|
|
|
2043
2106
|
boxSizing: "border-box"
|
|
2044
2107
|
},
|
|
2045
2108
|
children: /* @__PURE__ */ jsxs10(PageContainer, { children: [
|
|
2046
|
-
header && /* @__PURE__ */
|
|
2109
|
+
header && /* @__PURE__ */ jsx16(PageHeader, { ...header }),
|
|
2047
2110
|
children
|
|
2048
2111
|
] })
|
|
2049
2112
|
}
|
|
@@ -2051,15 +2114,15 @@ var PageComponent = ({
|
|
|
2051
2114
|
};
|
|
2052
2115
|
|
|
2053
2116
|
// src/UI/components/layout/FilterContainerComponent.tsx
|
|
2054
|
-
import
|
|
2117
|
+
import React12 from "react";
|
|
2055
2118
|
import { Grid, Paper } from "@mui/material";
|
|
2056
|
-
import { jsx as
|
|
2119
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
2057
2120
|
var FilterContainerComponent = ({
|
|
2058
2121
|
sections,
|
|
2059
2122
|
children,
|
|
2060
2123
|
sx
|
|
2061
2124
|
}) => {
|
|
2062
|
-
return /* @__PURE__ */
|
|
2125
|
+
return /* @__PURE__ */ jsx17(
|
|
2063
2126
|
Paper,
|
|
2064
2127
|
{
|
|
2065
2128
|
variant: "outlined",
|
|
@@ -2067,7 +2130,7 @@ var FilterContainerComponent = ({
|
|
|
2067
2130
|
{ p: 2, mb: 3 },
|
|
2068
2131
|
...Array.isArray(sx) ? sx : [sx]
|
|
2069
2132
|
],
|
|
2070
|
-
children: /* @__PURE__ */
|
|
2133
|
+
children: /* @__PURE__ */ jsx17(Grid, { container: true, spacing: 2, sx: { alignItems: "center" }, children: sections ? sections.map((sec, idx) => /* @__PURE__ */ jsx17(React12.Fragment, { children: sec }, idx)) : children })
|
|
2071
2134
|
}
|
|
2072
2135
|
);
|
|
2073
2136
|
};
|
|
@@ -2085,12 +2148,12 @@ import {
|
|
|
2085
2148
|
ListItem,
|
|
2086
2149
|
ListItemIcon as ListItemIcon2,
|
|
2087
2150
|
ListItemText as ListItemText3,
|
|
2088
|
-
Typography as
|
|
2151
|
+
Typography as Typography8,
|
|
2089
2152
|
Link as MuiLink
|
|
2090
2153
|
} from "@mui/material";
|
|
2091
|
-
import
|
|
2154
|
+
import React13 from "react";
|
|
2092
2155
|
import { Link as RouterLink, useNavigate } from "react-router-dom";
|
|
2093
|
-
import { jsx as
|
|
2156
|
+
import { jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2094
2157
|
var PageLinkComponent = ({
|
|
2095
2158
|
overrideNamespace,
|
|
2096
2159
|
title,
|
|
@@ -2117,20 +2180,20 @@ var PageLinkComponent = ({
|
|
|
2117
2180
|
) : typeof bgcolor === "function" ? theme.palette.getContrastText(bgcolor(theme)) : theme.palette.getContrastText(bgcolor) : "text.primary"
|
|
2118
2181
|
}),
|
|
2119
2182
|
children: [
|
|
2120
|
-
/* @__PURE__ */
|
|
2183
|
+
/* @__PURE__ */ jsx18(
|
|
2121
2184
|
CardHeader,
|
|
2122
2185
|
{
|
|
2123
|
-
avatar: icon ?
|
|
2186
|
+
avatar: icon ? React13.cloneElement(icon, {
|
|
2124
2187
|
sx: { color: bgcolor ? "inherit" : "primary", ...icon.props.sx }
|
|
2125
|
-
}) : /* @__PURE__ */
|
|
2126
|
-
title: /* @__PURE__ */
|
|
2127
|
-
subheader: subheader && /* @__PURE__ */
|
|
2188
|
+
}) : /* @__PURE__ */ jsx18(Settings, { color: bgcolor ? "inherit" : "primary" }),
|
|
2189
|
+
title: /* @__PURE__ */ jsx18(Typography8, { variant: "h6", component: "div", color: "inherit", children: typeof title === "string" ? /* @__PURE__ */ jsx18(TranslateText, { overrideNamespace, children: title }) : title }),
|
|
2190
|
+
subheader: subheader && /* @__PURE__ */ jsx18(Typography8, { variant: "body2", sx: { opacity: 0.8, color: "inherit" }, children: typeof subheader === "string" ? /* @__PURE__ */ jsx18(TranslateText, { overrideNamespace, children: subheader }) : subheader })
|
|
2128
2191
|
}
|
|
2129
2192
|
),
|
|
2130
|
-
/* @__PURE__ */
|
|
2193
|
+
/* @__PURE__ */ jsx18(Divider2, { sx: { borderColor: "inherit", opacity: 0.2 } }),
|
|
2131
2194
|
/* @__PURE__ */ jsxs11(CardContent, { sx: { flexGrow: 1 }, children: [
|
|
2132
|
-
/* @__PURE__ */
|
|
2133
|
-
links && links.length > 0 && /* @__PURE__ */
|
|
2195
|
+
/* @__PURE__ */ jsx18(Typography8, { variant: "body2", sx: { opacity: 0.85, color: "inherit" }, children: typeof description === "string" ? /* @__PURE__ */ jsx18(TranslateText, { overrideNamespace, children: description }) : description }),
|
|
2196
|
+
links && links.length > 0 && /* @__PURE__ */ jsx18(List, { dense: true, disablePadding: true, children: links.filter((f) => !f.hidden).map((link, index) => /* @__PURE__ */ jsxs11(
|
|
2134
2197
|
ListItem,
|
|
2135
2198
|
{
|
|
2136
2199
|
disablePadding: true,
|
|
@@ -2142,17 +2205,17 @@ var PageLinkComponent = ({
|
|
|
2142
2205
|
}
|
|
2143
2206
|
},
|
|
2144
2207
|
children: [
|
|
2145
|
-
/* @__PURE__ */
|
|
2208
|
+
/* @__PURE__ */ jsx18(
|
|
2146
2209
|
ListItemIcon2,
|
|
2147
2210
|
{
|
|
2148
2211
|
sx: { minWidth: 30, cursor: "pointer", color: "inherit" },
|
|
2149
2212
|
onClick: () => {
|
|
2150
2213
|
if (link?.href) navigate(link.href);
|
|
2151
2214
|
},
|
|
2152
|
-
children: /* @__PURE__ */
|
|
2215
|
+
children: /* @__PURE__ */ jsx18(ArrowRight, { fontSize: "small", color: "inherit" })
|
|
2153
2216
|
}
|
|
2154
2217
|
),
|
|
2155
|
-
/* @__PURE__ */
|
|
2218
|
+
/* @__PURE__ */ jsx18(ListItemText3, { children: link.onClick ? /* @__PURE__ */ jsx18(
|
|
2156
2219
|
Button6,
|
|
2157
2220
|
{
|
|
2158
2221
|
size: "small",
|
|
@@ -2176,9 +2239,9 @@ var PageLinkComponent = ({
|
|
|
2176
2239
|
// Эффект подчеркивания, как у ссылки
|
|
2177
2240
|
}
|
|
2178
2241
|
},
|
|
2179
|
-
children: typeof link.text === "string" ? /* @__PURE__ */
|
|
2242
|
+
children: typeof link.text === "string" ? /* @__PURE__ */ jsx18(TranslateText, { overrideNamespace, children: link.text }) : link.text
|
|
2180
2243
|
}
|
|
2181
|
-
) : link.href ? /* @__PURE__ */
|
|
2244
|
+
) : link.href ? /* @__PURE__ */ jsx18(
|
|
2182
2245
|
MuiLink,
|
|
2183
2246
|
{
|
|
2184
2247
|
component: RouterLink,
|
|
@@ -2196,15 +2259,15 @@ var PageLinkComponent = ({
|
|
|
2196
2259
|
backgroundColor: "transparent"
|
|
2197
2260
|
}
|
|
2198
2261
|
},
|
|
2199
|
-
children: typeof link.text === "string" ? /* @__PURE__ */
|
|
2262
|
+
children: typeof link.text === "string" ? /* @__PURE__ */ jsx18(TranslateText, { overrideNamespace, children: link.text }) : link.text
|
|
2200
2263
|
}
|
|
2201
|
-
) : /* @__PURE__ */
|
|
2264
|
+
) : /* @__PURE__ */ jsx18(Typography8, { variant: "body2", sx: { fontWeight: 500, color: "inherit" }, children: typeof link.text === "string" ? /* @__PURE__ */ jsx18(TranslateText, { overrideNamespace, children: link.text }) : link.text }) })
|
|
2202
2265
|
]
|
|
2203
2266
|
},
|
|
2204
2267
|
index
|
|
2205
2268
|
)) })
|
|
2206
2269
|
] }),
|
|
2207
|
-
actionButtonText && onActionButtonClick && /* @__PURE__ */
|
|
2270
|
+
actionButtonText && onActionButtonClick && /* @__PURE__ */ jsx18(CardActions, { sx: { justifyContent: "flex-end", padding: 2 }, children: /* @__PURE__ */ jsx18(Button6, { size: "small", variant: "contained", onClick: onActionButtonClick, children: typeof actionButtonText === "string" ? /* @__PURE__ */ jsx18(TranslateText, { overrideNamespace, children: actionButtonText }) : actionButtonText }) })
|
|
2208
2271
|
]
|
|
2209
2272
|
}
|
|
2210
2273
|
);
|
|
@@ -2212,12 +2275,12 @@ var PageLinkComponent = ({
|
|
|
2212
2275
|
|
|
2213
2276
|
// src/UI/components/layout/CollapsedContainerComponent.tsx
|
|
2214
2277
|
import { ExpandMore as ExpandMoreIcon } from "@mui/icons-material";
|
|
2215
|
-
import { Avatar as Avatar3, Box as Box9, Card as Card2, CardContent as CardContent2, CardHeader as CardHeader2, Collapse, Divider as Divider3, IconButton as IconButton7, styled as styled2, Tooltip as Tooltip7, Typography as
|
|
2216
|
-
import { useState as
|
|
2217
|
-
import { jsx as
|
|
2278
|
+
import { Avatar as Avatar3, Box as Box9, Card as Card2, CardContent as CardContent2, CardHeader as CardHeader2, Collapse, Divider as Divider3, IconButton as IconButton7, styled as styled2, Tooltip as Tooltip7, Typography as Typography9 } from "@mui/material";
|
|
2279
|
+
import { useState as useState13 } from "react";
|
|
2280
|
+
import { jsx as jsx19, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2218
2281
|
var ExpandMore = styled2((props) => {
|
|
2219
2282
|
const { expand, ...other } = props;
|
|
2220
|
-
return /* @__PURE__ */
|
|
2283
|
+
return /* @__PURE__ */ jsx19(IconButton7, { size: "small", ...other, children: /* @__PURE__ */ jsx19(ExpandMoreIcon, {}) });
|
|
2221
2284
|
})(({ theme, expand }) => ({
|
|
2222
2285
|
transform: !expand ? "rotate(0deg)" : "rotate(180deg)",
|
|
2223
2286
|
transition: theme.transitions.create("transform", {
|
|
@@ -2232,7 +2295,7 @@ var ExpandMore = styled2((props) => {
|
|
|
2232
2295
|
}));
|
|
2233
2296
|
var CollapsedContainerComponent = (props) => {
|
|
2234
2297
|
const { displayState } = useAppTheme();
|
|
2235
|
-
const [expanded, setExpanded] =
|
|
2298
|
+
const [expanded, setExpanded] = useState13(props.expanded === void 0 ? false : props.expanded);
|
|
2236
2299
|
const handleExpandClick = () => {
|
|
2237
2300
|
setExpanded(!expanded);
|
|
2238
2301
|
props.onExpanded && props.onExpanded(!expanded);
|
|
@@ -2250,16 +2313,16 @@ var CollapsedContainerComponent = (props) => {
|
|
|
2250
2313
|
pr: 2
|
|
2251
2314
|
},
|
|
2252
2315
|
children: [
|
|
2253
|
-
/* @__PURE__ */
|
|
2316
|
+
/* @__PURE__ */ jsx19(
|
|
2254
2317
|
CardHeader2,
|
|
2255
2318
|
{
|
|
2256
2319
|
sx: { flexGrow: 1 },
|
|
2257
|
-
avatar: /* @__PURE__ */
|
|
2258
|
-
title: typeof props.title === "string" ? /* @__PURE__ */
|
|
2259
|
-
subheader: typeof props.subtitle === "string" ? /* @__PURE__ */
|
|
2320
|
+
avatar: /* @__PURE__ */ jsx19(Avatar3, { sx: { bgcolor: "primary.main" }, children: props.icon }),
|
|
2321
|
+
title: typeof props.title === "string" ? /* @__PURE__ */ jsx19(Typography9, { variant: "subtitle1", sx: { fontWeight: "700" }, children: /* @__PURE__ */ jsx19(TranslateText, { overrideNamespace: props.overrideNamespace, children: props.title }) }) : props.title,
|
|
2322
|
+
subheader: typeof props.subtitle === "string" ? /* @__PURE__ */ jsx19(TranslateText, { overrideNamespace: props.overrideNamespace, children: props.subtitle }) : props.subtitle
|
|
2260
2323
|
}
|
|
2261
2324
|
),
|
|
2262
|
-
/* @__PURE__ */
|
|
2325
|
+
/* @__PURE__ */ jsx19(Tooltip7, { title: expanded ? "Show Less" : "Show More", children: /* @__PURE__ */ jsx19(Box9, { sx: { ml: 1 }, children: /* @__PURE__ */ jsx19(
|
|
2263
2326
|
ExpandMore,
|
|
2264
2327
|
{
|
|
2265
2328
|
expand: expanded,
|
|
@@ -2271,12 +2334,369 @@ var CollapsedContainerComponent = (props) => {
|
|
|
2271
2334
|
}
|
|
2272
2335
|
),
|
|
2273
2336
|
/* @__PURE__ */ jsxs12(Collapse, { in: expanded, timeout: "auto", children: [
|
|
2274
|
-
/* @__PURE__ */
|
|
2275
|
-
/* @__PURE__ */
|
|
2337
|
+
/* @__PURE__ */ jsx19(Divider3, { variant: "middle" }),
|
|
2338
|
+
/* @__PURE__ */ jsx19(CardContent2, { children: props.children })
|
|
2276
2339
|
] })
|
|
2277
2340
|
] });
|
|
2278
2341
|
};
|
|
2279
2342
|
|
|
2343
|
+
// src/i18n/LanguageSelector.tsx
|
|
2344
|
+
import { useEffect as useEffect6, useState as useState14 } from "react";
|
|
2345
|
+
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
2346
|
+
import {
|
|
2347
|
+
Box as Box10,
|
|
2348
|
+
Typography as Typography10,
|
|
2349
|
+
CircularProgress,
|
|
2350
|
+
IconButton as IconButton8,
|
|
2351
|
+
Menu as Menu2,
|
|
2352
|
+
MenuItem as MenuItem3,
|
|
2353
|
+
Tooltip as Tooltip8
|
|
2354
|
+
} from "@mui/material";
|
|
2355
|
+
import { Fragment as Fragment10, jsx as jsx20, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2356
|
+
var LanguageSelector = () => {
|
|
2357
|
+
const supabase = useSupabase();
|
|
2358
|
+
const { i18n } = useTranslation3();
|
|
2359
|
+
const [languages, setLanguages] = useState14([]);
|
|
2360
|
+
const [loading, setLoading] = useState14(true);
|
|
2361
|
+
const { changeLanguage } = useLocalization();
|
|
2362
|
+
const { settings: userSettings, setLanguage } = useUserSettings();
|
|
2363
|
+
const [anchorEl, setAnchorEl] = useState14(null);
|
|
2364
|
+
const open = Boolean(anchorEl);
|
|
2365
|
+
useEffect6(() => {
|
|
2366
|
+
const fetchLanguages = async () => {
|
|
2367
|
+
try {
|
|
2368
|
+
const { data, error } = await supabase.from("languages").select("code, name, svg_flag").eq("enabled", true);
|
|
2369
|
+
if (error) throw error;
|
|
2370
|
+
setLanguages(data || []);
|
|
2371
|
+
if (userSettings.language) changeLanguage(userSettings.language);
|
|
2372
|
+
} catch (err) {
|
|
2373
|
+
console.error("\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F \u043C\u043E\u0432:", err);
|
|
2374
|
+
} finally {
|
|
2375
|
+
setLoading(false);
|
|
2376
|
+
}
|
|
2377
|
+
};
|
|
2378
|
+
fetchLanguages();
|
|
2379
|
+
}, []);
|
|
2380
|
+
const handleClick = (event) => {
|
|
2381
|
+
setAnchorEl(event.currentTarget);
|
|
2382
|
+
};
|
|
2383
|
+
const handleClose = () => {
|
|
2384
|
+
setAnchorEl(null);
|
|
2385
|
+
};
|
|
2386
|
+
const handleSelectLanguage = (langCode) => {
|
|
2387
|
+
changeLanguage(langCode);
|
|
2388
|
+
setLanguage(langCode);
|
|
2389
|
+
handleClose();
|
|
2390
|
+
};
|
|
2391
|
+
if (loading) {
|
|
2392
|
+
return /* @__PURE__ */ jsx20(CircularProgress, { size: 20, color: "inherit", sx: { mx: 1 } });
|
|
2393
|
+
}
|
|
2394
|
+
const rawCurrentLang = i18n.language || "uk";
|
|
2395
|
+
const currentLangCode = rawCurrentLang.split("-")[0];
|
|
2396
|
+
const currentLang = languages.find((l) => l.code === currentLangCode) || languages[0];
|
|
2397
|
+
return /* @__PURE__ */ jsxs13(Fragment10, { children: [
|
|
2398
|
+
/* @__PURE__ */ jsx20(Tooltip8, { title: currentLang ? currentLang.name : "\u041C\u043E\u0432\u0430", arrow: true, placement: "bottom", children: /* @__PURE__ */ jsx20(
|
|
2399
|
+
IconButton8,
|
|
2400
|
+
{
|
|
2401
|
+
onClick: handleClick,
|
|
2402
|
+
size: "small",
|
|
2403
|
+
"aria-controls": open ? "language-menu" : void 0,
|
|
2404
|
+
"aria-haspopup": "true",
|
|
2405
|
+
"aria-expanded": open ? "true" : void 0,
|
|
2406
|
+
sx: {
|
|
2407
|
+
p: 1,
|
|
2408
|
+
borderRadius: 2,
|
|
2409
|
+
transition: "background-color 0.2s",
|
|
2410
|
+
"&:hover": {
|
|
2411
|
+
backgroundColor: "action.hover"
|
|
2412
|
+
}
|
|
2413
|
+
},
|
|
2414
|
+
children: currentLang?.svg_flag && /* @__PURE__ */ jsx20(
|
|
2415
|
+
Box10,
|
|
2416
|
+
{
|
|
2417
|
+
sx: {
|
|
2418
|
+
width: 24,
|
|
2419
|
+
height: 16,
|
|
2420
|
+
borderRadius: "3px",
|
|
2421
|
+
overflow: "hidden",
|
|
2422
|
+
flexShrink: 0,
|
|
2423
|
+
boxShadow: "0 0 2px rgba(0,0,0,0.3)",
|
|
2424
|
+
display: "flex",
|
|
2425
|
+
alignItems: "center",
|
|
2426
|
+
justifyContent: "center",
|
|
2427
|
+
"& svg": { width: "100%", height: "100%", display: "block", objectFit: "cover" }
|
|
2428
|
+
},
|
|
2429
|
+
dangerouslySetInnerHTML: { __html: currentLang.svg_flag }
|
|
2430
|
+
}
|
|
2431
|
+
)
|
|
2432
|
+
}
|
|
2433
|
+
) }),
|
|
2434
|
+
/* @__PURE__ */ jsx20(
|
|
2435
|
+
Menu2,
|
|
2436
|
+
{
|
|
2437
|
+
id: "language-menu",
|
|
2438
|
+
anchorEl,
|
|
2439
|
+
open,
|
|
2440
|
+
onClose: handleClose,
|
|
2441
|
+
slotProps: {
|
|
2442
|
+
paper: {
|
|
2443
|
+
elevation: 3,
|
|
2444
|
+
sx: {
|
|
2445
|
+
mt: 1,
|
|
2446
|
+
minWidth: 150,
|
|
2447
|
+
borderRadius: 2
|
|
2448
|
+
}
|
|
2449
|
+
}
|
|
2450
|
+
},
|
|
2451
|
+
transformOrigin: { horizontal: "right", vertical: "top" },
|
|
2452
|
+
anchorOrigin: { horizontal: "right", vertical: "bottom" },
|
|
2453
|
+
children: languages.map((lang) => {
|
|
2454
|
+
const isSelected = lang.code === currentLangCode;
|
|
2455
|
+
return /* @__PURE__ */ jsxs13(
|
|
2456
|
+
MenuItem3,
|
|
2457
|
+
{
|
|
2458
|
+
selected: isSelected,
|
|
2459
|
+
onClick: () => handleSelectLanguage(lang.code),
|
|
2460
|
+
sx: {
|
|
2461
|
+
display: "flex",
|
|
2462
|
+
alignItems: "center",
|
|
2463
|
+
gap: 1.5,
|
|
2464
|
+
py: 1,
|
|
2465
|
+
px: 2
|
|
2466
|
+
},
|
|
2467
|
+
children: [
|
|
2468
|
+
/* @__PURE__ */ jsx20(
|
|
2469
|
+
Box10,
|
|
2470
|
+
{
|
|
2471
|
+
sx: {
|
|
2472
|
+
width: 22,
|
|
2473
|
+
height: 15,
|
|
2474
|
+
borderRadius: "2px",
|
|
2475
|
+
overflow: "hidden",
|
|
2476
|
+
flexShrink: 0,
|
|
2477
|
+
boxShadow: "0 0 1px rgba(0,0,0,0.4)",
|
|
2478
|
+
"& svg": { width: "100%", height: "100%", display: "block" }
|
|
2479
|
+
},
|
|
2480
|
+
dangerouslySetInnerHTML: { __html: lang.svg_flag }
|
|
2481
|
+
}
|
|
2482
|
+
),
|
|
2483
|
+
/* @__PURE__ */ jsx20(Typography10, { variant: "body2", sx: { fontWeight: isSelected ? 600 : 400 }, children: lang.name })
|
|
2484
|
+
]
|
|
2485
|
+
},
|
|
2486
|
+
lang.code
|
|
2487
|
+
);
|
|
2488
|
+
})
|
|
2489
|
+
}
|
|
2490
|
+
)
|
|
2491
|
+
] });
|
|
2492
|
+
};
|
|
2493
|
+
var PublicLanguageSelector = () => {
|
|
2494
|
+
const supabase = useSupabase();
|
|
2495
|
+
const { i18n } = useTranslation3();
|
|
2496
|
+
const { changeLanguage } = useLocalization();
|
|
2497
|
+
const [languages, setLanguages] = useState14([]);
|
|
2498
|
+
const [loading, setLoading] = useState14(true);
|
|
2499
|
+
const [anchorEl, setAnchorEl] = useState14(null);
|
|
2500
|
+
const open = Boolean(anchorEl);
|
|
2501
|
+
useEffect6(() => {
|
|
2502
|
+
const fetchLanguages = async () => {
|
|
2503
|
+
try {
|
|
2504
|
+
const { data, error } = await supabase.from("languages").select("code, name, svg_flag").eq("enabled", true);
|
|
2505
|
+
if (error) throw error;
|
|
2506
|
+
setLanguages(data || []);
|
|
2507
|
+
} catch (err) {
|
|
2508
|
+
console.error("\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F \u043C\u043E\u0432:", err);
|
|
2509
|
+
} finally {
|
|
2510
|
+
setLoading(false);
|
|
2511
|
+
}
|
|
2512
|
+
};
|
|
2513
|
+
fetchLanguages();
|
|
2514
|
+
}, []);
|
|
2515
|
+
const handleClick = (event) => {
|
|
2516
|
+
setAnchorEl(event.currentTarget);
|
|
2517
|
+
};
|
|
2518
|
+
const handleClose = () => {
|
|
2519
|
+
setAnchorEl(null);
|
|
2520
|
+
};
|
|
2521
|
+
const handleSelectLanguage = (langCode) => {
|
|
2522
|
+
changeLanguage(langCode);
|
|
2523
|
+
handleClose();
|
|
2524
|
+
};
|
|
2525
|
+
if (loading) {
|
|
2526
|
+
return /* @__PURE__ */ jsx20(CircularProgress, { size: 20, color: "inherit", sx: { mx: 1 } });
|
|
2527
|
+
}
|
|
2528
|
+
const rawCurrentLang = i18n.language || "uk";
|
|
2529
|
+
const currentLangCode = rawCurrentLang.split("-")[0];
|
|
2530
|
+
const currentLang = languages.find((l) => l.code === currentLangCode) || languages[0];
|
|
2531
|
+
return /* @__PURE__ */ jsxs13(Fragment10, { children: [
|
|
2532
|
+
/* @__PURE__ */ jsx20(Tooltip8, { title: currentLang ? currentLang.name : "\u041C\u043E\u0432\u0430", arrow: true, placement: "bottom", children: /* @__PURE__ */ jsx20(
|
|
2533
|
+
IconButton8,
|
|
2534
|
+
{
|
|
2535
|
+
onClick: handleClick,
|
|
2536
|
+
size: "small",
|
|
2537
|
+
"aria-controls": open ? "language-menu" : void 0,
|
|
2538
|
+
"aria-haspopup": "true",
|
|
2539
|
+
"aria-expanded": open ? "true" : void 0,
|
|
2540
|
+
sx: {
|
|
2541
|
+
p: 1,
|
|
2542
|
+
borderRadius: 2,
|
|
2543
|
+
transition: "background-color 0.2s",
|
|
2544
|
+
"&:hover": {
|
|
2545
|
+
backgroundColor: "action.hover"
|
|
2546
|
+
}
|
|
2547
|
+
},
|
|
2548
|
+
children: currentLang?.svg_flag && /* @__PURE__ */ jsx20(
|
|
2549
|
+
Box10,
|
|
2550
|
+
{
|
|
2551
|
+
sx: {
|
|
2552
|
+
width: 24,
|
|
2553
|
+
height: 16,
|
|
2554
|
+
borderRadius: "3px",
|
|
2555
|
+
overflow: "hidden",
|
|
2556
|
+
flexShrink: 0,
|
|
2557
|
+
boxShadow: "0 0 2px rgba(0,0,0,0.3)",
|
|
2558
|
+
display: "flex",
|
|
2559
|
+
alignItems: "center",
|
|
2560
|
+
justifyContent: "center",
|
|
2561
|
+
"& svg": { width: "100%", height: "100%", display: "block", objectFit: "cover" }
|
|
2562
|
+
},
|
|
2563
|
+
dangerouslySetInnerHTML: { __html: currentLang.svg_flag }
|
|
2564
|
+
}
|
|
2565
|
+
)
|
|
2566
|
+
}
|
|
2567
|
+
) }),
|
|
2568
|
+
/* @__PURE__ */ jsx20(
|
|
2569
|
+
Menu2,
|
|
2570
|
+
{
|
|
2571
|
+
id: "language-menu",
|
|
2572
|
+
anchorEl,
|
|
2573
|
+
open,
|
|
2574
|
+
onClose: handleClose,
|
|
2575
|
+
slotProps: {
|
|
2576
|
+
paper: {
|
|
2577
|
+
elevation: 3,
|
|
2578
|
+
sx: {
|
|
2579
|
+
mt: 1,
|
|
2580
|
+
minWidth: 150,
|
|
2581
|
+
borderRadius: 2
|
|
2582
|
+
}
|
|
2583
|
+
}
|
|
2584
|
+
},
|
|
2585
|
+
transformOrigin: { horizontal: "right", vertical: "top" },
|
|
2586
|
+
anchorOrigin: { horizontal: "right", vertical: "bottom" },
|
|
2587
|
+
children: languages.map((lang) => {
|
|
2588
|
+
const isSelected = lang.code === currentLangCode;
|
|
2589
|
+
return /* @__PURE__ */ jsxs13(
|
|
2590
|
+
MenuItem3,
|
|
2591
|
+
{
|
|
2592
|
+
selected: isSelected,
|
|
2593
|
+
onClick: () => handleSelectLanguage(lang.code),
|
|
2594
|
+
sx: {
|
|
2595
|
+
display: "flex",
|
|
2596
|
+
alignItems: "center",
|
|
2597
|
+
gap: 1.5,
|
|
2598
|
+
py: 1,
|
|
2599
|
+
px: 2
|
|
2600
|
+
},
|
|
2601
|
+
children: [
|
|
2602
|
+
/* @__PURE__ */ jsx20(
|
|
2603
|
+
Box10,
|
|
2604
|
+
{
|
|
2605
|
+
sx: {
|
|
2606
|
+
width: 22,
|
|
2607
|
+
height: 15,
|
|
2608
|
+
borderRadius: "2px",
|
|
2609
|
+
overflow: "hidden",
|
|
2610
|
+
flexShrink: 0,
|
|
2611
|
+
boxShadow: "0 0 1px rgba(0,0,0,0.4)",
|
|
2612
|
+
"& svg": { width: "100%", height: "100%", display: "block" }
|
|
2613
|
+
},
|
|
2614
|
+
dangerouslySetInnerHTML: { __html: lang.svg_flag }
|
|
2615
|
+
}
|
|
2616
|
+
),
|
|
2617
|
+
/* @__PURE__ */ jsx20(Typography10, { variant: "body2", sx: { fontWeight: isSelected ? 600 : 400 }, children: lang.name })
|
|
2618
|
+
]
|
|
2619
|
+
},
|
|
2620
|
+
lang.code
|
|
2621
|
+
);
|
|
2622
|
+
})
|
|
2623
|
+
}
|
|
2624
|
+
)
|
|
2625
|
+
] });
|
|
2626
|
+
};
|
|
2627
|
+
|
|
2628
|
+
// src/UI/components/tables/TablePaginationComponent.tsx
|
|
2629
|
+
import {
|
|
2630
|
+
Box as Box11,
|
|
2631
|
+
IconButton as IconButton9,
|
|
2632
|
+
TablePagination
|
|
2633
|
+
} from "@mui/material";
|
|
2634
|
+
import FirstPageIcon from "@mui/icons-material/FirstPage";
|
|
2635
|
+
import KeyboardArrowLeft from "@mui/icons-material/KeyboardArrowLeft";
|
|
2636
|
+
import KeyboardArrowRight from "@mui/icons-material/KeyboardArrowRight";
|
|
2637
|
+
import LastPageIcon from "@mui/icons-material/LastPage";
|
|
2638
|
+
import { Fragment as Fragment11, jsx as jsx21, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2639
|
+
var CustomPaginationActions = (props) => {
|
|
2640
|
+
const {
|
|
2641
|
+
count,
|
|
2642
|
+
page,
|
|
2643
|
+
rowsPerPage,
|
|
2644
|
+
onPageChange,
|
|
2645
|
+
showFirstButton,
|
|
2646
|
+
showLastButton,
|
|
2647
|
+
overrideNamespace
|
|
2648
|
+
} = props;
|
|
2649
|
+
const ns = overrideNamespace || "form_components";
|
|
2650
|
+
const handleFirstPage = (e) => onPageChange(e, 0);
|
|
2651
|
+
const handleBack = (e) => onPageChange(e, page - 1);
|
|
2652
|
+
const handleNext = (e) => onPageChange(e, page + 1);
|
|
2653
|
+
const handleLast = (e) => onPageChange(e, Math.max(0, Math.ceil(count / rowsPerPage) - 1));
|
|
2654
|
+
const isFirstDisabled = page === 0;
|
|
2655
|
+
const isLastDisabled = page >= Math.ceil(count / rowsPerPage) - 1;
|
|
2656
|
+
return /* @__PURE__ */ jsxs14(Box11, { sx: { flexShrink: 0, ml: 2, display: "flex", alignItems: "center" }, children: [
|
|
2657
|
+
showFirstButton && /* @__PURE__ */ jsx21(TranslatableTooltipComponent, { title: /* @__PURE__ */ jsx21(TranslateText, { overrideNamespace: ns, children: "First page" }), children: /* @__PURE__ */ jsx21("span", { children: /* @__PURE__ */ jsx21(IconButton9, { onClick: handleFirstPage, disabled: isFirstDisabled, size: "small", children: /* @__PURE__ */ jsx21(FirstPageIcon, {}) }) }) }),
|
|
2658
|
+
/* @__PURE__ */ jsx21(TranslatableTooltipComponent, { title: /* @__PURE__ */ jsx21(TranslateText, { overrideNamespace: ns, children: "Previous page" }), children: /* @__PURE__ */ jsx21("span", { children: /* @__PURE__ */ jsx21(IconButton9, { onClick: handleBack, disabled: isFirstDisabled, size: "small", children: /* @__PURE__ */ jsx21(KeyboardArrowLeft, {}) }) }) }),
|
|
2659
|
+
/* @__PURE__ */ jsx21(TranslatableTooltipComponent, { title: /* @__PURE__ */ jsx21(TranslateText, { overrideNamespace: ns, children: "Next page" }), children: /* @__PURE__ */ jsx21("span", { children: /* @__PURE__ */ jsx21(IconButton9, { onClick: handleNext, disabled: isLastDisabled, size: "small", children: /* @__PURE__ */ jsx21(KeyboardArrowRight, {}) }) }) }),
|
|
2660
|
+
showLastButton && /* @__PURE__ */ jsx21(TranslatableTooltipComponent, { title: /* @__PURE__ */ jsx21(TranslateText, { overrideNamespace: ns, children: "Last page" }), children: /* @__PURE__ */ jsx21("span", { children: /* @__PURE__ */ jsx21(IconButton9, { onClick: handleLast, disabled: isLastDisabled, size: "small", children: /* @__PURE__ */ jsx21(LastPageIcon, {}) }) }) })
|
|
2661
|
+
] });
|
|
2662
|
+
};
|
|
2663
|
+
var TablePaginationComponent = ({
|
|
2664
|
+
overrideNamespace,
|
|
2665
|
+
rowsPerPageOptions = [5, 10, 25, 50],
|
|
2666
|
+
count,
|
|
2667
|
+
rowsPerPage,
|
|
2668
|
+
page,
|
|
2669
|
+
onPageChange,
|
|
2670
|
+
onRowsPerPageChange
|
|
2671
|
+
}) => {
|
|
2672
|
+
const { displayState } = useAppTheme();
|
|
2673
|
+
const activeNamespace = overrideNamespace || "form_components";
|
|
2674
|
+
return /* @__PURE__ */ jsx21(
|
|
2675
|
+
TablePagination,
|
|
2676
|
+
{
|
|
2677
|
+
rowsPerPageOptions,
|
|
2678
|
+
component: "div",
|
|
2679
|
+
count,
|
|
2680
|
+
rowsPerPage,
|
|
2681
|
+
page,
|
|
2682
|
+
onPageChange,
|
|
2683
|
+
onRowsPerPageChange,
|
|
2684
|
+
showFirstButton: true,
|
|
2685
|
+
showLastButton: true,
|
|
2686
|
+
labelRowsPerPage: displayState.isMobile ? /* @__PURE__ */ jsx21(Fragment11, {}) : /* @__PURE__ */ jsxs14(Fragment11, { children: [
|
|
2687
|
+
/* @__PURE__ */ jsx21(TranslateText, { overrideNamespace: activeNamespace, children: "Rows per page" }),
|
|
2688
|
+
":"
|
|
2689
|
+
] }),
|
|
2690
|
+
ActionsComponent: CustomPaginationActions,
|
|
2691
|
+
slotProps: {
|
|
2692
|
+
actions: {
|
|
2693
|
+
overrideNamespace: activeNamespace
|
|
2694
|
+
}
|
|
2695
|
+
}
|
|
2696
|
+
}
|
|
2697
|
+
);
|
|
2698
|
+
};
|
|
2699
|
+
|
|
2280
2700
|
// src/services/index.ts
|
|
2281
2701
|
var Services = {
|
|
2282
2702
|
SessionService: {
|
|
@@ -2292,14 +2712,14 @@ var Services = {
|
|
|
2292
2712
|
};
|
|
2293
2713
|
|
|
2294
2714
|
// src/hooks/useUserStatus.ts
|
|
2295
|
-
import { useEffect as
|
|
2715
|
+
import { useEffect as useEffect7, useRef as useRef2, useState as useState15 } from "react";
|
|
2296
2716
|
var ONLINE_THRESHOLD_MINUTES = 2;
|
|
2297
2717
|
var AWAY_THRESHOLD_MINUTES = 15;
|
|
2298
2718
|
var useUserStatus = (userId, initialLastSeenAt, currentAuthUserId) => {
|
|
2299
2719
|
const supabase = useSupabase();
|
|
2300
|
-
const [status, setStatus] =
|
|
2301
|
-
const [lastSeen, setLastSeen] =
|
|
2302
|
-
const lastSeenRef =
|
|
2720
|
+
const [status, setStatus] = useState15("offline");
|
|
2721
|
+
const [lastSeen, setLastSeen] = useState15(initialLastSeenAt ?? null);
|
|
2722
|
+
const lastSeenRef = useRef2(initialLastSeenAt ?? null);
|
|
2303
2723
|
lastSeenRef.current = lastSeen;
|
|
2304
2724
|
const calculateStatus = (isOnline, lastSeenIso) => {
|
|
2305
2725
|
if (isOnline) return "online";
|
|
@@ -2315,7 +2735,7 @@ var useUserStatus = (userId, initialLastSeenAt, currentAuthUserId) => {
|
|
|
2315
2735
|
}
|
|
2316
2736
|
return "offline";
|
|
2317
2737
|
};
|
|
2318
|
-
|
|
2738
|
+
useEffect7(() => {
|
|
2319
2739
|
if (!userId) return;
|
|
2320
2740
|
let isMounted = true;
|
|
2321
2741
|
const isSelf = currentAuthUserId && userId === currentAuthUserId;
|
|
@@ -2431,13 +2851,16 @@ export {
|
|
|
2431
2851
|
NumberInputComponent,
|
|
2432
2852
|
PageComponent,
|
|
2433
2853
|
PageLinkComponent,
|
|
2854
|
+
LanguageSelector as ProtectedLanguageSelector,
|
|
2434
2855
|
Providers,
|
|
2856
|
+
PublicLanguageSelector,
|
|
2435
2857
|
RefreshButtonComponent,
|
|
2436
2858
|
SearchComponent,
|
|
2437
2859
|
SelectComponent,
|
|
2438
2860
|
Services,
|
|
2439
2861
|
SupabaseProvider,
|
|
2440
2862
|
SwitchComponent,
|
|
2863
|
+
TablePaginationComponent,
|
|
2441
2864
|
TextFieldComponent,
|
|
2442
2865
|
ThemeProvider,
|
|
2443
2866
|
ToastProvider,
|
|
@@ -2445,6 +2868,7 @@ export {
|
|
|
2445
2868
|
TranslateProvider,
|
|
2446
2869
|
TranslateText,
|
|
2447
2870
|
TranslationEditProvider,
|
|
2871
|
+
TruncatedTypography,
|
|
2448
2872
|
UrlComponent,
|
|
2449
2873
|
UserAvatarComponent,
|
|
2450
2874
|
UserPopoverComponent,
|