@pipelinesolucoes/menu 1.0.0-beta.0
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 +78 -0
- package/README.md +166 -0
- package/dist/app/layout.d.ts +6 -0
- package/dist/app/layout.js +19 -0
- package/dist/app/layout.js.map +1 -0
- package/dist/app/page.d.ts +1 -0
- package/dist/app/page.js +6 -0
- package/dist/app/page.js.map +1 -0
- package/dist/components/BarraFerramentas.d.ts +13 -0
- package/dist/components/BarraFerramentas.js +31 -0
- package/dist/components/BarraFerramentas.js.map +1 -0
- package/dist/components/BarraFerramentasHamburguer.d.ts +16 -0
- package/dist/components/BarraFerramentasHamburguer.js +42 -0
- package/dist/components/BarraFerramentasHamburguer.js.map +1 -0
- package/dist/components/BarraFerramentasSaaS.d.ts +10 -0
- package/dist/components/BarraFerramentasSaaS.js +18 -0
- package/dist/components/BarraFerramentasSaaS.js.map +1 -0
- package/dist/components/BarraFerramentasStyled.d.ts +14 -0
- package/dist/components/BarraFerramentasStyled.js +61 -0
- package/dist/components/BarraFerramentasStyled.js.map +1 -0
- package/dist/components/ItemMenu.d.ts +30 -0
- package/dist/components/ItemMenu.js +86 -0
- package/dist/components/ItemMenu.js.map +1 -0
- package/dist/components/MenuHamburguer.d.ts +12 -0
- package/dist/components/MenuHamburguer.js +36 -0
- package/dist/components/MenuHamburguer.js.map +1 -0
- package/dist/components/MenuHorizontal.d.ts +34 -0
- package/dist/components/MenuHorizontal.js +52 -0
- package/dist/components/MenuHorizontal.js.map +1 -0
- package/dist/components/MenuVertical.d.ts +35 -0
- package/dist/components/MenuVertical.js +53 -0
- package/dist/components/MenuVertical.js.map +1 -0
- package/dist/components/SideNav.d.ts +83 -0
- package/dist/components/SideNav.js +55 -0
- package/dist/components/SideNav.js.map +1 -0
- package/dist/components/drawer/DesktopDrawer.d.ts +64 -0
- package/dist/components/drawer/DesktopDrawer.js +198 -0
- package/dist/components/drawer/DesktopDrawer.js.map +1 -0
- package/dist/components/drawer/DrawerResponsive.d.ts +74 -0
- package/dist/components/drawer/DrawerResponsive.js +96 -0
- package/dist/components/drawer/DrawerResponsive.js.map +1 -0
- package/dist/components/drawer/IconDrawerTrigger.d.ts +85 -0
- package/dist/components/drawer/IconDrawerTrigger.js +137 -0
- package/dist/components/drawer/IconDrawerTrigger.js.map +1 -0
- package/dist/components/drawer/LogoutIcon.d.ts +4 -0
- package/dist/components/drawer/LogoutIcon.js +10 -0
- package/dist/components/drawer/LogoutIcon.js.map +1 -0
- package/dist/components/drawer/MobileDrawer.d.ts +64 -0
- package/dist/components/drawer/MobileDrawer.js +158 -0
- package/dist/components/drawer/MobileDrawer.js.map +1 -0
- package/dist/components/drawer/UserAvatarMenu.d.ts +77 -0
- package/dist/components/drawer/UserAvatarMenu.js +103 -0
- package/dist/components/drawer/UserAvatarMenu.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/pages/_app.d.ts +2 -0
- package/dist/pages/_app.js +20 -0
- package/dist/pages/_app.js.map +1 -0
- package/dist/pages/_document.d.ts +9 -0
- package/dist/pages/_document.js +33 -0
- package/dist/pages/_document.js.map +1 -0
- package/dist/theme.d.ts +35 -0
- package/dist/theme.js +142 -0
- package/dist/theme.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/Drawer.d.ts +66 -0
- package/dist/types/Drawer.js +2 -0
- package/dist/types/Drawer.js.map +1 -0
- package/dist/types/ItemMenuConfig.d.ts +6 -0
- package/dist/types/ItemMenuConfig.js +2 -0
- package/dist/types/ItemMenuConfig.js.map +1 -0
- package/dist/types/NavItem.d.ts +5 -0
- package/dist/types/NavItem.js +2 -0
- package/dist/types/NavItem.js.map +1 -0
- package/dist/types/RotaMenuConfig.d.ts +4 -0
- package/dist/types/RotaMenuConfig.js +2 -0
- package/dist/types/RotaMenuConfig.js.map +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { styled, useTheme } from '@mui/material/styles';
|
|
4
|
+
import Box from '@mui/material/Box';
|
|
5
|
+
import MuiDrawer from '@mui/material/Drawer';
|
|
6
|
+
import MuiAppBar from '@mui/material/AppBar';
|
|
7
|
+
import Toolbar from '@mui/material/Toolbar';
|
|
8
|
+
import List from '@mui/material/List';
|
|
9
|
+
import Typography from '@mui/material/Typography';
|
|
10
|
+
import Divider from '@mui/material/Divider';
|
|
11
|
+
import IconButton from '@mui/material/IconButton';
|
|
12
|
+
import ChevronLeftIcon from '@mui/icons-material/ChevronLeft';
|
|
13
|
+
import ChevronRightIcon from '@mui/icons-material/ChevronRight';
|
|
14
|
+
import ListItem from '@mui/material/ListItem';
|
|
15
|
+
import ListItemButton from '@mui/material/ListItemButton';
|
|
16
|
+
import ListItemIcon from '@mui/material/ListItemIcon';
|
|
17
|
+
import ListItemText from '@mui/material/ListItemText';
|
|
18
|
+
import { Avatar, CircularProgress } from '@mui/material';
|
|
19
|
+
import MenuIcon from '@mui/icons-material/Menu';
|
|
20
|
+
import { LogoutIcon } from './LogoutIcon';
|
|
21
|
+
import IconDrawerTrigger from './IconDrawerTrigger';
|
|
22
|
+
import UserAvatarMenu from './UserAvatarMenu';
|
|
23
|
+
const drawerWidth = 240;
|
|
24
|
+
const openedMixin = (theme) => ({
|
|
25
|
+
width: drawerWidth,
|
|
26
|
+
transition: theme.transitions.create('width', {
|
|
27
|
+
easing: theme.transitions.easing.sharp,
|
|
28
|
+
duration: theme.transitions.duration.enteringScreen,
|
|
29
|
+
}),
|
|
30
|
+
overflowX: 'hidden',
|
|
31
|
+
});
|
|
32
|
+
const closedMixin = (theme) => ({
|
|
33
|
+
transition: theme.transitions.create('width', {
|
|
34
|
+
easing: theme.transitions.easing.sharp,
|
|
35
|
+
duration: theme.transitions.duration.leavingScreen,
|
|
36
|
+
}),
|
|
37
|
+
overflowX: 'hidden',
|
|
38
|
+
width: `calc(${theme.spacing(7)} + 1px)`,
|
|
39
|
+
[theme.breakpoints.up('sm')]: {
|
|
40
|
+
width: `calc(${theme.spacing(8)} + 1px)`,
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
const DrawerHeader = styled('div')(({ theme }) => (Object.assign({ display: 'flex', alignItems: 'center', justifyContent: 'flex-end', padding: theme.spacing(0, 1) }, theme.mixins.toolbar)));
|
|
44
|
+
const AppBar = styled(MuiAppBar, {
|
|
45
|
+
shouldForwardProp: (prop) => !['open', 'background'].includes(prop),
|
|
46
|
+
})(({ theme, open, background }) => (Object.assign({ background, zIndex: theme.zIndex.drawer + 1, transition: theme.transitions.create(['width', 'margin'], {
|
|
47
|
+
easing: theme.transitions.easing.sharp,
|
|
48
|
+
duration: theme.transitions.duration.leavingScreen,
|
|
49
|
+
}) }, (open && {
|
|
50
|
+
marginLeft: drawerWidth,
|
|
51
|
+
width: `calc(100% - ${drawerWidth}px)`,
|
|
52
|
+
transition: theme.transitions.create(['width', 'margin'], {
|
|
53
|
+
easing: theme.transitions.easing.sharp,
|
|
54
|
+
duration: theme.transitions.duration.enteringScreen,
|
|
55
|
+
}),
|
|
56
|
+
}))));
|
|
57
|
+
const Drawer = styled(MuiDrawer, {
|
|
58
|
+
shouldForwardProp: (prop) => prop !== 'open',
|
|
59
|
+
})(({ theme, open }) => (Object.assign({ width: drawerWidth, flexShrink: 0, whiteSpace: 'nowrap', boxSizing: 'border-box' }, (open
|
|
60
|
+
? Object.assign(Object.assign({}, openedMixin(theme)), { '& .MuiDrawer-paper': openedMixin(theme) }) : Object.assign(Object.assign({}, closedMixin(theme)), { '& .MuiDrawer-paper': closedMixin(theme) })))));
|
|
61
|
+
const ToolbarContent = styled('div')(() => ({
|
|
62
|
+
display: 'flex',
|
|
63
|
+
flexDirection: 'row',
|
|
64
|
+
alignItems: 'center',
|
|
65
|
+
justifyContent: 'end',
|
|
66
|
+
width: '100%',
|
|
67
|
+
gap: '20px',
|
|
68
|
+
}));
|
|
69
|
+
const LoadingOverlay = styled('div', {
|
|
70
|
+
shouldForwardProp: (prop) => !['overlayBackground', 'overlayColor'].includes(prop),
|
|
71
|
+
})(({ overlayBackground, overlayColor, theme }) => ({
|
|
72
|
+
position: 'fixed',
|
|
73
|
+
inset: 0,
|
|
74
|
+
zIndex: theme.zIndex.modal + 1,
|
|
75
|
+
backgroundColor: overlayBackground || 'rgba(0, 0, 0, 0.4)',
|
|
76
|
+
display: 'flex',
|
|
77
|
+
flexDirection: 'column',
|
|
78
|
+
alignItems: 'center',
|
|
79
|
+
justifyContent: 'center',
|
|
80
|
+
pointerEvents: 'auto',
|
|
81
|
+
color: overlayColor || '#ffffff',
|
|
82
|
+
}));
|
|
83
|
+
/**
|
|
84
|
+
* Layout desktop responsável por exibir:
|
|
85
|
+
* - AppBar com botão de menu e informações do usuário;
|
|
86
|
+
* - Drawer lateral (mini/expandido) com itens de navegação;
|
|
87
|
+
* - Conteúdo principal à direita.
|
|
88
|
+
*
|
|
89
|
+
* Também suporta um estado de carregamento (`loading`) que exibe um overlay
|
|
90
|
+
* escurecido com um spinner centralizado, desabilitando a interação com a página.
|
|
91
|
+
*
|
|
92
|
+
* @param {string} backgroundHeader Cor de fundo do AppBar.
|
|
93
|
+
* @param {string} backgroundMenuAvatar Cor de fundo do menu Avatar.
|
|
94
|
+
* @param {string} colorItemMenu Cor do ícone do menu e dos itens de menu.
|
|
95
|
+
* @param {string} colorItemMenuSelected Cor do item de menu selecionado.
|
|
96
|
+
* @param {number | string | null} idUsuarioLogado Id do usuário logado.
|
|
97
|
+
* @param {string} nomeUsuarioLogado Nome do usuário logado.
|
|
98
|
+
* @param {string} emailUsuario Email do usuário logado.
|
|
99
|
+
* @param {Array<any>} menuItems Itens exibidos no Drawer.
|
|
100
|
+
* @param {Array<any>} avatarMenuItems Itens exibidos no menu do avatar.
|
|
101
|
+
* @param {string} profileImage URL final da imagem de avatar já tratada.
|
|
102
|
+
* @param {number} selectedIndex Índice do item selecionado.
|
|
103
|
+
* @param {(index: number) => void} onChangeIndex Callback chamado ao alterar o item selecionado.
|
|
104
|
+
* @param {() => void} [onUnauthenticated] Callback chamado se não tiver usuário logado.
|
|
105
|
+
* @param {React.ReactNode} [toolbarContent] Conteúdos genéricos exibidos na barra de ferramentas (texto, ícones, imagens etc.).
|
|
106
|
+
* @param {boolean} [loading=false] Indica se o overlay de loading deve ser exibido sobre toda a tela.
|
|
107
|
+
* @param {string} [loadingBackgroundColor='rgba(0, 0, 0, 0.4)'] Cor de fundo do overlay de loading.
|
|
108
|
+
* @param {number} [loadingSpinnerSize=48] Tamanho do spinner de loading.
|
|
109
|
+
* @param {string} [loadingMessage] Texto opcional exibido abaixo do spinner de loading.
|
|
110
|
+
* @param {string} [loadingColor='#ffffff'] Cor do spinner e do texto da mensagem de loading.
|
|
111
|
+
*
|
|
112
|
+
* Exibido apenas em `md` ou acima.
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* ```tsx
|
|
116
|
+
* import DesktopDrawer from '@/components/DesktopDrawer';
|
|
117
|
+
*
|
|
118
|
+
* const Example = () => {
|
|
119
|
+
* return (
|
|
120
|
+
* <DesktopDrawer
|
|
121
|
+
* backgroundHeader="#ffffff"
|
|
122
|
+
* backgroundMenuAvatar="#f5f5f5"
|
|
123
|
+
* colorItemMenu="#000000"
|
|
124
|
+
* colorItemMenuSelected="#1976d2"
|
|
125
|
+
* idUsuarioLogado={1}
|
|
126
|
+
* nomeUsuarioLogado="John Doe"
|
|
127
|
+
* emailUsuario="john.doe@email.com"
|
|
128
|
+
* profileImage="/images/default-avatar.png"
|
|
129
|
+
* menuItems={menuItems}
|
|
130
|
+
* avatarMenuItems={avatarMenuItems}
|
|
131
|
+
* selectedIndex={0}
|
|
132
|
+
* onChangeIndex={(index) => console.log(index)}
|
|
133
|
+
* loading={true}
|
|
134
|
+
* loadingBackgroundColor="rgba(0, 0, 0, 0.6)"
|
|
135
|
+
* loadingSpinnerSize={64}
|
|
136
|
+
* loadingMessage="Carregando dados..."
|
|
137
|
+
* loadingColor="#ffffff"
|
|
138
|
+
* />
|
|
139
|
+
* );
|
|
140
|
+
* };
|
|
141
|
+
* ```
|
|
142
|
+
*/
|
|
143
|
+
const DesktopDrawer = ({ endPointLogout, backgroundHeader, backgroundMenuAvatar, colorItemMenu, colorItemMenuSelected, idUsuarioLogado, nomeUsuarioLogado, emailUsuario, profileImage, menuItems, avatarMenuItems, selectedIndex, onChangeIndex, onUnauthenticated, toolbarContent, loading, loadingBackgroundColor, loadingSpinnerSize, loadingMessage, loadingColor, }) => {
|
|
144
|
+
var _a, _b;
|
|
145
|
+
const theme = useTheme();
|
|
146
|
+
const [open, setOpen] = React.useState(false);
|
|
147
|
+
//garante que só chamamos onUnauthenticated uma única vez
|
|
148
|
+
const hasFiredUnauth = React.useRef(false);
|
|
149
|
+
React.useEffect(() => {
|
|
150
|
+
// só dispara quando já terminou o loading
|
|
151
|
+
if (!hasFiredUnauth.current &&
|
|
152
|
+
loading === false &&
|
|
153
|
+
idUsuarioLogado === null) {
|
|
154
|
+
hasFiredUnauth.current = true;
|
|
155
|
+
onUnauthenticated === null || onUnauthenticated === void 0 ? void 0 : onUnauthenticated();
|
|
156
|
+
}
|
|
157
|
+
}, [loading, idUsuarioLogado]);
|
|
158
|
+
if (loading === false && idUsuarioLogado === null) {
|
|
159
|
+
// enquanto o pai decide o que fazer (redirect, etc.), você não renderiza nada
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
const handleDrawerOpen = () => setOpen(true);
|
|
163
|
+
const handleDrawerClose = () => setOpen(false);
|
|
164
|
+
const [, setErrorMsg] = React.useState(null);
|
|
165
|
+
const handleClickLogout = async () => {
|
|
166
|
+
setErrorMsg(null);
|
|
167
|
+
try {
|
|
168
|
+
window.location.href = endPointLogout;
|
|
169
|
+
}
|
|
170
|
+
catch (e) {
|
|
171
|
+
setErrorMsg('Ocorreu um erro no logout.');
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Box, { sx: { display: 'flex' }, children: [_jsx(AppBar, { position: "fixed", open: open, background: backgroundHeader, children: _jsxs(Toolbar, { children: [_jsx(IconButton, { "aria-label": "open drawer", onClick: handleDrawerOpen, edge: "start", sx: [
|
|
175
|
+
{ marginRight: 5, color: colorItemMenu },
|
|
176
|
+
open && { display: 'none' },
|
|
177
|
+
], children: _jsx(MenuIcon, {}) }), _jsxs(ToolbarContent, { children: [toolbarContent && toolbarContent, _jsx(IconDrawerTrigger, { background: backgroundMenuAvatar, icon: _jsx(Avatar, { src: profileImage, alt: `foto do perfil de ${nomeUsuarioLogado}`, sx: { width: 48, height: 48, cursor: 'pointer' } }), children: _jsx(UserAvatarMenu, { userName: nomeUsuarioLogado, userEmail: emailUsuario, menuItems: avatarMenuItems, endPointLogout: endPointLogout }) })] })] }) }), _jsxs(Drawer, { variant: "permanent", open: open, children: [_jsx(DrawerHeader, { children: _jsx(IconButton, { onClick: handleDrawerClose, children: theme.direction === 'rtl' ? _jsx(ChevronRightIcon, {}) : _jsx(ChevronLeftIcon, {}) }) }), _jsx(Divider, {}), _jsxs(List, { children: [menuItems.map((item, index) => (_jsx(ListItem, { disablePadding: true, sx: { display: 'block' }, children: _jsxs(ListItemButton, { selected: selectedIndex === index, onClick: () => onChangeIndex(index), sx: {
|
|
178
|
+
minHeight: 48,
|
|
179
|
+
px: 2.5,
|
|
180
|
+
justifyContent: open ? 'initial' : 'center',
|
|
181
|
+
}, children: [_jsx(ListItemIcon, { sx: {
|
|
182
|
+
minWidth: 0,
|
|
183
|
+
justifyContent: 'center',
|
|
184
|
+
mr: open ? 3 : 'auto',
|
|
185
|
+
}, children: item.icon }), _jsx(ListItemText, { primary: item.text, sx: { opacity: open ? 1 : 0 } })] }) }, item.text))), _jsx(Box, { height: "24px" }), _jsx(ListItem, { disablePadding: true, sx: { display: 'block' }, children: _jsxs(ListItemButton, { onClick: handleClickLogout, sx: {
|
|
186
|
+
minHeight: 48,
|
|
187
|
+
px: 2.5,
|
|
188
|
+
justifyContent: open ? 'initial' : 'center',
|
|
189
|
+
}, children: [_jsx(ListItemIcon, { sx: {
|
|
190
|
+
minWidth: 0,
|
|
191
|
+
justifyContent: 'center',
|
|
192
|
+
mr: open ? 3 : 'auto',
|
|
193
|
+
color: colorItemMenu,
|
|
194
|
+
}, children: _jsx(LogoutIcon, {}) }), _jsx(ListItemText, { primary: "Sair", sx: { opacity: open ? 1 : 0 } })] }) }, "logout")] })] }), _jsxs(Box, { component: "main", sx: { flexGrow: 1, p: 3 }, children: [_jsx(DrawerHeader, {}), (_b = (_a = menuItems[selectedIndex]) === null || _a === void 0 ? void 0 : _a.component) !== null && _b !== void 0 ? _b : (_jsx(Typography, { children: "Selecione um item do menu." }))] })] }), loading && (_jsxs(LoadingOverlay, { overlayBackground: loadingBackgroundColor, overlayColor: loadingColor, children: [_jsx(CircularProgress, { size: loadingSpinnerSize, sx: { color: loadingColor, mb: loadingMessage ? 2 : 0 } }), loadingMessage && (_jsx(Typography, { sx: { mt: 2, color: loadingColor }, children: loadingMessage }))] }))] }));
|
|
195
|
+
};
|
|
196
|
+
DesktopDrawer.displayName = 'DesktopDrawer';
|
|
197
|
+
export default DesktopDrawer;
|
|
198
|
+
//# sourceMappingURL=DesktopDrawer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DesktopDrawer.js","sourceRoot":"","sources":["../../../src/components/drawer/DesktopDrawer.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAoB,MAAM,sBAAsB,CAAC;AAC1E,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,SAAS,MAAM,sBAAsB,CAAC;AAC7C,OAAO,SAAS,MAAM,sBAAsB,CAAC;AAC7C,OAAO,OAAO,MAAM,uBAAuB,CAAC;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,KAAC,gBAAgB,IAAC,IAAI,EAAE,kBAAkB,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAI,EACtG,cAAc,IAAI,CACjB,KAAC,UAAU,IAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,YAC3C,cAAc,GACJ,CACd,IACc,CAClB,IACA,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC;AAE5C,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DrawerProps } from '@/types/Drawer';
|
|
3
|
+
/**
|
|
4
|
+
* DrawerResponsive é um layout de navegação responsivo que:
|
|
5
|
+
* - Em telas pequenas (xs/sm) usa o `MobileMiniDrawerLayout` (header + bottom navigation);
|
|
6
|
+
* - Em telas médias ou maiores (md+) usa o `DesktopMiniDrawerLayout` (AppBar + Drawer).
|
|
7
|
+
*
|
|
8
|
+
* @param {string} backgroundHeader Cor de fundo do AppBar.
|
|
9
|
+
* @param {string} backgroundMenuAvatar Cor de fundo do menu Avatar.
|
|
10
|
+
* @param {string} colorItemMenu Cor do ícone do menu e dos itens de menu.
|
|
11
|
+
* @param {string} colorItemMenuSelected Cor do item de menu selecionado.
|
|
12
|
+
* @param {number | string | null} idUsuarioLogado Id do usuário logado.
|
|
13
|
+
* @param {string} nomeUsuarioLogado Nome do usuário logado.
|
|
14
|
+
* @param {string} emailUsuario Email do usuário logado.
|
|
15
|
+
* @param {Array<any>} menuItems Itens exibidos no Drawer.
|
|
16
|
+
* @param {Array<any>} avatarMenuItems Itens exibidos no menu do avatar.
|
|
17
|
+
* @param {string} profileImage URL final da imagem de avatar já tratada.
|
|
18
|
+
* @param {number} selectedIndex Índice do item selecionado.
|
|
19
|
+
* @param {(index: number) => void} onChangeIndex Callback chamado ao alterar o item selecionado.
|
|
20
|
+
* @param {() => void} [onUnauthenticated] Callback chamado se não tiver usuário logado.
|
|
21
|
+
* @param {React.ReactNode} [toolbarContent] Conteúdos genéricos exibidos na barra de ferramentas (texto, ícones, imagens etc.).
|
|
22
|
+
* @param {boolean} [loading=false] Indica se o overlay de loading deve ser exibido sobre toda a tela.
|
|
23
|
+
* @param {string} [loadingBackgroundColor='rgba(0, 0, 0, 0.4)'] Cor de fundo do overlay de loading.
|
|
24
|
+
* @param {number} [loadingSpinnerSize=48] Tamanho do spinner de loading.
|
|
25
|
+
* @param {string} [loadingMessage] Texto opcional exibido abaixo do spinner de loading.
|
|
26
|
+
* @param {string} [loadingColor='#ffffff'] Cor do spinner e do texto da mensagem de loading.
|
|
27
|
+
* @param {() => void} [onChangeIndex] Callback chamado quando o item de menu selecionado é alterado.
|
|
28
|
+
*
|
|
29
|
+
*
|
|
30
|
+
* Exemplo de uso:
|
|
31
|
+
* ```tsx
|
|
32
|
+
* <MiniDrawer
|
|
33
|
+
* backgroundHeader="#ffffff"
|
|
34
|
+
* colorMenuHamburguer="#000000"
|
|
35
|
+
* nomeUsuarioLogado="John Doe"
|
|
36
|
+
* menuItems={[
|
|
37
|
+
* { text: 'Home', icon: <HomeIcon />, component: <HomePage /> },
|
|
38
|
+
* { text: 'Configurações', icon: <SettingsIcon />, component: <SettingsPage /> },
|
|
39
|
+
* ]}
|
|
40
|
+
* />
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* ``` Como implementar o evento onChangeIndex
|
|
44
|
+
* const Page = () => {
|
|
45
|
+
* const [abaAtual, setAbaAtual] = React.useState(0);
|
|
46
|
+
* const handleMenuIndexChange = (index: number) => {
|
|
47
|
+
* setAbaAtual(index);
|
|
48
|
+
* // Aqui você decide o que carregar:
|
|
49
|
+
* switch (index) {
|
|
50
|
+
* case 0:
|
|
51
|
+
* // carregar dados da aba "Dashboard"
|
|
52
|
+
* // fetchDashboard();
|
|
53
|
+
* break;
|
|
54
|
+
* case 1:
|
|
55
|
+
* // carregar dados da aba "Consultas"
|
|
56
|
+
* // fetchConsultas();
|
|
57
|
+
* break;
|
|
58
|
+
* case 2:
|
|
59
|
+
* // carregar dados da aba "Financeiro"
|
|
60
|
+
* // fetchFinanceiro();
|
|
61
|
+
* break;
|
|
62
|
+
* // etc...
|
|
63
|
+
* }
|
|
64
|
+
* };
|
|
65
|
+
* return (
|
|
66
|
+
* <DrawerResponsive
|
|
67
|
+
* // ...outras props
|
|
68
|
+
* onMenuIndexChange={handleMenuIndexChange}
|
|
69
|
+
* />
|
|
70
|
+
* );
|
|
71
|
+
* };
|
|
72
|
+
*/
|
|
73
|
+
declare const DrawerResponsive: React.FC<DrawerProps>;
|
|
74
|
+
export default DrawerResponsive;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import MobileDrawer from './MobileDrawer';
|
|
4
|
+
import DesktopDrawer from './DesktopDrawer';
|
|
5
|
+
import { useMediaQuery, useTheme } from '@mui/material';
|
|
6
|
+
/**
|
|
7
|
+
* DrawerResponsive é um layout de navegação responsivo que:
|
|
8
|
+
* - Em telas pequenas (xs/sm) usa o `MobileMiniDrawerLayout` (header + bottom navigation);
|
|
9
|
+
* - Em telas médias ou maiores (md+) usa o `DesktopMiniDrawerLayout` (AppBar + Drawer).
|
|
10
|
+
*
|
|
11
|
+
* @param {string} backgroundHeader Cor de fundo do AppBar.
|
|
12
|
+
* @param {string} backgroundMenuAvatar Cor de fundo do menu Avatar.
|
|
13
|
+
* @param {string} colorItemMenu Cor do ícone do menu e dos itens de menu.
|
|
14
|
+
* @param {string} colorItemMenuSelected Cor do item de menu selecionado.
|
|
15
|
+
* @param {number | string | null} idUsuarioLogado Id do usuário logado.
|
|
16
|
+
* @param {string} nomeUsuarioLogado Nome do usuário logado.
|
|
17
|
+
* @param {string} emailUsuario Email do usuário logado.
|
|
18
|
+
* @param {Array<any>} menuItems Itens exibidos no Drawer.
|
|
19
|
+
* @param {Array<any>} avatarMenuItems Itens exibidos no menu do avatar.
|
|
20
|
+
* @param {string} profileImage URL final da imagem de avatar já tratada.
|
|
21
|
+
* @param {number} selectedIndex Índice do item selecionado.
|
|
22
|
+
* @param {(index: number) => void} onChangeIndex Callback chamado ao alterar o item selecionado.
|
|
23
|
+
* @param {() => void} [onUnauthenticated] Callback chamado se não tiver usuário logado.
|
|
24
|
+
* @param {React.ReactNode} [toolbarContent] Conteúdos genéricos exibidos na barra de ferramentas (texto, ícones, imagens etc.).
|
|
25
|
+
* @param {boolean} [loading=false] Indica se o overlay de loading deve ser exibido sobre toda a tela.
|
|
26
|
+
* @param {string} [loadingBackgroundColor='rgba(0, 0, 0, 0.4)'] Cor de fundo do overlay de loading.
|
|
27
|
+
* @param {number} [loadingSpinnerSize=48] Tamanho do spinner de loading.
|
|
28
|
+
* @param {string} [loadingMessage] Texto opcional exibido abaixo do spinner de loading.
|
|
29
|
+
* @param {string} [loadingColor='#ffffff'] Cor do spinner e do texto da mensagem de loading.
|
|
30
|
+
* @param {() => void} [onChangeIndex] Callback chamado quando o item de menu selecionado é alterado.
|
|
31
|
+
*
|
|
32
|
+
*
|
|
33
|
+
* Exemplo de uso:
|
|
34
|
+
* ```tsx
|
|
35
|
+
* <MiniDrawer
|
|
36
|
+
* backgroundHeader="#ffffff"
|
|
37
|
+
* colorMenuHamburguer="#000000"
|
|
38
|
+
* nomeUsuarioLogado="John Doe"
|
|
39
|
+
* menuItems={[
|
|
40
|
+
* { text: 'Home', icon: <HomeIcon />, component: <HomePage /> },
|
|
41
|
+
* { text: 'Configurações', icon: <SettingsIcon />, component: <SettingsPage /> },
|
|
42
|
+
* ]}
|
|
43
|
+
* />
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* ``` Como implementar o evento onChangeIndex
|
|
47
|
+
* const Page = () => {
|
|
48
|
+
* const [abaAtual, setAbaAtual] = React.useState(0);
|
|
49
|
+
* const handleMenuIndexChange = (index: number) => {
|
|
50
|
+
* setAbaAtual(index);
|
|
51
|
+
* // Aqui você decide o que carregar:
|
|
52
|
+
* switch (index) {
|
|
53
|
+
* case 0:
|
|
54
|
+
* // carregar dados da aba "Dashboard"
|
|
55
|
+
* // fetchDashboard();
|
|
56
|
+
* break;
|
|
57
|
+
* case 1:
|
|
58
|
+
* // carregar dados da aba "Consultas"
|
|
59
|
+
* // fetchConsultas();
|
|
60
|
+
* break;
|
|
61
|
+
* case 2:
|
|
62
|
+
* // carregar dados da aba "Financeiro"
|
|
63
|
+
* // fetchFinanceiro();
|
|
64
|
+
* break;
|
|
65
|
+
* // etc...
|
|
66
|
+
* }
|
|
67
|
+
* };
|
|
68
|
+
* return (
|
|
69
|
+
* <DrawerResponsive
|
|
70
|
+
* // ...outras props
|
|
71
|
+
* onMenuIndexChange={handleMenuIndexChange}
|
|
72
|
+
* />
|
|
73
|
+
* );
|
|
74
|
+
* };
|
|
75
|
+
*/
|
|
76
|
+
const DrawerResponsive = ({ endPointLogout, backgroundHeader, backgroundMenuAvatar, colorItemMenu, colorItemMenuSelected, idUsuarioLogado, nomeUsuarioLogado, profileImage, emailUsuario, menuItems, avatarMenuItems, onUnauthenticated, toolbarContent, loading = false, loadingBackgroundColor = 'rgba(0, 0, 0, 0.4)', loadingSpinnerSize = 48, loadingMessage, loadingColor = '#ffffff', onChangeIndex, }) => {
|
|
77
|
+
const defaultAvatar = '/nofoto.jpg';
|
|
78
|
+
const avatarSrc = profileImage && profileImage.trim() !== '' ? profileImage : defaultAvatar;
|
|
79
|
+
const [selectedIndex, setSelectedIndex] = React.useState(0);
|
|
80
|
+
const handleChangeIndex = (index) => {
|
|
81
|
+
setSelectedIndex(index);
|
|
82
|
+
onChangeIndex === null || onChangeIndex === void 0 ? void 0 : onChangeIndex(index);
|
|
83
|
+
};
|
|
84
|
+
const theme = useTheme();
|
|
85
|
+
const xs = useMediaQuery(theme.breakpoints.down("sm"));
|
|
86
|
+
const sm = useMediaQuery(theme.breakpoints.between("sm", "md"));
|
|
87
|
+
if (xs || sm) {
|
|
88
|
+
return (_jsx(MobileDrawer, { endPointLogout: endPointLogout, backgroundHeader: backgroundHeader, backgroundMenuAvatar: backgroundMenuAvatar, colorItemMenu: colorItemMenu, colorItemMenuSelected: colorItemMenuSelected, nomeUsuarioLogado: nomeUsuarioLogado, profileImage: avatarSrc, idUsuarioLogado: idUsuarioLogado, emailUsuario: emailUsuario, menuItems: menuItems, avatarMenuItems: avatarMenuItems, selectedIndex: selectedIndex, onChangeIndex: handleChangeIndex, onUnauthenticated: onUnauthenticated, toolbarContent: toolbarContent, loading: loading, loadingBackgroundColor: loadingBackgroundColor, loadingSpinnerSize: loadingSpinnerSize, loadingMessage: loadingMessage, loadingColor: loadingColor }));
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
return (_jsx(DesktopDrawer, { endPointLogout: endPointLogout, backgroundHeader: backgroundHeader, backgroundMenuAvatar: backgroundMenuAvatar, colorItemMenu: colorItemMenu, colorItemMenuSelected: colorItemMenuSelected, idUsuarioLogado: idUsuarioLogado, nomeUsuarioLogado: nomeUsuarioLogado, profileImage: avatarSrc, emailUsuario: emailUsuario, menuItems: menuItems, avatarMenuItems: avatarMenuItems, selectedIndex: selectedIndex, onChangeIndex: handleChangeIndex, onUnauthenticated: onUnauthenticated, toolbarContent: toolbarContent, loading: loading, loadingBackgroundColor: loadingBackgroundColor, loadingSpinnerSize: loadingSpinnerSize, loadingMessage: loadingMessage, loadingColor: loadingColor }));
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
DrawerResponsive.displayName = 'DrawerResponsive';
|
|
95
|
+
export default DrawerResponsive;
|
|
96
|
+
//# sourceMappingURL=DrawerResponsive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DrawerResponsive.js","sourceRoot":"","sources":["../../../src/components/drawer/DrawerResponsive.tsx"],"names":[],"m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Ac,EAC9B,YAAY,EAAE,YAAY,GAC1B,CACL,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAEF,gBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC;AAElD,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface IconDrawerTriggerProps {
|
|
3
|
+
icon: React.ReactNode;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
/** @default 320 */
|
|
6
|
+
width?: string | number;
|
|
7
|
+
/** @default '100%' */
|
|
8
|
+
height?: string | number;
|
|
9
|
+
/** @default 16 */
|
|
10
|
+
padding?: string | number;
|
|
11
|
+
/** @default 0 */
|
|
12
|
+
margin?: string | number;
|
|
13
|
+
/** @default '#ffffff' */
|
|
14
|
+
background?: string;
|
|
15
|
+
/** @default 'inherit' */
|
|
16
|
+
color?: string;
|
|
17
|
+
/** @default 0 */
|
|
18
|
+
borderRadius?: string | number;
|
|
19
|
+
/** @default 'none' */
|
|
20
|
+
boxShadow?: string;
|
|
21
|
+
/** @default 'Open panel' */
|
|
22
|
+
ariaLabel?: string;
|
|
23
|
+
onOpenChange?: (open: boolean) => void;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Componente que renderiza um botão de ícone (IconButton) do Material UI
|
|
27
|
+
* e, ao clicar, abre um Menu ancorado ao botão, com conteúdo customizável via children.
|
|
28
|
+
* Ao clicar novamente no ícone, o Menu é fechado (comportamento de toggle).
|
|
29
|
+
*
|
|
30
|
+
* A prop `icon` aceita tanto:
|
|
31
|
+
* - um ícone do Material UI (`<AccountCircleIcon />`, `<MenuIcon />`, etc.)
|
|
32
|
+
* - quanto um componente de avatar, como `<Avatar />` do MUI.
|
|
33
|
+
*
|
|
34
|
+
* @param {React.ReactNode} icon Ícone ou avatar a ser exibido dentro do botão que abre/fecha o menu. Obrigatório.
|
|
35
|
+
* @param {React.ReactNode} children Conteúdo que será exibido dentro do menu ao clicar no ícone. Obrigatório.
|
|
36
|
+
* @param {string | number} [width=320] Largura do container interno do menu.
|
|
37
|
+
* @param {string | number} [height='100%'] Altura do container interno do menu.
|
|
38
|
+
* @param {string | number} [padding=16] Espaçamento interno do container interno do menu.
|
|
39
|
+
* @param {string | number} [margin=0] Margem externa do container interno do menu.
|
|
40
|
+
* @param {string} [background='#ffffff'] Cor de fundo do container interno do menu.
|
|
41
|
+
* @param {string} [color='inherit'] Cor do texto dentro do container interno do menu.
|
|
42
|
+
* @param {string | number} [borderRadius=0] Raio da borda do container interno do menu.
|
|
43
|
+
* @param {string} [boxShadow='none'] Sombra do container interno do menu.
|
|
44
|
+
* @param {(open: boolean) => void} [onOpenChange] Callback disparado sempre que o estado de aberto/fechado muda.
|
|
45
|
+
* @param {string} [ariaLabel='Open panel'] Rótulo de acessibilidade para o botão do ícone.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```tsx
|
|
49
|
+
* import { IconDrawerTrigger } from '@/components/IconDrawerTrigger';
|
|
50
|
+
* import AccountCircleIcon from '@mui/icons-material/AccountCircle';
|
|
51
|
+
* import Avatar from '@mui/material/Avatar';
|
|
52
|
+
*
|
|
53
|
+
* const Example = () => {
|
|
54
|
+
* return (
|
|
55
|
+
* <>
|
|
56
|
+
* Exemplo com ícone do Material UI
|
|
57
|
+
* <IconDrawerTrigger
|
|
58
|
+
* icon={<AccountCircleIcon />}
|
|
59
|
+
* position="right"
|
|
60
|
+
* ariaLabel="Abrir menu do usuário"
|
|
61
|
+
* width={360}
|
|
62
|
+
* padding="24px"
|
|
63
|
+
* background="#f5f5f5"
|
|
64
|
+
* borderRadius="12px"
|
|
65
|
+
* boxShadow="0 4px 12px rgba(0, 0, 0, 0.1)"
|
|
66
|
+
* onOpenChange={(open) => console.log('Menu aberto?', open)}
|
|
67
|
+
* >
|
|
68
|
+
* <div>Conteúdo com ícone de usuário.</div>
|
|
69
|
+
* </IconDrawerTrigger>
|
|
70
|
+
*
|
|
71
|
+
* Exemplo com Avatar do Material UI
|
|
72
|
+
* <IconDrawerTrigger
|
|
73
|
+
* icon={<Avatar alt="Usuário" src="/static/images/avatar/1.jpg" />}
|
|
74
|
+
* position="left"
|
|
75
|
+
* ariaLabel="Abrir painel do avatar"
|
|
76
|
+
* >
|
|
77
|
+
* <div>Conteúdo relacionado ao avatar (perfil, configurações, etc.).</div>
|
|
78
|
+
* </IconDrawerTrigger>
|
|
79
|
+
* </>
|
|
80
|
+
* );
|
|
81
|
+
* };
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
declare const IconDrawerTrigger: React.FC<IconDrawerTriggerProps>;
|
|
85
|
+
export default IconDrawerTrigger;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// IconDrawerTrigger.tsx
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { styled } from '@mui/material/styles';
|
|
5
|
+
import IconButton from '@mui/material/IconButton';
|
|
6
|
+
import Menu from '@mui/material/Menu';
|
|
7
|
+
import Box from '@mui/material/Box';
|
|
8
|
+
const StyledMenuContent = styled(Box, {
|
|
9
|
+
shouldForwardProp: (prop) => ![
|
|
10
|
+
'width',
|
|
11
|
+
'height',
|
|
12
|
+
'padding',
|
|
13
|
+
'margin',
|
|
14
|
+
'background',
|
|
15
|
+
'color',
|
|
16
|
+
'borderRadius',
|
|
17
|
+
'boxShadow',
|
|
18
|
+
].includes(prop),
|
|
19
|
+
})(({ width, height, padding, margin, background, color, borderRadius, boxShadow }) => ({
|
|
20
|
+
width: width !== null && width !== void 0 ? width : 320,
|
|
21
|
+
height: height !== null && height !== void 0 ? height : '100%',
|
|
22
|
+
padding: padding !== null && padding !== void 0 ? padding : 16,
|
|
23
|
+
margin: margin !== null && margin !== void 0 ? margin : 0,
|
|
24
|
+
background: background !== null && background !== void 0 ? background : '#ffffff',
|
|
25
|
+
color: color !== null && color !== void 0 ? color : 'inherit',
|
|
26
|
+
borderRadius: borderRadius !== null && borderRadius !== void 0 ? borderRadius : 0,
|
|
27
|
+
boxShadow: boxShadow !== null && boxShadow !== void 0 ? boxShadow : 'none',
|
|
28
|
+
boxSizing: 'border-box',
|
|
29
|
+
display: 'flex',
|
|
30
|
+
flexDirection: 'column',
|
|
31
|
+
}));
|
|
32
|
+
/**
|
|
33
|
+
* Componente que renderiza um botão de ícone (IconButton) do Material UI
|
|
34
|
+
* e, ao clicar, abre um Menu ancorado ao botão, com conteúdo customizável via children.
|
|
35
|
+
* Ao clicar novamente no ícone, o Menu é fechado (comportamento de toggle).
|
|
36
|
+
*
|
|
37
|
+
* A prop `icon` aceita tanto:
|
|
38
|
+
* - um ícone do Material UI (`<AccountCircleIcon />`, `<MenuIcon />`, etc.)
|
|
39
|
+
* - quanto um componente de avatar, como `<Avatar />` do MUI.
|
|
40
|
+
*
|
|
41
|
+
* @param {React.ReactNode} icon Ícone ou avatar a ser exibido dentro do botão que abre/fecha o menu. Obrigatório.
|
|
42
|
+
* @param {React.ReactNode} children Conteúdo que será exibido dentro do menu ao clicar no ícone. Obrigatório.
|
|
43
|
+
* @param {string | number} [width=320] Largura do container interno do menu.
|
|
44
|
+
* @param {string | number} [height='100%'] Altura do container interno do menu.
|
|
45
|
+
* @param {string | number} [padding=16] Espaçamento interno do container interno do menu.
|
|
46
|
+
* @param {string | number} [margin=0] Margem externa do container interno do menu.
|
|
47
|
+
* @param {string} [background='#ffffff'] Cor de fundo do container interno do menu.
|
|
48
|
+
* @param {string} [color='inherit'] Cor do texto dentro do container interno do menu.
|
|
49
|
+
* @param {string | number} [borderRadius=0] Raio da borda do container interno do menu.
|
|
50
|
+
* @param {string} [boxShadow='none'] Sombra do container interno do menu.
|
|
51
|
+
* @param {(open: boolean) => void} [onOpenChange] Callback disparado sempre que o estado de aberto/fechado muda.
|
|
52
|
+
* @param {string} [ariaLabel='Open panel'] Rótulo de acessibilidade para o botão do ícone.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```tsx
|
|
56
|
+
* import { IconDrawerTrigger } from '@/components/IconDrawerTrigger';
|
|
57
|
+
* import AccountCircleIcon from '@mui/icons-material/AccountCircle';
|
|
58
|
+
* import Avatar from '@mui/material/Avatar';
|
|
59
|
+
*
|
|
60
|
+
* const Example = () => {
|
|
61
|
+
* return (
|
|
62
|
+
* <>
|
|
63
|
+
* Exemplo com ícone do Material UI
|
|
64
|
+
* <IconDrawerTrigger
|
|
65
|
+
* icon={<AccountCircleIcon />}
|
|
66
|
+
* position="right"
|
|
67
|
+
* ariaLabel="Abrir menu do usuário"
|
|
68
|
+
* width={360}
|
|
69
|
+
* padding="24px"
|
|
70
|
+
* background="#f5f5f5"
|
|
71
|
+
* borderRadius="12px"
|
|
72
|
+
* boxShadow="0 4px 12px rgba(0, 0, 0, 0.1)"
|
|
73
|
+
* onOpenChange={(open) => console.log('Menu aberto?', open)}
|
|
74
|
+
* >
|
|
75
|
+
* <div>Conteúdo com ícone de usuário.</div>
|
|
76
|
+
* </IconDrawerTrigger>
|
|
77
|
+
*
|
|
78
|
+
* Exemplo com Avatar do Material UI
|
|
79
|
+
* <IconDrawerTrigger
|
|
80
|
+
* icon={<Avatar alt="Usuário" src="/static/images/avatar/1.jpg" />}
|
|
81
|
+
* position="left"
|
|
82
|
+
* ariaLabel="Abrir painel do avatar"
|
|
83
|
+
* >
|
|
84
|
+
* <div>Conteúdo relacionado ao avatar (perfil, configurações, etc.).</div>
|
|
85
|
+
* </IconDrawerTrigger>
|
|
86
|
+
* </>
|
|
87
|
+
* );
|
|
88
|
+
* };
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
const IconDrawerTrigger = ({ icon, children, width, height, padding, margin, background, color, borderRadius, boxShadow, onOpenChange, ariaLabel = 'Open panel', }) => {
|
|
92
|
+
const [anchorEl, setAnchorEl] = React.useState(null);
|
|
93
|
+
const open = Boolean(anchorEl);
|
|
94
|
+
const handleChangeOpen = (nextOpen, newAnchorEl = null) => {
|
|
95
|
+
if (nextOpen) {
|
|
96
|
+
setAnchorEl(newAnchorEl);
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
setAnchorEl(null);
|
|
100
|
+
}
|
|
101
|
+
if (onOpenChange) {
|
|
102
|
+
onOpenChange(nextOpen);
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
const handleOpen = (event) => {
|
|
106
|
+
handleChangeOpen(true, event.currentTarget);
|
|
107
|
+
};
|
|
108
|
+
const handleClose = () => handleChangeOpen(false);
|
|
109
|
+
const handleToggle = (event) => {
|
|
110
|
+
if (open) {
|
|
111
|
+
handleClose();
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
handleOpen(event);
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
return (_jsxs(_Fragment, { children: [_jsx(IconButton, { "aria-label": ariaLabel, onClick: handleToggle, size: "large", children: icon }), _jsx(Menu, { anchorEl: anchorEl, open: open, onClose: handleClose, slotProps: {
|
|
118
|
+
paper: {
|
|
119
|
+
elevation: 4,
|
|
120
|
+
sx: {
|
|
121
|
+
mt: 1.5,
|
|
122
|
+
minWidth: 220,
|
|
123
|
+
borderRadius: '12px',
|
|
124
|
+
background: background,
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
}, anchorOrigin: {
|
|
128
|
+
vertical: 'bottom',
|
|
129
|
+
horizontal: 'right',
|
|
130
|
+
}, transformOrigin: {
|
|
131
|
+
vertical: 'top',
|
|
132
|
+
horizontal: 'right',
|
|
133
|
+
}, keepMounted: true, children: _jsx(StyledMenuContent, { width: width, height: height, padding: padding, margin: margin, background: background, color: color, borderRadius: borderRadius, boxShadow: boxShadow, children: children }) })] }));
|
|
134
|
+
};
|
|
135
|
+
IconDrawerTrigger.displayName = 'IconDrawerTrigger';
|
|
136
|
+
export default IconDrawerTrigger;
|
|
137
|
+
//# sourceMappingURL=IconDrawerTrigger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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,EAAE,YAAY,EACrB,IAAI,EAAC,OAAO,YAEX,IAAI,GACM,EAEb,KAAC,IAAI,IACH,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE;oBACL,KAAK,EAAE;wBACL,SAAS,EAAE,CAAC;wBACZ,EAAE,EAAE;4BACF,EAAE,EAAE,GAAG;4BACP,QAAQ,EAAE,GAAG;4BACb,YAAY,EAAE,MAAM;4BACnB,UAAU,EAAE,UAAU;yBACxB;qBACF;iBACF,EACL,YAAY,EAAE;oBACR,QAAQ,EAAE,QAAQ;oBAClB,UAAU,EAAE,OAAO;iBACpB,EACD,eAAe,EAAE;oBACf,QAAQ,EAAE,KAAK;oBACf,UAAU,EAAE,OAAO;iBACpB,EACL,WAAW,kBAEX,KAAC,iBAAiB,IAChB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,YAEnB,QAAQ,GACS,GACf,IACN,CACJ,CAAC;AACJ,CAAC,CAAC;AAGF,iBAAiB,CAAC,WAAW,GAAG,mBAAmB,CAAC;AAEpD,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ícone de logout estilizado para o Drawer.
|
|
3
|
+
*/
|
|
4
|
+
export declare const LogoutIcon: import("@emotion/styled").StyledComponent<import("@mui/material").SvgIconOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").SVGProps<SVGSVGElement>, "className" | "style" | "classes" | "children" | "sx" | "color" | "fontSize" | "shapeRendering" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { styled } from "@mui/material";
|
|
2
|
+
import ExitToAppIcon from '@mui/icons-material/ExitToApp';
|
|
3
|
+
/**
|
|
4
|
+
* Ícone de logout estilizado para o Drawer.
|
|
5
|
+
*/
|
|
6
|
+
export const LogoutIcon = styled(ExitToAppIcon)(({ theme }) => ({
|
|
7
|
+
color: theme.palette.text.primary,
|
|
8
|
+
fontSize: '24px',
|
|
9
|
+
}));
|
|
10
|
+
//# sourceMappingURL=LogoutIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LogoutIcon.js","sourceRoot":"","sources":["../../../src/components/drawer/LogoutIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAE1D;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;IAC9D,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO;IACjC,QAAQ,EAAE,MAAM;CACjB,CAAC,CAAC,CAAC"}
|