@danikokonn/yarik-frontend-lib 2.0.2-test3
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/LICENSE +201 -0
- package/README.md +1 -0
- package/dist/components/ActionDialog/ActionDialog.d.ts +23 -0
- package/dist/components/ActionDialog/ActionDialog.d.ts.map +1 -0
- package/dist/components/ActionDialog/ActionDialog.js +48 -0
- package/dist/components/ActionDialog/ActionDialogProps.d.ts +32 -0
- package/dist/components/ActionDialog/ActionDialogProps.d.ts.map +1 -0
- package/dist/components/ActionDialog/ActionDialogProps.js +1 -0
- package/dist/components/ActionDialog/index.d.ts +5 -0
- package/dist/components/ActionDialog/index.d.ts.map +1 -0
- package/dist/components/ActionDialog/index.js +3 -0
- package/dist/components/ColumnSearchInput/ColumnSearchInput.d.ts +16 -0
- package/dist/components/ColumnSearchInput/ColumnSearchInput.d.ts.map +1 -0
- package/dist/components/ColumnSearchInput/ColumnSearchInput.js +30 -0
- package/dist/components/ColumnSearchInput/ColumnSearchInputProps.d.ts +18 -0
- package/dist/components/ColumnSearchInput/ColumnSearchInputProps.d.ts.map +1 -0
- package/dist/components/ColumnSearchInput/ColumnSearchInputProps.js +1 -0
- package/dist/components/ColumnSearchInput/index.d.ts +5 -0
- package/dist/components/ColumnSearchInput/index.d.ts.map +1 -0
- package/dist/components/ColumnSearchInput/index.js +3 -0
- package/dist/components/DateTimeRangePicker/DateTimeRangePicker.d.ts +5 -0
- package/dist/components/DateTimeRangePicker/DateTimeRangePicker.d.ts.map +1 -0
- package/dist/components/DateTimeRangePicker/DateTimeRangePicker.js +51 -0
- package/dist/components/DateTimeRangePicker/DateTimeRangePickerProps.d.ts +11 -0
- package/dist/components/DateTimeRangePicker/DateTimeRangePickerProps.d.ts.map +1 -0
- package/dist/components/DateTimeRangePicker/DateTimeRangePickerProps.js +1 -0
- package/dist/components/DateTimeRangePicker/index.d.ts +5 -0
- package/dist/components/DateTimeRangePicker/index.d.ts.map +1 -0
- package/dist/components/DateTimeRangePicker/index.js +3 -0
- package/dist/components/DatetimeRangeInput/DatetimeRangeInput.d.ts +23 -0
- package/dist/components/DatetimeRangeInput/DatetimeRangeInput.d.ts.map +1 -0
- package/dist/components/DatetimeRangeInput/DatetimeRangeInput.js +80 -0
- package/dist/components/DatetimeRangeInput/DatetimeRangeInputProps.d.ts +43 -0
- package/dist/components/DatetimeRangeInput/DatetimeRangeInputProps.d.ts.map +1 -0
- package/dist/components/DatetimeRangeInput/DatetimeRangeInputProps.js +1 -0
- package/dist/components/DatetimeRangeInput/index.d.ts +5 -0
- package/dist/components/DatetimeRangeInput/index.d.ts.map +1 -0
- package/dist/components/DatetimeRangeInput/index.js +3 -0
- package/dist/components/Footer/Footer.d.ts +7 -0
- package/dist/components/Footer/Footer.d.ts.map +1 -0
- package/dist/components/Footer/Footer.js +22 -0
- package/dist/components/Footer/index.d.ts +3 -0
- package/dist/components/Footer/index.d.ts.map +1 -0
- package/dist/components/Footer/index.js +2 -0
- package/dist/components/IpAddressInput/IpAddressInput.d.ts +5 -0
- package/dist/components/IpAddressInput/IpAddressInput.d.ts.map +1 -0
- package/dist/components/IpAddressInput/IpAddressInput.js +21 -0
- package/dist/components/IpAddressInput/IpAddressInputProps.d.ts +13 -0
- package/dist/components/IpAddressInput/IpAddressInputProps.d.ts.map +1 -0
- package/dist/components/IpAddressInput/IpAddressInputProps.js +1 -0
- package/dist/components/IpAddressInput/index.d.ts +5 -0
- package/dist/components/IpAddressInput/index.d.ts.map +1 -0
- package/dist/components/IpAddressInput/index.js +3 -0
- package/dist/components/IpAddressSwitchableInput/IpAddressSwitchableInput.d.ts +5 -0
- package/dist/components/IpAddressSwitchableInput/IpAddressSwitchableInput.d.ts.map +1 -0
- package/dist/components/IpAddressSwitchableInput/IpAddressSwitchableInput.js +11 -0
- package/dist/components/IpAddressSwitchableInput/IpAddressSwitchableInputProps.d.ts +10 -0
- package/dist/components/IpAddressSwitchableInput/IpAddressSwitchableInputProps.d.ts.map +1 -0
- package/dist/components/IpAddressSwitchableInput/IpAddressSwitchableInputProps.js +1 -0
- package/dist/components/IpAddressSwitchableInput/index.d.ts +5 -0
- package/dist/components/IpAddressSwitchableInput/index.d.ts.map +1 -0
- package/dist/components/IpAddressSwitchableInput/index.js +3 -0
- package/dist/components/LocalizedDatetimePicker/LocalizedDatetimePicker.d.ts +5 -0
- package/dist/components/LocalizedDatetimePicker/LocalizedDatetimePicker.d.ts.map +1 -0
- package/dist/components/LocalizedDatetimePicker/LocalizedDatetimePicker.js +29 -0
- package/dist/components/LocalizedDatetimePicker/LocalizedDatetimePickerProps.d.ts +10 -0
- package/dist/components/LocalizedDatetimePicker/LocalizedDatetimePickerProps.d.ts.map +1 -0
- package/dist/components/LocalizedDatetimePicker/LocalizedDatetimePickerProps.js +1 -0
- package/dist/components/LocalizedDatetimePicker/index.d.ts +5 -0
- package/dist/components/LocalizedDatetimePicker/index.d.ts.map +1 -0
- package/dist/components/LocalizedDatetimePicker/index.js +3 -0
- package/dist/components/Navigation/NavMenu.d.ts +19 -0
- package/dist/components/Navigation/NavMenu.d.ts.map +1 -0
- package/dist/components/Navigation/NavMenu.js +44 -0
- package/dist/components/Navigation/Navigation.d.ts +4 -0
- package/dist/components/Navigation/Navigation.d.ts.map +1 -0
- package/dist/components/Navigation/Navigation.js +188 -0
- package/dist/components/Navigation/NavigationProps.d.ts +30 -0
- package/dist/components/Navigation/NavigationProps.d.ts.map +1 -0
- package/dist/components/Navigation/NavigationProps.js +1 -0
- package/dist/components/Navigation/index.d.ts +5 -0
- package/dist/components/Navigation/index.d.ts.map +1 -0
- package/dist/components/Navigation/index.js +3 -0
- package/dist/components/NumberRangeInput/NumberRangeInput.d.ts +5 -0
- package/dist/components/NumberRangeInput/NumberRangeInput.d.ts.map +1 -0
- package/dist/components/NumberRangeInput/NumberRangeInput.js +51 -0
- package/dist/components/NumberRangeInput/NumberRangeInputProps.d.ts +11 -0
- package/dist/components/NumberRangeInput/NumberRangeInputProps.d.ts.map +1 -0
- package/dist/components/NumberRangeInput/NumberRangeInputProps.js +1 -0
- package/dist/components/NumberRangeInput/index.d.ts +5 -0
- package/dist/components/NumberRangeInput/index.d.ts.map +1 -0
- package/dist/components/NumberRangeInput/index.js +3 -0
- package/dist/components/PageWrapper/PageWrapper.d.ts +4 -0
- package/dist/components/PageWrapper/PageWrapper.d.ts.map +1 -0
- package/dist/components/PageWrapper/PageWrapper.js +16 -0
- package/dist/components/PageWrapper/PageWrapperProps.d.ts +10 -0
- package/dist/components/PageWrapper/PageWrapperProps.d.ts.map +1 -0
- package/dist/components/PageWrapper/PageWrapperProps.js +1 -0
- package/dist/components/PageWrapper/index.d.ts +5 -0
- package/dist/components/PageWrapper/index.d.ts.map +1 -0
- package/dist/components/PageWrapper/index.js +3 -0
- package/dist/components/RichFilterTextField/FilterHistoryMenu.d.ts +8 -0
- package/dist/components/RichFilterTextField/FilterHistoryMenu.d.ts.map +1 -0
- package/dist/components/RichFilterTextField/FilterHistoryMenu.js +43 -0
- package/dist/components/RichFilterTextField/HintOptionsMenu.d.ts +12 -0
- package/dist/components/RichFilterTextField/HintOptionsMenu.d.ts.map +1 -0
- package/dist/components/RichFilterTextField/HintOptionsMenu.js +50 -0
- package/dist/components/RichFilterTextField/RichFilterTextField.d.ts +5 -0
- package/dist/components/RichFilterTextField/RichFilterTextField.d.ts.map +1 -0
- package/dist/components/RichFilterTextField/RichFilterTextField.js +177 -0
- package/dist/components/RichFilterTextField/RichFilterTextFieldProps.d.ts +71 -0
- package/dist/components/RichFilterTextField/RichFilterTextFieldProps.d.ts.map +1 -0
- package/dist/components/RichFilterTextField/RichFilterTextFieldProps.js +1 -0
- package/dist/components/RichFilterTextField/index.d.ts +5 -0
- package/dist/components/RichFilterTextField/index.d.ts.map +1 -0
- package/dist/components/RichFilterTextField/index.js +3 -0
- package/dist/components/RichFilterTextField/utils.d.ts +7 -0
- package/dist/components/RichFilterTextField/utils.d.ts.map +1 -0
- package/dist/components/RichFilterTextField/utils.js +131 -0
- package/dist/components/SmartTable/RowContent.d.ts +14 -0
- package/dist/components/SmartTable/RowContent.d.ts.map +1 -0
- package/dist/components/SmartTable/RowContent.js +29 -0
- package/dist/components/SmartTable/RuleRow.d.ts +22 -0
- package/dist/components/SmartTable/RuleRow.d.ts.map +1 -0
- package/dist/components/SmartTable/RuleRow.js +35 -0
- package/dist/components/SmartTable/SmartTable.d.ts +4 -0
- package/dist/components/SmartTable/SmartTable.d.ts.map +1 -0
- package/dist/components/SmartTable/SmartTable.js +175 -0
- package/dist/components/SmartTable/SmartTableProps.d.ts +40 -0
- package/dist/components/SmartTable/SmartTableProps.d.ts.map +1 -0
- package/dist/components/SmartTable/SmartTableProps.js +1 -0
- package/dist/components/SmartTable/TableHeader.d.ts +5 -0
- package/dist/components/SmartTable/TableHeader.d.ts.map +1 -0
- package/dist/components/SmartTable/TableHeader.js +13 -0
- package/dist/components/SmartTable/index.d.ts +5 -0
- package/dist/components/SmartTable/index.d.ts.map +1 -0
- package/dist/components/SmartTable/index.js +3 -0
- package/dist/components/SortBtn/SortBtn.d.ts +4 -0
- package/dist/components/SortBtn/SortBtn.d.ts.map +1 -0
- package/dist/components/SortBtn/SortBtn.js +23 -0
- package/dist/components/SortBtn/SortBtnProps.d.ts +7 -0
- package/dist/components/SortBtn/SortBtnProps.d.ts.map +1 -0
- package/dist/components/SortBtn/SortBtnProps.js +1 -0
- package/dist/components/SortBtn/index.d.ts +5 -0
- package/dist/components/SortBtn/index.d.ts.map +1 -0
- package/dist/components/SortBtn/index.js +3 -0
- package/dist/components/SubtaskItem/SubtaskItem.d.ts +4 -0
- package/dist/components/SubtaskItem/SubtaskItem.d.ts.map +1 -0
- package/dist/components/SubtaskItem/SubtaskItem.js +66 -0
- package/dist/components/SubtaskItem/SubtaskItemProps.d.ts +10 -0
- package/dist/components/SubtaskItem/SubtaskItemProps.d.ts.map +1 -0
- package/dist/components/SubtaskItem/SubtaskItemProps.js +1 -0
- package/dist/components/SubtaskItem/index.d.ts +5 -0
- package/dist/components/SubtaskItem/index.d.ts.map +1 -0
- package/dist/components/SubtaskItem/index.js +3 -0
- package/dist/components/TaskLoader/TaskLoader.d.ts +4 -0
- package/dist/components/TaskLoader/TaskLoader.d.ts.map +1 -0
- package/dist/components/TaskLoader/TaskLoader.js +333 -0
- package/dist/components/TaskLoader/TaskLoaderProps.d.ts +5 -0
- package/dist/components/TaskLoader/TaskLoaderProps.d.ts.map +1 -0
- package/dist/components/TaskLoader/TaskLoaderProps.js +1 -0
- package/dist/components/TaskLoader/index.d.ts +5 -0
- package/dist/components/TaskLoader/index.d.ts.map +1 -0
- package/dist/components/TaskLoader/index.js +3 -0
- package/dist/components/TaskStateDialog/TaskStateDialog.d.ts +4 -0
- package/dist/components/TaskStateDialog/TaskStateDialog.d.ts.map +1 -0
- package/dist/components/TaskStateDialog/TaskStateDialog.js +106 -0
- package/dist/components/TaskStateDialog/TaskStateDialogProps.d.ts +18 -0
- package/dist/components/TaskStateDialog/TaskStateDialogProps.d.ts.map +1 -0
- package/dist/components/TaskStateDialog/TaskStateDialogProps.js +1 -0
- package/dist/components/TaskStateDialog/index.d.ts +5 -0
- package/dist/components/TaskStateDialog/index.d.ts.map +1 -0
- package/dist/components/TaskStateDialog/index.js +3 -0
- package/dist/components/icons/GenerateAndRunIcon.d.ts +8 -0
- package/dist/components/icons/GenerateAndRunIcon.d.ts.map +1 -0
- package/dist/components/icons/GenerateAndRunIcon.js +29 -0
- package/dist/components/icons/GenerateIcon.d.ts +8 -0
- package/dist/components/icons/GenerateIcon.d.ts.map +1 -0
- package/dist/components/icons/GenerateIcon.js +27 -0
- package/dist/components/icons/IntegerIcon.d.ts +8 -0
- package/dist/components/icons/IntegerIcon.d.ts.map +1 -0
- package/dist/components/icons/IntegerIcon.js +15 -0
- package/dist/components/icons/ProcessingIcon.d.ts +3 -0
- package/dist/components/icons/ProcessingIcon.d.ts.map +1 -0
- package/dist/components/icons/ProcessingIcon.js +15 -0
- package/dist/components/icons/QueueIcon.d.ts +8 -0
- package/dist/components/icons/QueueIcon.d.ts.map +1 -0
- package/dist/components/icons/QueueIcon.js +15 -0
- package/dist/components/icons/RangeIcon.d.ts +8 -0
- package/dist/components/icons/RangeIcon.d.ts.map +1 -0
- package/dist/components/icons/RangeIcon.js +15 -0
- package/dist/components/icons/RunIcon.d.ts +8 -0
- package/dist/components/icons/RunIcon.d.ts.map +1 -0
- package/dist/components/icons/RunIcon.js +18 -0
- package/dist/components/icons/TextModeIcon.d.ts +5 -0
- package/dist/components/icons/TextModeIcon.d.ts.map +1 -0
- package/dist/components/icons/TextModeIcon.js +8 -0
- package/dist/components/icons/TreeModeIcon.d.ts +5 -0
- package/dist/components/icons/TreeModeIcon.d.ts.map +1 -0
- package/dist/components/icons/TreeModeIcon.js +8 -0
- package/dist/components/icons/index.d.ts +10 -0
- package/dist/components/icons/index.d.ts.map +1 -0
- package/dist/components/icons/index.js +9 -0
- package/dist/components/index.d.ts +36 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +35 -0
- package/dist/http.d.ts +25 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/http.js +101 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/providers/AirflowProvider.d.ts +14 -0
- package/dist/providers/AirflowProvider.d.ts.map +1 -0
- package/dist/providers/AirflowProvider.js +80 -0
- package/dist/providers/DagStateProvider.d.ts +25 -0
- package/dist/providers/DagStateProvider.d.ts.map +1 -0
- package/dist/providers/DagStateProvider.js +115 -0
- package/dist/providers/SessionProvider.d.ts +11 -0
- package/dist/providers/SessionProvider.d.ts.map +1 -0
- package/dist/providers/SessionProvider.js +37 -0
- package/dist/providers/SnackBarProvider.d.ts +10 -0
- package/dist/providers/SnackBarProvider.d.ts.map +1 -0
- package/dist/providers/SnackBarProvider.js +35 -0
- package/dist/providers/index.d.ts +9 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +8 -0
- package/dist/types.d.ts +80 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +1 -0
- package/dist/utils.d.ts +26 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +193 -0
- package/package.json +94 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import AppBar from "@mui/material/AppBar";
|
|
3
|
+
import Box from "@mui/material/Box";
|
|
4
|
+
import Container from "@mui/material/Container";
|
|
5
|
+
import IconButton from "@mui/material/IconButton";
|
|
6
|
+
import Menu from "@mui/material/Menu";
|
|
7
|
+
import MenuItem from "@mui/material/MenuItem";
|
|
8
|
+
import Toolbar from "@mui/material/Toolbar";
|
|
9
|
+
import Typography from "@mui/material/Typography";
|
|
10
|
+
import LogoutIcon from "@mui/icons-material/Logout";
|
|
11
|
+
import MenuIcon from "@mui/icons-material/Menu";
|
|
12
|
+
import LightModeIcon from "@mui/icons-material/LightMode";
|
|
13
|
+
import DarkModeIcon from "@mui/icons-material/DarkMode";
|
|
14
|
+
import HubIcon from "@mui/icons-material/Hub";
|
|
15
|
+
import ManageAccountsIcon from "@mui/icons-material/ManageAccounts";
|
|
16
|
+
import ArrowDropDownRoundedIcon from "@mui/icons-material/ArrowDropDownRounded";
|
|
17
|
+
import ArrowRightRoundedIcon from "@mui/icons-material/ArrowRightRounded";
|
|
18
|
+
import Avatar from "@mui/material/Avatar";
|
|
19
|
+
import ListItemIcon from "@mui/material/ListItemIcon";
|
|
20
|
+
import ListItemText from "@mui/material/ListItemText";
|
|
21
|
+
import { Button, useColorScheme, useMediaQuery } from "@mui/material";
|
|
22
|
+
import { popoverClasses } from "@mui/material/Popover";
|
|
23
|
+
import NavMenu from "./NavMenu";
|
|
24
|
+
export default function Navigation({ activeTab, additionalControls, username, title, navLinks, logoutPageUrl, defautlUrl, appsUrl, profileUrl, }) {
|
|
25
|
+
const { mode, setMode } = useColorScheme();
|
|
26
|
+
const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
|
|
27
|
+
const [anchorElNav, setAnchorElNav] = React.useState(null);
|
|
28
|
+
let currentlyHoveringElNav = false;
|
|
29
|
+
function handleCloseElNavHover() {
|
|
30
|
+
currentlyHoveringElNav = false;
|
|
31
|
+
setTimeout(() => {
|
|
32
|
+
if (!currentlyHoveringElNav) {
|
|
33
|
+
setAnchorElNav(null);
|
|
34
|
+
}
|
|
35
|
+
}, 50);
|
|
36
|
+
}
|
|
37
|
+
const [avatarAnchorEl, setAvatarAnchorEl] = React.useState(null);
|
|
38
|
+
const openAvatar = Boolean(avatarAnchorEl);
|
|
39
|
+
const getPages = (sx, anchorOrigin, transformOrigin, endIcon) => {
|
|
40
|
+
return navLinks.map((lnk, idx) => {
|
|
41
|
+
if ("groupName" in lnk) {
|
|
42
|
+
return (React.createElement(NavMenu, { key: idx, name: lnk.groupName, routes: lnk.links, activeTab: activeTab, sx: sx, anchorOrigin: anchorOrigin, transformOrigin: transformOrigin, endIcon: endIcon }));
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
React.createElement(Button, { key: 2, href: lnk.url, sx: sx, color: "inherit", variant: "text" }, lnk.name);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
const getMenuItemsPages = (sx, anchorOrigin, transformOrigin, endIcon) => {
|
|
50
|
+
return getPages(sx, anchorOrigin, transformOrigin, endIcon).map((page, idx) => {
|
|
51
|
+
return (React.createElement(MenuItem, { sx: { p: 0 }, key: idx, onClick: () => setAnchorElNav(null) }, page));
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
return (React.createElement(AppBar, { color: "inherit", position: "sticky", style: { top: "0%", zIndex: 1000 } },
|
|
55
|
+
React.createElement(Container, { maxWidth: "xl" },
|
|
56
|
+
React.createElement(Toolbar, { disableGutters: true },
|
|
57
|
+
React.createElement(Typography, { variant: "h6", component: "a", noWrap: true, href: defautlUrl, sx: {
|
|
58
|
+
mr: 2,
|
|
59
|
+
display: { xs: "none", md: "flex" },
|
|
60
|
+
fontWeight: 700,
|
|
61
|
+
color: "inherit",
|
|
62
|
+
textDecoration: "none",
|
|
63
|
+
} }, title),
|
|
64
|
+
React.createElement(Box, { className: "me-auto", sx: {
|
|
65
|
+
flexGrow: 1,
|
|
66
|
+
display: { xs: "flex", md: "none" },
|
|
67
|
+
marginRight: "auto",
|
|
68
|
+
} },
|
|
69
|
+
React.createElement(IconButton, { size: "large", color: "inherit", onClick: (e) => {
|
|
70
|
+
if (anchorElNav !== e.currentTarget)
|
|
71
|
+
setAnchorElNav(e.currentTarget);
|
|
72
|
+
}, onMouseOver: (e) => {
|
|
73
|
+
if (anchorElNav !== e.currentTarget)
|
|
74
|
+
setAnchorElNav(e.currentTarget);
|
|
75
|
+
}, onMouseLeave: handleCloseElNavHover },
|
|
76
|
+
React.createElement(MenuIcon, null)),
|
|
77
|
+
React.createElement(Menu, { autoFocus: false, id: "menu-appbar", anchorEl: anchorElNav, anchorOrigin: {
|
|
78
|
+
vertical: "bottom",
|
|
79
|
+
horizontal: "left",
|
|
80
|
+
}, keepMounted: true, transformOrigin: {
|
|
81
|
+
vertical: "top",
|
|
82
|
+
horizontal: "left",
|
|
83
|
+
}, open: Boolean(anchorElNav), onClose: () => setAnchorElNav(null), MenuListProps: {
|
|
84
|
+
onMouseEnter: () => (currentlyHoveringElNav = true),
|
|
85
|
+
onMouseLeave: handleCloseElNavHover,
|
|
86
|
+
style: { pointerEvents: "auto" },
|
|
87
|
+
}, sx: {
|
|
88
|
+
display: { xs: "block", md: "none" },
|
|
89
|
+
[`&.${popoverClasses.root}`]: { pointerEvents: "none" },
|
|
90
|
+
} }, getMenuItemsPages({
|
|
91
|
+
textAlign: "center",
|
|
92
|
+
display: "flex",
|
|
93
|
+
justifyContent: "space-between",
|
|
94
|
+
width: "-webkit-fill-available",
|
|
95
|
+
}, {
|
|
96
|
+
vertical: "top",
|
|
97
|
+
horizontal: "right",
|
|
98
|
+
}, {
|
|
99
|
+
vertical: "top",
|
|
100
|
+
horizontal: "left",
|
|
101
|
+
}, React.createElement(ArrowRightRoundedIcon, null)))),
|
|
102
|
+
React.createElement(Typography, { variant: "h5", component: "a", noWrap: true, href: defautlUrl, sx: {
|
|
103
|
+
mr: 2,
|
|
104
|
+
display: { xs: "flex", md: "none" },
|
|
105
|
+
flexGrow: 1,
|
|
106
|
+
fontWeight: 700,
|
|
107
|
+
color: "inherit",
|
|
108
|
+
textDecoration: "none",
|
|
109
|
+
} }, title),
|
|
110
|
+
React.createElement(Box, { sx: {
|
|
111
|
+
flexGrow: 1,
|
|
112
|
+
display: { xs: "none", md: "flex" },
|
|
113
|
+
gap: ".3rem",
|
|
114
|
+
} }, getPages({ display: "flex" }, {
|
|
115
|
+
vertical: "bottom",
|
|
116
|
+
horizontal: "left",
|
|
117
|
+
}, {
|
|
118
|
+
vertical: "top",
|
|
119
|
+
horizontal: "left",
|
|
120
|
+
}, React.createElement(ArrowDropDownRoundedIcon, null))),
|
|
121
|
+
React.createElement(Box, { sx: { flexGrow: 0 } },
|
|
122
|
+
additionalControls &&
|
|
123
|
+
additionalControls.map((control, idx) => (React.createElement(IconButton, { className: "position-relative", key: idx,
|
|
124
|
+
// @ts-expect-error такой пропс на самом деле есть
|
|
125
|
+
href: control.href, color: control.color, title: control.title, onClick: (e) => control.onClick(`${e.clientX}px ${e.clientY}px`), disabled: control.disabled, size: "large" }, control.icon))),
|
|
126
|
+
React.createElement(IconButton, { title: "\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0442\u0435\u043C\u0443", onClick: (_) => {
|
|
127
|
+
if (mode === "light")
|
|
128
|
+
setMode("dark");
|
|
129
|
+
else if (mode === "dark")
|
|
130
|
+
setMode("light");
|
|
131
|
+
else {
|
|
132
|
+
if (prefersDarkMode) {
|
|
133
|
+
setMode("light");
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
setMode("dark");
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
} }, mode === "light" ? React.createElement(LightModeIcon, null) : React.createElement(DarkModeIcon, null)),
|
|
140
|
+
appsUrl && (React.createElement(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 },
|
|
141
|
+
React.createElement(HubIcon, null))),
|
|
142
|
+
React.createElement(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 } },
|
|
143
|
+
React.createElement(Avatar, { sx: { width: 32, height: 32 } }, username.substring(0, 1).toUpperCase())),
|
|
144
|
+
React.createElement(Menu, { anchorEl: avatarAnchorEl, open: openAvatar, onClose: () => setAvatarAnchorEl(null), onClick: () => setAvatarAnchorEl(null), slotProps: {
|
|
145
|
+
paper: {
|
|
146
|
+
elevation: 0,
|
|
147
|
+
sx: {
|
|
148
|
+
overflow: "visible",
|
|
149
|
+
filter: "drop-shadow(0px 2px 8px rgba(0,0,0,0.32))",
|
|
150
|
+
mt: 1.5,
|
|
151
|
+
"& .MuiAvatar-root": {
|
|
152
|
+
width: 32,
|
|
153
|
+
height: 32,
|
|
154
|
+
ml: -0.5,
|
|
155
|
+
mr: 1,
|
|
156
|
+
},
|
|
157
|
+
"&::before": {
|
|
158
|
+
content: '""',
|
|
159
|
+
display: "block",
|
|
160
|
+
position: "absolute",
|
|
161
|
+
top: 0,
|
|
162
|
+
right: 14,
|
|
163
|
+
width: 10,
|
|
164
|
+
height: 10,
|
|
165
|
+
bgcolor: "background.paper",
|
|
166
|
+
transform: "translateY(-50%) rotate(45deg)",
|
|
167
|
+
zIndex: 0,
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
}, transformOrigin: { horizontal: "right", vertical: "top" }, anchorOrigin: { horizontal: "right", vertical: "bottom" } },
|
|
172
|
+
React.createElement(MenuItem, { sx: { pointerEvents: "none" } },
|
|
173
|
+
React.createElement(Avatar, null),
|
|
174
|
+
" ",
|
|
175
|
+
username),
|
|
176
|
+
profileUrl && (React.createElement(MenuItem, { href: new URL(profileUrl, location.origin).href, component: "a" },
|
|
177
|
+
React.createElement(ListItemIcon, null,
|
|
178
|
+
React.createElement(ManageAccountsIcon, { fontSize: "small" })),
|
|
179
|
+
React.createElement(ListItemText, null, "\u0414\u0430\u043D\u043D\u044B\u0435 \u043F\u0440\u043E\u0444\u0438\u043B\u044F"))),
|
|
180
|
+
appsUrl && (React.createElement(MenuItem, { href: new URL(appsUrl, location.origin).href, component: "a" },
|
|
181
|
+
React.createElement(ListItemIcon, null,
|
|
182
|
+
React.createElement(HubIcon, { fontSize: "small" })),
|
|
183
|
+
React.createElement(ListItemText, null, "\u041F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F"))),
|
|
184
|
+
React.createElement(MenuItem, { href: logoutPageUrl, component: "a" },
|
|
185
|
+
React.createElement(ListItemIcon, null,
|
|
186
|
+
React.createElement(LogoutIcon, { fontSize: "small" })),
|
|
187
|
+
React.createElement(ListItemText, null, "\u0412\u044B\u0439\u0442\u0438 \u0438\u0437 \u0441\u0438\u0441\u0442\u0435\u043C\u044B"))))))));
|
|
188
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
interface Control {
|
|
2
|
+
color: "default" | "primary" | "secondary" | "success" | "warning" | "info" | "inherit" | "error";
|
|
3
|
+
title: string;
|
|
4
|
+
href?: string;
|
|
5
|
+
size?: "lg" | "sm" | "custom" | "custom-size" | "xl" | "xxl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl";
|
|
6
|
+
icon: React.ReactNode;
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
onClick(clickPos: string): void;
|
|
9
|
+
}
|
|
10
|
+
interface Link {
|
|
11
|
+
name: string;
|
|
12
|
+
url: string;
|
|
13
|
+
targetBlank?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export default interface NavigationProps {
|
|
16
|
+
activeTab: string;
|
|
17
|
+
username: string;
|
|
18
|
+
appsUrl?: string;
|
|
19
|
+
profileUrl?: string;
|
|
20
|
+
additionalControls?: Control[];
|
|
21
|
+
logoutPageUrl: string;
|
|
22
|
+
defautlUrl: string;
|
|
23
|
+
title: string;
|
|
24
|
+
navLinks: ({
|
|
25
|
+
groupName: string;
|
|
26
|
+
links: Link[];
|
|
27
|
+
} | Link)[];
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=NavigationProps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavigationProps.d.ts","sourceRoot":"","sources":["../../../src/components/Navigation/NavigationProps.ts"],"names":[],"mappings":"AAAA,UAAU,OAAO;IACf,KAAK,EACD,SAAS,GACT,SAAS,GACT,WAAW,GACX,SAAS,GACT,SAAS,GACT,MAAM,GACN,SAAS,GACT,OAAO,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EACD,IAAI,GACJ,IAAI,GACJ,QAAQ,GACR,aAAa,GACb,IAAI,GACJ,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,CAAC;IACV,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED,UAAU,IAAI;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,WAAW,eAAe;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,OAAO,EAAE,CAAC;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CACN;QACE,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,IAAI,EAAE,CAAC;KACf,GACD,IAAI,CACP,EAAE,CAAC;CACL"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Navigation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,cAAc,cAAc,CAAC;AAE7B,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import NumberRangeInputProps from "./NumberRangeInputProps";
|
|
3
|
+
declare const NumberRangeInput: ({ from: _from, to: _to, variant, sx, placeholder, size, onRangeSet, }: NumberRangeInputProps) => React.JSX.Element;
|
|
4
|
+
export default NumberRangeInput;
|
|
5
|
+
//# sourceMappingURL=NumberRangeInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NumberRangeInput.d.ts","sourceRoot":"","sources":["../../../src/components/NumberRangeInput/NumberRangeInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAOxC,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAG5D,QAAA,MAAM,gBAAgB,GAAI,uEAQvB,qBAAqB,sBAgGvB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import IconButton from "@mui/material/IconButton";
|
|
3
|
+
import Popover from "@mui/material/Popover";
|
|
4
|
+
import TextField from "@mui/material/TextField";
|
|
5
|
+
import ClearIcon from "@mui/icons-material/Clear";
|
|
6
|
+
import { Stack } from "@mui/material";
|
|
7
|
+
const NumberRangeInput = ({ from: _from, to: _to, variant, sx, placeholder, size, onRangeSet, }) => {
|
|
8
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
9
|
+
const [from, setFrom] = useState(_from);
|
|
10
|
+
const [to, setTo] = useState(_to);
|
|
11
|
+
const rangeText = (from != null && to != null && `(${from}, ${to})`) || "";
|
|
12
|
+
const open = Boolean(anchorEl);
|
|
13
|
+
const validRange = from && to && from !== to && from < to;
|
|
14
|
+
return (React.createElement(React.Fragment, null,
|
|
15
|
+
React.createElement(TextField, { size: size, variant: variant || "standard", placeholder: open ? rangeText || "" : "", label: placeholder, title: validRange ? rangeText : "Некорректно введён диапазон", value: rangeText, onClick: (e) => setAnchorEl(e.currentTarget), error: !validRange, sx: sx, required: true, slotProps: {
|
|
16
|
+
input: {
|
|
17
|
+
readOnly: true,
|
|
18
|
+
endAdornment: rangeText.length > 0 ? (React.createElement(IconButton, { onClick: (e) => {
|
|
19
|
+
setFrom(null);
|
|
20
|
+
setTo(null);
|
|
21
|
+
onRangeSet(null, null);
|
|
22
|
+
e.stopPropagation();
|
|
23
|
+
} },
|
|
24
|
+
React.createElement(ClearIcon, { fontSize: "small" }))) : null,
|
|
25
|
+
},
|
|
26
|
+
inputLabel: {
|
|
27
|
+
shrink: open || rangeText.length > 0, // позволяет метке находиться сверху при поиске, при этом выбранное значение будет в заполнителе
|
|
28
|
+
},
|
|
29
|
+
} }),
|
|
30
|
+
React.createElement(Popover, { open: open, anchorEl: anchorEl, onClose: () => setAnchorEl(null), anchorOrigin: {
|
|
31
|
+
vertical: "bottom",
|
|
32
|
+
horizontal: "left",
|
|
33
|
+
}, transformOrigin: {
|
|
34
|
+
vertical: "top",
|
|
35
|
+
horizontal: "left",
|
|
36
|
+
}, slotProps: {
|
|
37
|
+
paper: {
|
|
38
|
+
sx: { minWidth: "30rem" },
|
|
39
|
+
},
|
|
40
|
+
} },
|
|
41
|
+
React.createElement(Stack, { direction: "row", sx: { m: 2 }, spacing: 2 },
|
|
42
|
+
React.createElement(TextField, { required: true, label: "\u041E\u0442", value: from, error: !validRange, onChange: (e) => {
|
|
43
|
+
setFrom(Number(e.target.value));
|
|
44
|
+
onRangeSet(Number(e.target.value), to);
|
|
45
|
+
}, size: "small", type: "number", variant: "standard" }),
|
|
46
|
+
React.createElement(TextField, { required: true, label: "\u0414\u043E", value: to, error: !validRange, onChange: (e) => {
|
|
47
|
+
setTo(Number(e.target.value));
|
|
48
|
+
onRangeSet(from, Number(e.target.value));
|
|
49
|
+
}, size: "small", type: "number", variant: "standard" })))));
|
|
50
|
+
};
|
|
51
|
+
export default NumberRangeInput;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SxProps } from "@mui/material";
|
|
2
|
+
export default interface NumberRangeInputProps {
|
|
3
|
+
from?: number;
|
|
4
|
+
to?: number;
|
|
5
|
+
sx?: SxProps;
|
|
6
|
+
variant?: "outlined" | "standard" | "filled";
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
size?: "small" | "medium";
|
|
9
|
+
onRangeSet(start?: number | null, end?: number | null): void;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=NumberRangeInputProps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NumberRangeInputProps.d.ts","sourceRoot":"","sources":["../../../src/components/NumberRangeInput/NumberRangeInputProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,MAAM,CAAC,OAAO,WAAW,qBAAqB;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,OAAO,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,QAAQ,CAAC;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC1B,UAAU,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;CAC9D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/NumberRangeInput/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AAEnC,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageWrapper.d.ts","sourceRoot":"","sources":["../../../src/components/PageWrapper/PageWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAKlD,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,QAAQ,EACR,OAAO,EACP,OAAO,EACP,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,gBAAgB,qBAkBlB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Stack from "@mui/material/Stack";
|
|
3
|
+
import Navigation from "../Navigation/Navigation";
|
|
4
|
+
import Footer from "../Footer/Footer";
|
|
5
|
+
import { useTheme } from "@mui/material";
|
|
6
|
+
export default function PageWrapper({ children, version, appName, desc, ...props }) {
|
|
7
|
+
const theme = useTheme();
|
|
8
|
+
return (React.createElement(Stack, { direction: "column", bgcolor: theme.palette.background.default, sx: {
|
|
9
|
+
justifyContent: "space-between",
|
|
10
|
+
minHeight: "100vh",
|
|
11
|
+
position: "relative",
|
|
12
|
+
} },
|
|
13
|
+
React.createElement(Navigation, { ...props }),
|
|
14
|
+
children,
|
|
15
|
+
React.createElement(Footer, { version: version, appName: appName, desc: desc })));
|
|
16
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import NavigationProps from "../Navigation/NavigationProps";
|
|
3
|
+
export default interface PageWrapperProps extends NavigationProps {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
username: string;
|
|
6
|
+
version: string;
|
|
7
|
+
appName: string;
|
|
8
|
+
desc?: string;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=PageWrapperProps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageWrapperProps.d.ts","sourceRoot":"","sources":["../../../src/components/PageWrapper/PageWrapperProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,eAAe,MAAM,+BAA+B,CAAC;AAE5D,MAAM,CAAC,OAAO,WAAW,gBAAiB,SAAQ,eAAe;IAC/D,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PageWrapper/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,cAAc,eAAe,CAAC;AAE9B,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const FilterHistoryMenu: ({ searchHist, onChange, onCopy, }: {
|
|
3
|
+
searchHist: string[];
|
|
4
|
+
onChange(text: string, idx: number): void;
|
|
5
|
+
onCopy(): void;
|
|
6
|
+
}) => React.JSX.Element;
|
|
7
|
+
export default FilterHistoryMenu;
|
|
8
|
+
//# sourceMappingURL=FilterHistoryMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterHistoryMenu.d.ts","sourceRoot":"","sources":["../../../src/components/RichFilterTextField/FilterHistoryMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAcxC,QAAA,MAAM,iBAAiB,GAAI,mCAIxB;IACD,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,MAAM,IAAI,IAAI,CAAC;CAChB,sBA2DA,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import Stack from "@mui/material/Stack";
|
|
3
|
+
import IconButton from "@mui/material/IconButton";
|
|
4
|
+
import FilterListIcon from "@mui/icons-material/FilterList";
|
|
5
|
+
import HistoryIcon from "@mui/icons-material/History";
|
|
6
|
+
import ContentCopy from "@mui/icons-material/ContentCopy";
|
|
7
|
+
import Divider from "@mui/material/Divider";
|
|
8
|
+
import ListItemIcon from "@mui/material/ListItemIcon";
|
|
9
|
+
import ListItemText from "@mui/material/ListItemText";
|
|
10
|
+
import Menu from "@mui/material/Menu";
|
|
11
|
+
import MenuItem from "@mui/material/MenuItem";
|
|
12
|
+
import Typography from "@mui/material/Typography";
|
|
13
|
+
const FilterHistoryMenu = ({ searchHist, onChange, onCopy, }) => {
|
|
14
|
+
const [searchHistMenuAnchor, setSearchHistMenuAnchor] = useState(null);
|
|
15
|
+
return (React.createElement(React.Fragment, null,
|
|
16
|
+
React.createElement(IconButton, { color: "secondary", title: "\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0438\u0441\u0442\u043E\u0440\u0438\u044E \u0444\u0438\u043B\u044C\u0442\u0440\u043E\u0432", disabled: searchHist.length === 0, onClick: (e) => {
|
|
17
|
+
setSearchHistMenuAnchor(e.currentTarget);
|
|
18
|
+
e.stopPropagation();
|
|
19
|
+
} },
|
|
20
|
+
React.createElement(FilterListIcon, null)),
|
|
21
|
+
React.createElement(Menu, { anchorEl: searchHistMenuAnchor, open: Boolean(searchHistMenuAnchor), onClose: () => setSearchHistMenuAnchor(null), onClick: () => setSearchHistMenuAnchor(null) },
|
|
22
|
+
React.createElement(Stack, { direction: "row", spacing: 1, sx: {
|
|
23
|
+
px: 2,
|
|
24
|
+
py: 1,
|
|
25
|
+
alignItems: "center",
|
|
26
|
+
} },
|
|
27
|
+
React.createElement(HistoryIcon, null),
|
|
28
|
+
React.createElement(Typography, { variant: "h5" }, "\u0418\u0441\u0442\u043E\u0440\u0438\u044F \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0445 \u0444\u0438\u043B\u044C\u0442\u0440\u043E\u0432")),
|
|
29
|
+
React.createElement(Divider, null),
|
|
30
|
+
searchHist.map((el, idx) => (React.createElement(MenuItem, { key: idx + 1, onClick: () => onChange(el, idx), title: el },
|
|
31
|
+
React.createElement(ListItemText, { sx: { overflow: "hidden" } },
|
|
32
|
+
idx + 1,
|
|
33
|
+
". ",
|
|
34
|
+
el),
|
|
35
|
+
React.createElement(ListItemIcon, null,
|
|
36
|
+
React.createElement(IconButton, { onClick: (e) => {
|
|
37
|
+
navigator.clipboard.writeText(el);
|
|
38
|
+
e.stopPropagation();
|
|
39
|
+
onCopy();
|
|
40
|
+
} },
|
|
41
|
+
React.createElement(ContentCopy, { fontSize: "small" })))))))));
|
|
42
|
+
};
|
|
43
|
+
export default FilterHistoryMenu;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { MutableRefObject } from "react";
|
|
2
|
+
declare const HintOptionsMenu: ({ inputAnchor, inputRef, textFieldRef, options, focusIdx, onSelectHint, onClose, }: {
|
|
3
|
+
inputAnchor: Element;
|
|
4
|
+
inputRef: MutableRefObject<HTMLTextAreaElement>;
|
|
5
|
+
textFieldRef: MutableRefObject<HTMLDivElement>;
|
|
6
|
+
options: Map<string, string | undefined>;
|
|
7
|
+
focusIdx: number;
|
|
8
|
+
onSelectHint(hint: string): void;
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
}) => React.JSX.Element;
|
|
11
|
+
export default HintOptionsMenu;
|
|
12
|
+
//# sourceMappingURL=HintOptionsMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HintOptionsMenu.d.ts","sourceRoot":"","sources":["../../../src/components/RichFilterTextField/HintOptionsMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,gBAAgB,EAAqB,MAAM,OAAO,CAAC;AAMnE,QAAA,MAAM,eAAe,GAAI,oFAQtB;IACD,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,gBAAgB,CAAC,mBAAmB,CAAC,CAAC;IAChD,YAAY,EAAE,gBAAgB,CAAC,cAAc,CAAC,CAAC;IAC/C,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,sBA6EA,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from "react";
|
|
2
|
+
import Menu from "@mui/material/Menu";
|
|
3
|
+
import MenuItem from "@mui/material/MenuItem";
|
|
4
|
+
import ListItemText from "@mui/material/ListItemText";
|
|
5
|
+
const HintOptionsMenu = ({ inputAnchor, inputRef, textFieldRef, options, focusIdx, onSelectHint, onClose, }) => {
|
|
6
|
+
const focusRef = useRef(null);
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
if (focusRef.current == null)
|
|
9
|
+
return;
|
|
10
|
+
focusRef.current.scrollIntoView({ behavior: "smooth" });
|
|
11
|
+
}, [focusRef.current]);
|
|
12
|
+
const menuOptions = () => options
|
|
13
|
+
?.entries()
|
|
14
|
+
.toArray()
|
|
15
|
+
.map((opt, idx) => (React.createElement(MenuItem, { key: idx + 1, onClick: () => onSelectHint(opt[0]), className: focusIdx === idx ? "Mui-focusVisible" : "", ref: focusIdx === idx ? focusRef : null },
|
|
16
|
+
React.createElement(ListItemText, { sx: { overflow: "hidden" }, secondary: opt[1], slotProps: {
|
|
17
|
+
primary: { variant: "subtitle2" },
|
|
18
|
+
secondary: { variant: "caption" },
|
|
19
|
+
} }, opt[0]))));
|
|
20
|
+
return (React.createElement(Menu, { sx: { mt: "5px" }, open: Boolean(inputAnchor), anchorEl: inputAnchor, onClose: (_e, r) => {
|
|
21
|
+
if (r === "escapeKeyDown")
|
|
22
|
+
onClose();
|
|
23
|
+
}, onClick: onClose, anchorOrigin: {
|
|
24
|
+
vertical: "bottom",
|
|
25
|
+
horizontal: "left",
|
|
26
|
+
}, transformOrigin: {
|
|
27
|
+
vertical: "top",
|
|
28
|
+
horizontal: "left",
|
|
29
|
+
}, slotProps: {
|
|
30
|
+
paper: {
|
|
31
|
+
sx: {
|
|
32
|
+
width: textFieldRef?.current?.clientWidth,
|
|
33
|
+
overflowY: "scroll",
|
|
34
|
+
maxHeight: "30rem",
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
root: {
|
|
38
|
+
slotProps: {
|
|
39
|
+
backdrop: {
|
|
40
|
+
onClick: (e) => {
|
|
41
|
+
onClose();
|
|
42
|
+
e.stopPropagation();
|
|
43
|
+
},
|
|
44
|
+
invisible: true,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
}, onFocus: () => inputRef.current.focus(), disableAutoFocus: true, disableEnforceFocus: true, disableRestoreFocus: true }, menuOptions()));
|
|
49
|
+
};
|
|
50
|
+
export default HintOptionsMenu;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import RichFilterTextFieldProps from "./RichFilterTextFieldProps";
|
|
3
|
+
declare const RichFilterTextField: ({ filterExpr, filterExprHist, fields, operators, additionalComponents, instant: _instant, onChange, onSelectFromHistory, }: RichFilterTextFieldProps) => React.JSX.Element;
|
|
4
|
+
export default RichFilterTextField;
|
|
5
|
+
//# sourceMappingURL=RichFilterTextField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RichFilterTextField.d.ts","sourceRoot":"","sources":["../../../src/components/RichFilterTextField/RichFilterTextField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AAUf,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAMlE,QAAA,MAAM,mBAAmB,GAAI,4HAS1B,wBAAwB,sBA0O1B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|