@ssplib/react-components 0.0.245 → 0.0.247
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.
|
@@ -122,7 +122,7 @@ function FetchAutoComplete({ name, url, title, customLoadingText, shouldRefetch
|
|
|
122
122
|
return 'Este campo é obrigatório';
|
|
123
123
|
},
|
|
124
124
|
}), { hidden: true })),
|
|
125
|
-
react_1.default.createElement(material_1.Autocomplete, { value: value, loading: loading, loadingText: loadingText, options: list, defaultValue: dValue, isOptionEqualToValue: (op, value) => op.id === value.id, onChange: (e, v) => handleAutoCompleteChange(v), renderInput: (params) => {
|
|
125
|
+
react_1.default.createElement(material_1.Autocomplete, { value: value, loading: loading, loadingText: loadingText, options: list, defaultValue: dValue, getOptionDisabled: (option) => { var _a; return (_a = option === null || option === void 0 ? void 0 : option.disabled) !== null && _a !== void 0 ? _a : false; }, isOptionEqualToValue: (op, value) => op.id === value.id, onChange: (e, v) => handleAutoCompleteChange(v), renderInput: (params) => {
|
|
126
126
|
var _a;
|
|
127
127
|
return (react_1.default.createElement(material_1.TextField, Object.assign({}, params, { size: 'small', fullWidth: true, placeholder: title, onFocus: onFocus, error: (0, lodash_get_1.default)(context === null || context === void 0 ? void 0 : context.errors, name) ? true : false, helperText: (_a = (0, lodash_get_1.default)(context === null || context === void 0 ? void 0 : context.errors, name)) === null || _a === void 0 ? void 0 : _a.message })));
|
|
128
128
|
}, sx: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export default function NavBar({ links, title, img, pos, next, el, menuItems, paddingBottom, logoutMsg, ...props }: {
|
|
2
|
+
export default function NavBar({ links, title, img, pos, next, el, menuItems, paddingBottom, logoutMsg, logoutFunc, ...props }: {
|
|
3
3
|
links: {
|
|
4
4
|
name: string;
|
|
5
5
|
path: string;
|
|
@@ -11,5 +11,6 @@ export default function NavBar({ links, title, img, pos, next, el, menuItems, pa
|
|
|
11
11
|
next?: boolean;
|
|
12
12
|
el?: JSX.Element;
|
|
13
13
|
logoutMsg?: string;
|
|
14
|
+
logoutFunc?: () => void;
|
|
14
15
|
pos?: 'fixed' | 'inherit';
|
|
15
16
|
}): JSX.Element;
|
|
@@ -49,7 +49,7 @@ const router_1 = require("next/router");
|
|
|
49
49
|
const react_1 = __importStar(require("react"));
|
|
50
50
|
const auth_1 = require("../../context/auth");
|
|
51
51
|
function NavBar(_a) {
|
|
52
|
-
var { links, title, img, pos = 'fixed', next = true, el, menuItems, paddingBottom = 0, logoutMsg = 'Sair' } = _a, props = __rest(_a, ["links", "title", "img", "pos", "next", "el", "menuItems", "paddingBottom", "logoutMsg"]);
|
|
52
|
+
var { links, title, img, pos = 'fixed', next = true, el, menuItems, paddingBottom = 0, logoutMsg = 'Sair', logoutFunc } = _a, props = __rest(_a, ["links", "title", "img", "pos", "next", "el", "menuItems", "paddingBottom", "logoutMsg", "logoutFunc"]);
|
|
53
53
|
let router = undefined;
|
|
54
54
|
if (next)
|
|
55
55
|
router = (0, router_1.useRouter)();
|
|
@@ -137,6 +137,8 @@ function NavBar(_a) {
|
|
|
137
137
|
menuItems,
|
|
138
138
|
react_1.default.createElement(material_1.MenuItem, { onClick: (e) => {
|
|
139
139
|
setAvatarAnchor(null);
|
|
140
|
+
if (!!logoutFunc)
|
|
141
|
+
logoutFunc();
|
|
140
142
|
logout();
|
|
141
143
|
} },
|
|
142
144
|
react_1.default.createElement(material_1.Stack, { direction: 'row', spacing: 1 },
|