@selfcommunity/react-ui 0.8.0-alpha.25 → 0.8.0-alpha.26
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/lib/cjs/components/NavigationMenuIconButton/NavigationMenuDrawer.js +1 -1
- package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuIconButton.d.ts +11 -1
- package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuIconButton.js +2 -2
- package/lib/esm/components/NavigationMenuIconButton/NavigationMenuDrawer.js +1 -1
- package/lib/esm/components/NavigationMenuIconButton/NavigationMenuIconButton.d.ts +11 -1
- package/lib/esm/components/NavigationMenuIconButton/NavigationMenuIconButton.js +2 -2
- package/lib/umd/react-ui.js +1 -1
- package/package.json +5 -5
|
@@ -30,6 +30,6 @@ function NavigationMenuDrawer(inProps) {
|
|
|
30
30
|
name: PREFIX
|
|
31
31
|
});
|
|
32
32
|
const { className = null, drawerHeaderContent = (0, jsx_runtime_1.jsx)(DefaultHeaderContent_1.default, {}), drawerContent = (0, jsx_runtime_1.jsx)(DefaultDrawerContent_1.default, {}), ScrollContainerProps = {}, open, onClose } = props, rest = tslib_1.__rest(props, ["className", "drawerHeaderContent", "drawerContent", "ScrollContainerProps", "open", "onClose"]);
|
|
33
|
-
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className), open: open, onClose: onClose }, rest, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.drawerHeader }, { children: [drawerHeaderContent, (0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ className: classes.drawerHeaderAction, onClick: onClose }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "close" }) }))] })), (0, jsx_runtime_1.jsx)(material_1.Divider, {}), (0, jsx_runtime_1.jsx)(ScrollContainer_1.default, Object.assign({}, ScrollContainerProps, { children: (0, jsx_runtime_1.jsx)(material_1.List, Object.assign({ className: classes.drawerContent, onClick: onClose }, { children: drawerContent })) }))] })));
|
|
33
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ anchor: "left", className: (0, classnames_1.default)(classes.root, className), open: open, onClose: onClose }, rest, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.drawerHeader }, { children: [drawerHeaderContent, (0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ className: classes.drawerHeaderAction, onClick: onClose }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "close" }) }))] })), (0, jsx_runtime_1.jsx)(material_1.Divider, {}), (0, jsx_runtime_1.jsx)(ScrollContainer_1.default, Object.assign({}, ScrollContainerProps, { children: (0, jsx_runtime_1.jsx)(material_1.List, Object.assign({ className: classes.drawerContent, onClick: onClose }, { children: drawerContent })) }))] })));
|
|
34
34
|
}
|
|
35
35
|
exports.default = NavigationMenuDrawer;
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
import { IconButtonProps } from '@mui/material';
|
|
2
2
|
import { NavigationMenuDrawerProps } from './NavigationMenuDrawer';
|
|
3
3
|
export interface NavigationMenuIconButtonProps extends IconButtonProps {
|
|
4
|
+
/**
|
|
5
|
+
* Prop to show/hide the default drawer component
|
|
6
|
+
* @default true
|
|
7
|
+
*/
|
|
8
|
+
showDrawer?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Callback triggered on menu click
|
|
11
|
+
* @default null
|
|
12
|
+
*/
|
|
13
|
+
onMenuIconClick?: () => void;
|
|
4
14
|
/**
|
|
5
15
|
* Props to spread to default drawer root
|
|
6
|
-
* @default {
|
|
16
|
+
* @default {}
|
|
7
17
|
*/
|
|
8
18
|
DrawerProps?: NavigationMenuDrawerProps;
|
|
9
19
|
}
|
|
@@ -47,7 +47,7 @@ function NavigationMenuIconButton(inProps) {
|
|
|
47
47
|
props: inProps,
|
|
48
48
|
name: PREFIX
|
|
49
49
|
});
|
|
50
|
-
const { className = null, DrawerProps = {
|
|
50
|
+
const { className = null, DrawerProps = {}, onMenuIconClick = null, showDrawer = true } = props, rest = tslib_1.__rest(props, ["className", "DrawerProps", "onMenuIconClick", "showDrawer"]);
|
|
51
51
|
// STATE
|
|
52
52
|
const [anchorEl, setAnchorEl] = (0, react_1.useState)(null);
|
|
53
53
|
// CONTEXT
|
|
@@ -63,6 +63,6 @@ function NavigationMenuIconButton(inProps) {
|
|
|
63
63
|
if (!preferences[react_core_1.SCPreferences.CONFIGURATIONS_CONTENT_AVAILABILITY].value && !((_a = scUserContext.user) === null || _a === void 0 ? void 0 : _a.id)) {
|
|
64
64
|
return null;
|
|
65
65
|
}
|
|
66
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { onClick: handleOpen }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "menu" }) })), (0, jsx_runtime_1.jsx)(NavigationMenuDrawer_1.default, Object.assign({ open: Boolean(anchorEl), onClose: handleClose }, DrawerProps))] }));
|
|
66
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { onClick: onMenuIconClick !== null && onMenuIconClick !== void 0 ? onMenuIconClick : handleOpen }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "menu" }) })), showDrawer && (0, jsx_runtime_1.jsx)(NavigationMenuDrawer_1.default, Object.assign({ open: Boolean(anchorEl), onClose: handleClose }, DrawerProps))] }));
|
|
67
67
|
}
|
|
68
68
|
exports.default = NavigationMenuIconButton;
|
|
@@ -28,5 +28,5 @@ export default function NavigationMenuDrawer(inProps) {
|
|
|
28
28
|
name: PREFIX
|
|
29
29
|
});
|
|
30
30
|
const { className = null, drawerHeaderContent = _jsx(DefaultHeaderContent, {}), drawerContent = _jsx(DefaultDrawerContent, {}), ScrollContainerProps = {}, open, onClose } = props, rest = __rest(props, ["className", "drawerHeaderContent", "drawerContent", "ScrollContainerProps", "open", "onClose"]);
|
|
31
|
-
return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className), open: open, onClose: onClose }, rest, { children: [_jsxs(Box, Object.assign({ className: classes.drawerHeader }, { children: [drawerHeaderContent, _jsx(IconButton, Object.assign({ className: classes.drawerHeaderAction, onClick: onClose }, { children: _jsx(Icon, { children: "close" }) }))] })), _jsx(Divider, {}), _jsx(ScrollContainer, Object.assign({}, ScrollContainerProps, { children: _jsx(List, Object.assign({ className: classes.drawerContent, onClick: onClose }, { children: drawerContent })) }))] })));
|
|
31
|
+
return (_jsxs(Root, Object.assign({ anchor: "left", className: classNames(classes.root, className), open: open, onClose: onClose }, rest, { children: [_jsxs(Box, Object.assign({ className: classes.drawerHeader }, { children: [drawerHeaderContent, _jsx(IconButton, Object.assign({ className: classes.drawerHeaderAction, onClick: onClose }, { children: _jsx(Icon, { children: "close" }) }))] })), _jsx(Divider, {}), _jsx(ScrollContainer, Object.assign({}, ScrollContainerProps, { children: _jsx(List, Object.assign({ className: classes.drawerContent, onClick: onClose }, { children: drawerContent })) }))] })));
|
|
32
32
|
}
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
import { IconButtonProps } from '@mui/material';
|
|
2
2
|
import { NavigationMenuDrawerProps } from './NavigationMenuDrawer';
|
|
3
3
|
export interface NavigationMenuIconButtonProps extends IconButtonProps {
|
|
4
|
+
/**
|
|
5
|
+
* Prop to show/hide the default drawer component
|
|
6
|
+
* @default true
|
|
7
|
+
*/
|
|
8
|
+
showDrawer?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Callback triggered on menu click
|
|
11
|
+
* @default null
|
|
12
|
+
*/
|
|
13
|
+
onMenuIconClick?: () => void;
|
|
4
14
|
/**
|
|
5
15
|
* Props to spread to default drawer root
|
|
6
|
-
* @default {
|
|
16
|
+
* @default {}
|
|
7
17
|
*/
|
|
8
18
|
DrawerProps?: NavigationMenuDrawerProps;
|
|
9
19
|
}
|
|
@@ -45,7 +45,7 @@ export default function NavigationMenuIconButton(inProps) {
|
|
|
45
45
|
props: inProps,
|
|
46
46
|
name: PREFIX
|
|
47
47
|
});
|
|
48
|
-
const { className = null, DrawerProps = {
|
|
48
|
+
const { className = null, DrawerProps = {}, onMenuIconClick = null, showDrawer = true } = props, rest = __rest(props, ["className", "DrawerProps", "onMenuIconClick", "showDrawer"]);
|
|
49
49
|
// STATE
|
|
50
50
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
51
51
|
// CONTEXT
|
|
@@ -61,5 +61,5 @@ export default function NavigationMenuIconButton(inProps) {
|
|
|
61
61
|
if (!preferences[SCPreferences.CONFIGURATIONS_CONTENT_AVAILABILITY].value && !((_a = scUserContext.user) === null || _a === void 0 ? void 0 : _a.id)) {
|
|
62
62
|
return null;
|
|
63
63
|
}
|
|
64
|
-
return (_jsxs(_Fragment, { children: [_jsx(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { onClick: handleOpen }, { children: _jsx(Icon, { children: "menu" }) })), _jsx(NavigationMenuDrawer, Object.assign({ open: Boolean(anchorEl), onClose: handleClose }, DrawerProps))] }));
|
|
64
|
+
return (_jsxs(_Fragment, { children: [_jsx(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { onClick: onMenuIconClick !== null && onMenuIconClick !== void 0 ? onMenuIconClick : handleOpen }, { children: _jsx(Icon, { children: "menu" }) })), showDrawer && _jsx(NavigationMenuDrawer, Object.assign({ open: Boolean(anchorEl), onClose: handleClose }, DrawerProps))] }));
|
|
65
65
|
}
|