@danikokonn/yarik-frontend-lib 2.0.52 → 2.0.54
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/components/Navigation/Navigation.d.ts.map +1 -1
- package/dist/components/Navigation/Navigation.js +23 -19
- package/dist/components/PageWrapper/PageWrapper.d.ts +2 -1
- package/dist/components/PageWrapper/PageWrapper.d.ts.map +1 -1
- package/dist/components/PageWrapper/PageWrapper.js +9 -10
- package/dist/components/SmartTable/RowContent.d.ts.map +1 -1
- package/dist/components/SmartTable/RowContent.js +2 -3
- package/dist/utils.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Navigation.d.ts","sourceRoot":"","sources":["../../../src/components/Navigation/Navigation.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Navigation.d.ts","sourceRoot":"","sources":["../../../src/components/Navigation/Navigation.tsx"],"names":[],"mappings":"AAyBA,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAGhD,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,kBAAkB,EAClB,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,aAAa,EACb,UAAU,EACV,OAAO,EACP,UAAU,EACV,SAAS,EACT,eAAe,GAChB,EAAE,eAAe,2CA+VjB"}
|
|
@@ -7,7 +7,8 @@ import LightModeIcon from "@mui/icons-material/LightMode";
|
|
|
7
7
|
import LogoutIcon from "@mui/icons-material/Logout";
|
|
8
8
|
import ManageAccountsIcon from "@mui/icons-material/ManageAccounts";
|
|
9
9
|
import MenuIcon from "@mui/icons-material/Menu";
|
|
10
|
-
import { Button,
|
|
10
|
+
import { Button, useMediaQuery } from "@mui/material";
|
|
11
|
+
import { useColorScheme } from "@mui/material/styles";
|
|
11
12
|
import AppBar from "@mui/material/AppBar";
|
|
12
13
|
import Avatar from "@mui/material/Avatar";
|
|
13
14
|
import Box from "@mui/material/Box";
|
|
@@ -55,6 +56,20 @@ export default function Navigation({ additionalControls, username, title, navLin
|
|
|
55
56
|
return (_jsx(MenuItem, { sx: { p: 0 }, onClick: () => setAnchorElNav(null), children: page }, idx));
|
|
56
57
|
});
|
|
57
58
|
};
|
|
59
|
+
const handleToggleTheme = () => {
|
|
60
|
+
if (mode === "light")
|
|
61
|
+
setMode("dark");
|
|
62
|
+
else if (mode === "dark")
|
|
63
|
+
setMode("light");
|
|
64
|
+
else {
|
|
65
|
+
if (prefersDarkMode) {
|
|
66
|
+
setMode("light");
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
setMode("dark");
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
};
|
|
58
73
|
return (_jsx(AppBar, { color: "inherit", position: "sticky", style: { top: "0%", zIndex: 1000 }, children: _jsx(Container, { maxWidth: "xl", children: _jsxs(Toolbar, { disableGutters: true, children: [_jsx(Typography, { variant: "h6", component: "a", noWrap: true, href: defautlUrl, sx: {
|
|
59
74
|
mr: 2,
|
|
60
75
|
display: { xs: "none", md: "flex" },
|
|
@@ -77,10 +92,12 @@ export default function Navigation({ additionalControls, username, title, navLin
|
|
|
77
92
|
}, keepMounted: true, transformOrigin: {
|
|
78
93
|
vertical: "top",
|
|
79
94
|
horizontal: "left",
|
|
80
|
-
}, open: Boolean(anchorElNav), onClose: () => setAnchorElNav(null),
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
95
|
+
}, open: Boolean(anchorElNav), onClose: () => setAnchorElNav(null), slotProps: {
|
|
96
|
+
list: {
|
|
97
|
+
onMouseEnter: () => (currentlyHoveringElNav = true),
|
|
98
|
+
onMouseLeave: handleCloseElNavHover,
|
|
99
|
+
sx: { pointerEvents: "auto" },
|
|
100
|
+
},
|
|
84
101
|
}, sx: {
|
|
85
102
|
display: { xs: "block", md: "none" },
|
|
86
103
|
[`&.${popoverClasses.root}`]: { pointerEvents: "none" },
|
|
@@ -115,20 +132,7 @@ export default function Navigation({ additionalControls, username, title, navLin
|
|
|
115
132
|
}, _jsx(ArrowDropDownRoundedIcon, {})) }), _jsxs(Box, { sx: { flexGrow: 0 }, children: [additionalControls &&
|
|
116
133
|
additionalControls.map((control, idx) => (_jsx(IconButton, { className: "position-relative",
|
|
117
134
|
// @ts-expect-error такой пропс на самом деле есть
|
|
118
|
-
href: control.href, color: control.color, title: control.title, onClick: (e) => control.onClick(`${e.clientX}px ${e.clientY}px`), disabled: control.disabled, size: "large", children: control.icon }, idx))), _jsx(IconButton, { title: "\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0442\u0435\u043C\u0443", onClick: (
|
|
119
|
-
if (mode === "light")
|
|
120
|
-
setMode("dark");
|
|
121
|
-
else if (mode === "dark")
|
|
122
|
-
setMode("light");
|
|
123
|
-
else {
|
|
124
|
-
if (prefersDarkMode) {
|
|
125
|
-
setMode("light");
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
setMode("dark");
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}, children: mode === "light" ? _jsx(LightModeIcon, {}) : _jsx(DarkModeIcon, {}) }), appsUrl && (_jsx(IconButton, { title: "\u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u043A \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F\u043C \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F", href: new URL(appsUrl, location.origin).href, children: _jsx(HubIcon, {}) })), _jsx(IconButton, { title: "\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u043C\u0435\u043D\u044E \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F", onClick: (e) => setAvatarAnchorEl(e.currentTarget), size: "small", sx: { ml: 2 }, children: _jsx(Avatar, { sx: { width: 32, height: 32 }, children: username.substring(0, 1).toUpperCase() }) }), _jsxs(Menu, { anchorEl: avatarAnchorEl, open: openAvatar, onClose: () => setAvatarAnchorEl(null), onClick: () => setAvatarAnchorEl(null), slotProps: {
|
|
135
|
+
href: control.href, color: control.color, title: control.title, onClick: (e) => control.onClick(`${e.clientX}px ${e.clientY}px`), disabled: control.disabled, size: "large", children: control.icon }, idx))), _jsx(IconButton, { title: "\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0442\u0435\u043C\u0443", onClick: handleToggleTheme, children: mode === "light" ? _jsx(LightModeIcon, {}) : _jsx(DarkModeIcon, {}) }), appsUrl && (_jsx(IconButton, { title: "\u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u043A \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F\u043C \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F", href: new URL(appsUrl, location.origin).href, children: _jsx(HubIcon, {}) })), _jsx(IconButton, { title: "\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u043C\u0435\u043D\u044E \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F", onClick: (e) => setAvatarAnchorEl(e.currentTarget), size: "small", sx: { ml: 2 }, children: _jsx(Avatar, { sx: { width: 32, height: 32 }, children: username.substring(0, 1).toUpperCase() }) }), _jsxs(Menu, { anchorEl: avatarAnchorEl, open: openAvatar, onClose: () => setAvatarAnchorEl(null), onClick: () => setAvatarAnchorEl(null), slotProps: {
|
|
132
136
|
paper: {
|
|
133
137
|
elevation: 0,
|
|
134
138
|
sx: {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import PageWrapperProps from "./PageWrapperProps";
|
|
2
|
-
|
|
2
|
+
declare const PageWrapper: ({ children, version, appName, desc, ...props }: PageWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default PageWrapper;
|
|
3
4
|
//# sourceMappingURL=PageWrapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageWrapper.d.ts","sourceRoot":"","sources":["../../../src/components/PageWrapper/PageWrapper.tsx"],"names":[],"mappings":"AAIA,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"PageWrapper.d.ts","sourceRoot":"","sources":["../../../src/components/PageWrapper/PageWrapper.tsx"],"names":[],"mappings":"AAIA,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AASlD,QAAA,MAAM,WAAW,GAAI,gDAMlB,gBAAgB,4CAMlB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { styled } from "@mui/material";
|
|
3
3
|
import Stack from "@mui/material/Stack";
|
|
4
4
|
import Footer from "../Footer/Footer";
|
|
5
5
|
import Navigation from "../Navigation/Navigation";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
6
|
+
const StackWithDefaultBgColor = styled(Stack)(({ theme }) => ({
|
|
7
|
+
backgroundColor: theme.vars?.palette.background.default,
|
|
8
|
+
justifyContent: "space-between",
|
|
9
|
+
minHeight: "100vh",
|
|
10
|
+
position: "relative",
|
|
11
|
+
}));
|
|
12
|
+
const PageWrapper = ({ children, version, appName, desc, ...props }) => (_jsxs(StackWithDefaultBgColor, { direction: "column", children: [_jsx(Navigation, { ...props }), children, _jsx(Footer, { version: version, appName: appName, desc: desc })] }));
|
|
13
|
+
export default PageWrapper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RowContent.d.ts","sourceRoot":"","sources":["../../../src/components/SmartTable/RowContent.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAY,MAAM,eAAe,CAAC;AAEzD,OAAc,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE7C,OAAO,EAAE,MAAM,EAAE,M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AAA;CAAE,EACpB,EACA,GAAG,EACH,OAAO,EACP,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,qBAAqB,EAErB,qBAAqB,GACtB,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,2CA0F1B;wBAEwC,OAAO,UAAU;AAA1D,wBAA2D"}
|
|
@@ -3,6 +3,7 @@ import { useTheme } from "@mui/material";
|
|
|
3
3
|
import TableCell from "@mui/material/TableCell";
|
|
4
4
|
import React from "react";
|
|
5
5
|
import { JSONTree } from "react-json-tree";
|
|
6
|
+
import { prettyDatetime } from "../../utils";
|
|
6
7
|
const hiddenTextStyle = {
|
|
7
8
|
whiteSpace: "nowrap",
|
|
8
9
|
overflow: "hidden",
|
|
@@ -57,13 +58,11 @@ function RowContent({ row, columns, onSelectRow, onDoubleClick, ControlComponent
|
|
|
57
58
|
: undefined, children: col.CellContentComponent ? (_jsx(col.CellContentComponent, { ...{ row, ...col.CellContentComponentProps } })) : typeof Object(row)[col.name] === "object" &&
|
|
58
59
|
Object(row)[col.name] != null ? (_jsx(JSONTree
|
|
59
60
|
/*invertTheme={invertTheme}*/ , {
|
|
60
|
-
/*invertTheme={invertTheme}*/ theme: treeTheme, shouldExpandNodeInitially: () => false, data: Object(row)[col.name] })) : (Object(row)[col.name] || "N/A") }, idx))), ControlComponent && (_jsx(TableCell, { sx: {
|
|
61
|
+
/*invertTheme={invertTheme}*/ theme: treeTheme, shouldExpandNodeInitially: () => false, data: Object(row)[col.name] })) : col.type === "datetime" ? (prettyDatetime(Object(row)[col.name])) : (Object(row)[col.name] || "N/A") }, idx))), ControlComponent && (_jsx(TableCell, { sx: {
|
|
61
62
|
textAlign: "center",
|
|
62
63
|
cursor: "default",
|
|
63
64
|
p: 0,
|
|
64
65
|
...controlComponentColSx,
|
|
65
66
|
}, children: _jsx(ControlComponent, { ...{ row, ...ControlComponentProps } }) }))] }));
|
|
66
67
|
}
|
|
67
|
-
// Memoize to prevent re-renders when row/columns/props haven't changed
|
|
68
|
-
// This is critical for scroll performance with heavy cellContentComponent renders
|
|
69
68
|
export default React.memo(RowContent);
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,wBAAwB,CAAC;AAEhC,OAAO,kBAAkB,CAAC;AAG1B,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAE9C,wBAAgB,YAAY,WAI3B;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,QAI5C;AAED,wBAAgB,cAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,UAMtD;AAED,eAAO,MAAM,aAAa,GACxB,WAAW,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,2EAc5D,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,WAWtC,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,UAAU,MAAM,WAK9C,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,WAyC5C,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,UAAU,MAAM,EAAE,OAAO,MAAM,WAkB9D,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,wBAAwB,CAAC;AAEhC,OAAO,kBAAkB,CAAC;AAG1B,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAE9C,wBAAgB,YAAY,WAI3B;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,QAI5C;AAED,wBAAgB,cAAc,CAAC,QAAQ,CAAC,EAAE,MAA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