@ssplib/react-components 0.0.250 → 0.0.252
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/components/detalhes/Category.js +14 -0
- package/components/detalhes/Field.js +42 -0
- package/components/detalhes/FieldLabel.js +28 -0
- package/components/detalhes/File.js +62 -0
- package/components/form/checkbox/CheckBox.js +18 -0
- package/{src/components → components}/form/checkbox/CheckBoxAdditional.js +37 -11
- package/components/form/checkbox/CheckBoxWarning.js +43 -0
- package/components/form/checkbox/RequiredCheckBoxValidator.js +85 -0
- package/components/form/date/DatePicker.js +100 -0
- package/components/form/date/TimePicker.js +82 -0
- package/components/form/file/DropFileUpload.js +236 -0
- package/components/form/file/FileUpload.js +200 -0
- package/components/form/input/ActiveInput.js +33 -0
- package/components/form/input/AutoComplete.js +69 -0
- package/components/form/input/FetchAutoComplete.js +132 -0
- package/components/form/input/FixedAutoComplete.js +76 -0
- package/{src/components → components}/form/input/Input.js +52 -22
- package/components/form/input/MaskInput.js +78 -0
- package/components/form/input/MultInput.js +67 -0
- package/components/form/input/OtherCheckBox.js +56 -0
- package/components/form/stepper/Stepper.js +135 -0
- package/components/form/stepper/StepperBlock.js +97 -0
- package/components/form/switch/Switch.js +54 -0
- package/components/form/switch/ToggleVisibility.js +61 -0
- package/{src/components → components}/form/table/Table.js +230 -200
- package/components/icons/icons.js +24 -0
- package/components/modal/Modal.js +105 -0
- package/components/navbar/NavBar.js +156 -0
- package/components/navbar/TabNavBar.js +164 -0
- package/components/providers/FormProvider.js +49 -0
- package/components/providers/KeycloakAuthProvider.js +99 -0
- package/{src/components → components}/providers/OAuthProvider.js +49 -19
- package/components/providers/SspComponentsProvider.js +18 -0
- package/{src/components → components}/utils/Bt.js +13 -7
- package/components/utils/CustomMenu.js +39 -0
- package/context/auth.js +5 -0
- package/context/form.js +5 -0
- package/index.js +80 -0
- package/package.json +2 -2
- package/types/auth.js +2 -0
- package/{src/types → types}/form.js +7 -4
- package/src/components/detalhes/Category.js +0 -7
- package/src/components/detalhes/Field.js +0 -35
- package/src/components/detalhes/FieldLabel.js +0 -21
- package/src/components/detalhes/File.js +0 -35
- package/src/components/form/checkbox/CheckBox.js +0 -12
- package/src/components/form/checkbox/CheckBoxWarning.js +0 -14
- package/src/components/form/checkbox/RequiredCheckBoxValidator.js +0 -56
- package/src/components/form/date/DatePicker.js +0 -71
- package/src/components/form/date/TimePicker.js +0 -53
- package/src/components/form/file/DropFileUpload.js +0 -207
- package/src/components/form/file/FileUpload.js +0 -171
- package/src/components/form/input/ActiveInput.js +0 -27
- package/src/components/form/input/AutoComplete.js +0 -40
- package/src/components/form/input/FetchAutoComplete.js +0 -103
- package/src/components/form/input/FixedAutoComplete.js +0 -46
- package/src/components/form/input/MaskInput.js +0 -52
- package/src/components/form/input/MultInput.js +0 -38
- package/src/components/form/input/OtherCheckBox.js +0 -27
- package/src/components/form/stepper/Stepper.js +0 -105
- package/src/components/form/stepper/StepperBlock.js +0 -67
- package/src/components/form/switch/Switch.js +0 -27
- package/src/components/form/switch/ToggleVisibility.js +0 -33
- package/src/components/icons/icons.js +0 -16
- package/src/components/modal/Modal.js +0 -75
- package/src/components/navbar/NavBar.js +0 -127
- package/src/components/navbar/TabNavBar.js +0 -135
- package/src/components/providers/FormProvider.js +0 -23
- package/src/components/providers/KeycloakAuthProvider.js +0 -69
- package/src/components/providers/SspComponentsProvider.js +0 -11
- package/src/components/utils/CustomMenu.js +0 -33
- package/src/context/auth.js +0 -2
- package/src/context/form.js +0 -2
- package/src/index.js +0 -41
- package/src/types/auth.js +0 -1
- /package/{src/components → components}/detalhes/Category.d.ts +0 -0
- /package/{src/components → components}/detalhes/Field.d.ts +0 -0
- /package/{src/components → components}/detalhes/FieldLabel.d.ts +0 -0
- /package/{src/components → components}/detalhes/File.d.ts +0 -0
- /package/{src/components → components}/form/checkbox/CheckBox.d.ts +0 -0
- /package/{src/components → components}/form/checkbox/CheckBoxAdditional.d.ts +0 -0
- /package/{src/components → components}/form/checkbox/CheckBoxWarning.d.ts +0 -0
- /package/{src/components → components}/form/checkbox/RequiredCheckBoxValidator.d.ts +0 -0
- /package/{src/components → components}/form/date/DatePicker.d.ts +0 -0
- /package/{src/components → components}/form/date/TimePicker.d.ts +0 -0
- /package/{src/components → components}/form/file/DropFileUpload.d.ts +0 -0
- /package/{src/components → components}/form/file/FileUpload.d.ts +0 -0
- /package/{src/components → components}/form/input/ActiveInput.d.ts +0 -0
- /package/{src/components → components}/form/input/AutoComplete.d.ts +0 -0
- /package/{src/components → components}/form/input/FetchAutoComplete.d.ts +0 -0
- /package/{src/components → components}/form/input/FixedAutoComplete.d.ts +0 -0
- /package/{src/components → components}/form/input/Input.d.ts +0 -0
- /package/{src/components → components}/form/input/MaskInput.d.ts +0 -0
- /package/{src/components → components}/form/input/MultInput.d.ts +0 -0
- /package/{src/components → components}/form/input/OtherCheckBox.d.ts +0 -0
- /package/{src/components → components}/form/stepper/Stepper.d.ts +0 -0
- /package/{src/components → components}/form/stepper/StepperBlock.d.ts +0 -0
- /package/{src/components → components}/form/switch/Switch.d.ts +0 -0
- /package/{src/components → components}/form/switch/ToggleVisibility.d.ts +0 -0
- /package/{src/components → components}/form/table/Table.d.ts +0 -0
- /package/{src/components → components}/icons/icons.d.ts +0 -0
- /package/{src/components → components}/modal/Modal.d.ts +0 -0
- /package/{src/components → components}/navbar/NavBar.d.ts +0 -0
- /package/{src/components → components}/navbar/TabNavBar.d.ts +0 -0
- /package/{src/components → components}/providers/FormProvider.d.ts +0 -0
- /package/{src/components → components}/providers/KeycloakAuthProvider.d.ts +0 -0
- /package/{src/components → components}/providers/OAuthProvider.d.ts +0 -0
- /package/{src/components → components}/providers/SspComponentsProvider.d.ts +0 -0
- /package/{src/components → components}/utils/Bt.d.ts +0 -0
- /package/{src/components → components}/utils/CustomMenu.d.ts +0 -0
- /package/{src/context → context}/auth.d.ts +0 -0
- /package/{src/context → context}/form.d.ts +0 -0
- /package/{src/index.d.ts → index.d.ts} +0 -0
- /package/{src/types → types}/auth.d.ts +0 -0
- /package/{src/types → types}/form.d.ts +0 -0
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
|
|
13
|
-
import LogoutOutlinedIcon from '@mui/icons-material/LogoutOutlined';
|
|
14
|
-
import MenuIcon from '@mui/icons-material/Menu';
|
|
15
|
-
import PersonIcon from '@mui/icons-material/Person';
|
|
16
|
-
import { AppBar, Avatar, Box, Button, IconButton, Menu, MenuItem, Stack, Typography } from '@mui/material';
|
|
17
|
-
import LinearProgress from '@mui/material/LinearProgress';
|
|
18
|
-
import Image from 'next/image';
|
|
19
|
-
import Link from 'next/link';
|
|
20
|
-
import { useRouter } from 'next/router';
|
|
21
|
-
import React, { useCallback, useContext, useState } from 'react';
|
|
22
|
-
import { AuthContext } from '../../context/auth';
|
|
23
|
-
function verificarRota(route, path) {
|
|
24
|
-
if (path === '/')
|
|
25
|
-
return route === path;
|
|
26
|
-
return route.startsWith(path);
|
|
27
|
-
}
|
|
28
|
-
export default function TabNavBar(_a) {
|
|
29
|
-
var { links, title, img, pos = 'fixed', next = true, el, menuItems, color = 'blue', route = '/teste/89', paddingBottom = 0, logoutMsg = 'Sair', logoutFunc } = _a, props = __rest(_a, ["links", "title", "img", "pos", "next", "el", "menuItems", "color", "route", "paddingBottom", "logoutMsg", "logoutFunc"]);
|
|
30
|
-
let router = undefined;
|
|
31
|
-
if (next)
|
|
32
|
-
router = useRouter();
|
|
33
|
-
const { user, login, logout, type } = useContext(AuthContext);
|
|
34
|
-
const [anchor, setAnchor] = useState(null);
|
|
35
|
-
const [avatarAnchor, setAvatarAnchor] = useState(null);
|
|
36
|
-
const menuOpen = Boolean(anchor);
|
|
37
|
-
const avatarMenu = Boolean(avatarAnchor);
|
|
38
|
-
const [loading, setLoading] = useState(false);
|
|
39
|
-
const onMenuClick = useCallback((e) => {
|
|
40
|
-
setAnchor(e.currentTarget);
|
|
41
|
-
}, []);
|
|
42
|
-
const closeMenu = useCallback(() => {
|
|
43
|
-
setAnchor(null);
|
|
44
|
-
}, []);
|
|
45
|
-
const onMenuItemClick = useCallback((e, link) => {
|
|
46
|
-
setLoading(true);
|
|
47
|
-
setAnchor(null);
|
|
48
|
-
if (router)
|
|
49
|
-
router
|
|
50
|
-
.push({
|
|
51
|
-
pathname: link,
|
|
52
|
-
})
|
|
53
|
-
.finally(() => setLoading(false));
|
|
54
|
-
else {
|
|
55
|
-
setLoading(false);
|
|
56
|
-
}
|
|
57
|
-
}, [router]);
|
|
58
|
-
function changeRoute(e, path) {
|
|
59
|
-
setLoading(true);
|
|
60
|
-
if (router) {
|
|
61
|
-
router
|
|
62
|
-
.push({
|
|
63
|
-
pathname: path,
|
|
64
|
-
})
|
|
65
|
-
.finally(() => setLoading(false));
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
setLoading(false);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return (React.createElement(React.Fragment, null,
|
|
72
|
-
React.createElement(Box, { position: pos, sx: { width: '100%', zIndex: 100 } },
|
|
73
|
-
React.createElement(AppBar, { position: 'relative', elevation: 0, sx: { backgroundColor: 'white', color: 'black', paddingX: { xs: 1, md: 4 } } },
|
|
74
|
-
React.createElement(Stack, { direction: 'row', justifyContent: 'space-between' },
|
|
75
|
-
React.createElement(Stack, { direction: 'row', alignItems: 'center', spacing: 2, marginRight: 2, sx: { display: { xs: 'none', md: 'flex' }, width: '100%' } },
|
|
76
|
-
React.createElement(Link, { href: '/' }, next ? React.createElement(Image, { src: img, alt: title, width: 40, height: 40 }) : React.createElement("img", { src: img, height: 35 })),
|
|
77
|
-
React.createElement(Box, null,
|
|
78
|
-
React.createElement(Typography, { variant: 'subtitle1', fontWeight: 600 }, title))),
|
|
79
|
-
React.createElement(Stack, { direction: 'row', width: '100%', justifyContent: 'center', alignItems: 'center', spacing: 2, sx: { display: { xs: 'none', md: 'flex' } } }, links.map((x, index) => {
|
|
80
|
-
var _a;
|
|
81
|
-
return (React.createElement(Box, { borderBottom: next ? (verificarRota((_a = router === null || router === void 0 ? void 0 : router.pathname) !== null && _a !== void 0 ? _a : '', x.path) ? `solid 4px ${color}` : '') : verificarRota(route, x.path) ? `solid 4px ${color}` : '', height: '100%', paddingX: 2, key: JSON.stringify({ x, index }), sx: {
|
|
82
|
-
':hover': {
|
|
83
|
-
backgroundColor: '#fcfcfc',
|
|
84
|
-
cursor: 'pointer',
|
|
85
|
-
userSelect: 'none',
|
|
86
|
-
},
|
|
87
|
-
}, onClick: (e) => {
|
|
88
|
-
next && console.log('pathname:', router === null || router === void 0 ? void 0 : router.pathname, ':=', x.path);
|
|
89
|
-
changeRoute(e, x.path);
|
|
90
|
-
} },
|
|
91
|
-
React.createElement(Stack, { height: '100%', justifyContent: 'center' }, x.name)));
|
|
92
|
-
})),
|
|
93
|
-
React.createElement(Box, { sx: {
|
|
94
|
-
display: {
|
|
95
|
-
xs: 'flex',
|
|
96
|
-
md: 'none',
|
|
97
|
-
},
|
|
98
|
-
} }, links.length > 0 && (React.createElement(React.Fragment, null,
|
|
99
|
-
React.createElement(IconButton, { onClick: onMenuClick },
|
|
100
|
-
React.createElement(MenuIcon, null)),
|
|
101
|
-
React.createElement(Menu, { open: menuOpen, onClose: closeMenu, anchorEl: anchor }, links.map((x, index) => (React.createElement(MenuItem, { key: JSON.stringify({ x, index }), onClick: (e) => onMenuItemClick(e, x.path) },
|
|
102
|
-
React.createElement(Typography, { textTransform: 'capitalize' }, x.name)))))))),
|
|
103
|
-
React.createElement(Stack, { direction: 'row', justifyContent: 'flex-end', alignItems: 'center', sx: { width: { md: '100%' } }, paddingY: 1 },
|
|
104
|
-
React.createElement(Stack, { direction: 'row', spacing: 2 },
|
|
105
|
-
React.createElement(Box, null, el),
|
|
106
|
-
user ? (React.createElement(Stack, { direction: 'row', spacing: 1, sx: {
|
|
107
|
-
'&:hover': {
|
|
108
|
-
backgroundColor: '#a9def9',
|
|
109
|
-
cursor: 'pointer',
|
|
110
|
-
},
|
|
111
|
-
padding: 0.5,
|
|
112
|
-
borderRadius: 60,
|
|
113
|
-
} },
|
|
114
|
-
React.createElement(Box, { sx: { display: 'flex', alignItems: 'center' } },
|
|
115
|
-
React.createElement(Avatar, { sx: { width: 30, height: 30 }, src: user.image }),
|
|
116
|
-
React.createElement(Menu, { open: avatarMenu, onClose: (e) => setAvatarAnchor(null), anchorEl: avatarAnchor, disableScrollLock: true, transformOrigin: { horizontal: 'right', vertical: 'top' }, anchorOrigin: { horizontal: 'right', vertical: 'bottom' }, sx: { '.MuiMenu-paper': { borderRadius: 4 } } },
|
|
117
|
-
menuItems,
|
|
118
|
-
React.createElement(MenuItem, { onClick: (e) => {
|
|
119
|
-
setAvatarAnchor(null);
|
|
120
|
-
if (!!logoutFunc)
|
|
121
|
-
logoutFunc();
|
|
122
|
-
logout();
|
|
123
|
-
} },
|
|
124
|
-
React.createElement(Stack, { direction: 'row', spacing: 1 },
|
|
125
|
-
React.createElement(LogoutOutlinedIcon, { sx: { fill: '#545454' } }),
|
|
126
|
-
React.createElement(Typography, { textTransform: 'capitalize' }, logoutMsg))))),
|
|
127
|
-
React.createElement(Stack, { direction: 'row', spacing: 0.4, alignItems: 'center', onClick: (e) => setAvatarAnchor(e.currentTarget), sx: { userSelect: 'none' } },
|
|
128
|
-
React.createElement(Typography, null, "Ol\u00E1,"),
|
|
129
|
-
React.createElement(Typography, { fontWeight: 600 }, user.given_name),
|
|
130
|
-
React.createElement(KeyboardArrowDownIcon, null)))) : type === 'govbr' ? (React.createElement(Button, { variant: 'contained', size: 'small', startIcon: React.createElement(PersonIcon, null), onClick: login, sx: { color: 'white', textTransform: 'inherit', borderRadius: 50, paddingX: 2 } },
|
|
131
|
-
React.createElement(Typography, { fontWeight: 600, fontSize: 15, padding: 0.4 }, "Entrar com o gov.br"))) : (React.createElement(Button, { variant: 'contained', size: 'small', startIcon: React.createElement(PersonIcon, null), onClick: login, sx: { color: 'white', textTransform: 'inherit', borderRadius: 50, paddingX: 2 } },
|
|
132
|
-
React.createElement(Typography, { fontWeight: 600, fontSize: 15, padding: 0.4 }, "Entrar"))))))),
|
|
133
|
-
loading && React.createElement(LinearProgress, null)),
|
|
134
|
-
React.createElement(Box, { paddingBottom: paddingBottom })));
|
|
135
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { useForm } from 'react-hook-form';
|
|
3
|
-
import { FormContext } from '../../context/form';
|
|
4
|
-
import { toast } from 'react-toastify';
|
|
5
|
-
export default function FormProvider({ children, onSubmit, formMethod = 'GET', submiting = false, }) {
|
|
6
|
-
const { register, handleSubmit, control, formState: { errors }, reset, watch, trigger, setValue, unregister, getValues, } = useForm();
|
|
7
|
-
const [filesUid, setFilesUid] = useState([]);
|
|
8
|
-
return (React.createElement(FormContext.Provider, { value: {
|
|
9
|
-
formRegister: register,
|
|
10
|
-
formWatch: watch,
|
|
11
|
-
formReset: reset,
|
|
12
|
-
formControl: control,
|
|
13
|
-
formSetValue: setValue,
|
|
14
|
-
formTrigger: trigger,
|
|
15
|
-
formUnregister: unregister,
|
|
16
|
-
formGetValues: getValues,
|
|
17
|
-
formHandleSubmit: handleSubmit,
|
|
18
|
-
setFilesUid: setFilesUid,
|
|
19
|
-
errors: errors,
|
|
20
|
-
submiting: submiting,
|
|
21
|
-
} },
|
|
22
|
-
React.createElement("form", { method: formMethod, onSubmit: handleSubmit((d) => onSubmit(d, filesUid), (d) => toast('Formulário incompleto! Verifique os campos marcados e tente novamente.', { type: 'warning', position: 'top-right', theme: 'colored' })) }, children)));
|
|
23
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { useRouter } from 'next/router';
|
|
2
|
-
import React, { useEffect, useState } from 'react';
|
|
3
|
-
import { AuthContext } from '../../context/auth';
|
|
4
|
-
import Keycloak from 'keycloak-js';
|
|
5
|
-
export const cookieName = 'nextauth.token';
|
|
6
|
-
const userImgName = 'user-data.img';
|
|
7
|
-
export function KeycloakAuthProvider({ url, realm, clientId, children, type = 'ad', resource_name = 'eventos-front', }) {
|
|
8
|
-
const [user, setUser] = useState();
|
|
9
|
-
const [userLoaded, setUserLoaded] = useState(false);
|
|
10
|
-
const [kc, setKc] = useState(null);
|
|
11
|
-
const [token, setToken] = useState(undefined);
|
|
12
|
-
const router = useRouter();
|
|
13
|
-
const isAuth = !!user;
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
const keycloak = new Keycloak({
|
|
16
|
-
url: url,
|
|
17
|
-
realm: realm,
|
|
18
|
-
clientId: clientId,
|
|
19
|
-
});
|
|
20
|
-
setKc(keycloak);
|
|
21
|
-
keycloak
|
|
22
|
-
.init({
|
|
23
|
-
onLoad: 'check-sso',
|
|
24
|
-
pkceMethod: 'S256',
|
|
25
|
-
})
|
|
26
|
-
.then((auth) => {
|
|
27
|
-
var _a, _b;
|
|
28
|
-
setUserLoaded(true);
|
|
29
|
-
if (!auth) {
|
|
30
|
-
console.log('NAO AUTENTICADO');
|
|
31
|
-
//window.location.reload();
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
const tokenParsed = keycloak.tokenParsed;
|
|
35
|
-
console.log('TOKEN-> ', tokenParsed);
|
|
36
|
-
const userData = Object.assign(Object.assign({}, tokenParsed), { token: keycloak.token, roles: ((_b = ((_a = tokenParsed === null || tokenParsed === void 0 ? void 0 : tokenParsed.resource_access) !== null && _a !== void 0 ? _a : {})[resource_name]) !== null && _b !== void 0 ? _b : []).roles });
|
|
37
|
-
setUser(userData);
|
|
38
|
-
console.info('Authenticated!!!');
|
|
39
|
-
keycloak.onTokenExpired = () => {
|
|
40
|
-
console.log('token expired');
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
}, () => {
|
|
44
|
-
console.error('Authenticated Failed');
|
|
45
|
-
});
|
|
46
|
-
const s = router.query['status'];
|
|
47
|
-
if (!s)
|
|
48
|
-
return;
|
|
49
|
-
if (s === 'success') {
|
|
50
|
-
window.history.replaceState(null, '', '/');
|
|
51
|
-
}
|
|
52
|
-
}, []);
|
|
53
|
-
function login() {
|
|
54
|
-
console.log('Tentando logar...');
|
|
55
|
-
console.log('KC: ', {
|
|
56
|
-
instancia: kc,
|
|
57
|
-
logado: kc === null || kc === void 0 ? void 0 : kc.authenticated,
|
|
58
|
-
client_id: kc === null || kc === void 0 ? void 0 : kc.clientId,
|
|
59
|
-
});
|
|
60
|
-
kc === null || kc === void 0 ? void 0 : kc.login();
|
|
61
|
-
}
|
|
62
|
-
function logout() {
|
|
63
|
-
setUserLoaded(false);
|
|
64
|
-
kc === null || kc === void 0 ? void 0 : kc.logout();
|
|
65
|
-
setUser(null);
|
|
66
|
-
localStorage.removeItem(userImgName);
|
|
67
|
-
}
|
|
68
|
-
return React.createElement(AuthContext.Provider, { value: { user, isAuth, userLoaded, login, logout, saveUserData: () => { }, type } }, children);
|
|
69
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ToastContainer } from 'react-toastify';
|
|
3
|
-
import { CustomModalProvider } from '../modal/Modal';
|
|
4
|
-
// import '../../css/ReactToastify.css'
|
|
5
|
-
//components principal da aplicação
|
|
6
|
-
export function SspComponentsProvider(props) {
|
|
7
|
-
return (React.createElement(React.Fragment, null,
|
|
8
|
-
React.createElement(CustomModalProvider, null),
|
|
9
|
-
props.children,
|
|
10
|
-
React.createElement(ToastContainer, { position: 'bottom-right', theme: 'colored' })));
|
|
11
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { Menu, MenuItem } from '@mui/material';
|
|
13
|
-
import React from 'react';
|
|
14
|
-
import Bt from './Bt';
|
|
15
|
-
export default function CustomMenu(_a) {
|
|
16
|
-
var { data = [] } = _a, props = __rest(_a, ["data"]);
|
|
17
|
-
const [anchorEl, setAnchorEl] = React.useState(null);
|
|
18
|
-
const open = Boolean(anchorEl);
|
|
19
|
-
const handleClick = (event) => {
|
|
20
|
-
setAnchorEl(event.currentTarget);
|
|
21
|
-
};
|
|
22
|
-
const handleClose = () => {
|
|
23
|
-
setAnchorEl(null);
|
|
24
|
-
};
|
|
25
|
-
return (React.createElement(React.Fragment, null,
|
|
26
|
-
React.createElement(Bt, Object.assign({}, props.btProps, { onClick: handleClick }), props.children),
|
|
27
|
-
React.createElement(Menu, { id: 'basic-menu', anchorEl: anchorEl, open: open, onClose: handleClose, MenuListProps: {
|
|
28
|
-
'aria-labelledby': 'basic-button',
|
|
29
|
-
} }, data.map((x) => (React.createElement(MenuItem, { onClick: (e) => {
|
|
30
|
-
x.onClick && x.onClick();
|
|
31
|
-
handleClose();
|
|
32
|
-
} }, x.name))))));
|
|
33
|
-
}
|
package/src/context/auth.js
DELETED
package/src/context/form.js
DELETED
package/src/index.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import CheckBox from './components/form/checkbox/CheckBox';
|
|
2
|
-
import CheckBoxWarning from './components/form/checkbox/CheckBoxWarning';
|
|
3
|
-
import DatePicker from './components/form/date/DatePicker';
|
|
4
|
-
import TimePicker from './components/form/date/TimePicker';
|
|
5
|
-
import FileUpload from './components/form/file/FileUpload';
|
|
6
|
-
import ActiveInput from './components/form/input/ActiveInput';
|
|
7
|
-
import AutoComplete from './components/form/input/AutoComplete';
|
|
8
|
-
import FetchAutoComplete from './components/form/input/FetchAutoComplete';
|
|
9
|
-
import Input from './components/form/input/Input';
|
|
10
|
-
import MaskInput from './components/form/input/MaskInput';
|
|
11
|
-
import MultInput from './components/form/input/MultInput';
|
|
12
|
-
import OtherCheckBox from './components/form/input/OtherCheckBox';
|
|
13
|
-
import Stepper from './components/form/stepper/Stepper';
|
|
14
|
-
import StepperBlock from './components/form/stepper/StepperBlock';
|
|
15
|
-
import Switch from './components/form/switch/Switch';
|
|
16
|
-
import { SwitchWatch, ToggleVisibility } from './components/form/switch/ToggleVisibility';
|
|
17
|
-
import Table from './components/form/table/Table';
|
|
18
|
-
import NavBar from './components/navbar/NavBar';
|
|
19
|
-
import TabNavBar from './components/navbar/TabNavBar';
|
|
20
|
-
import FormProvider from './components/providers/FormProvider';
|
|
21
|
-
import { OAuthProvider, cookieName as AUTH_COOKIE_NAME } from './components/providers/OAuthProvider';
|
|
22
|
-
import { AuthContext } from './context/auth';
|
|
23
|
-
import { FormContext } from './context/form';
|
|
24
|
-
import { Category } from './components/detalhes/Category';
|
|
25
|
-
import { Field } from './components/detalhes/Field';
|
|
26
|
-
import { FieldLabel } from './components/detalhes/FieldLabel';
|
|
27
|
-
import { File } from './components/detalhes/File';
|
|
28
|
-
import CheckBoxAdditional from './components/form/checkbox/CheckBoxAdditional';
|
|
29
|
-
import RequiredCheckBoxGroup from './components/form/checkbox/RequiredCheckBoxValidator';
|
|
30
|
-
import { KeycloakAuthProvider } from './components/providers/KeycloakAuthProvider';
|
|
31
|
-
import { FixedAutoComplete } from './components/form/input/FixedAutoComplete';
|
|
32
|
-
import DropFileUpload from './components/form/file/DropFileUpload';
|
|
33
|
-
import { MODAL } from './components/modal/Modal';
|
|
34
|
-
import { SspComponentsProvider } from './components/providers/SspComponentsProvider';
|
|
35
|
-
import Button from './components/utils/Bt';
|
|
36
|
-
import Menu from './components/utils/CustomMenu';
|
|
37
|
-
export { CheckBox, CheckBoxWarning, DatePicker, TimePicker, FileUpload, ActiveInput, AutoComplete, FetchAutoComplete, Input, MaskInput, MultInput, OtherCheckBox, Stepper, StepperBlock, Switch, SwitchWatch, ToggleVisibility, Table, NavBar, FormProvider, OAuthProvider, AUTH_COOKIE_NAME, AuthContext, FormContext, KeycloakAuthProvider, CheckBoxAdditional, RequiredCheckBoxGroup, FixedAutoComplete,
|
|
38
|
-
//detalhes
|
|
39
|
-
Category, Field, FieldLabel, File,
|
|
40
|
-
//new
|
|
41
|
-
DropFileUpload, MODAL, SspComponentsProvider, TabNavBar, Button, Menu };
|
package/src/types/auth.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|