@digitaldefiance/express-suite-react-components 4.22.2 → 4.22.4
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/package.json +1 -1
- package/src/components/DropdownMenu.d.ts.map +1 -1
- package/src/components/DropdownMenu.js +1 -0
- package/src/components/SideMenuListItem.d.ts.map +1 -1
- package/src/components/SideMenuListItem.js +3 -3
- package/src/interfaces/IMenuOption.d.ts +8 -0
- package/src/interfaces/IMenuOption.d.ts.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digitaldefiance/express-suite-react-components",
|
|
3
|
-
"version": "4.22.
|
|
3
|
+
"version": "4.22.4",
|
|
4
4
|
"homepage": "https://github.com/Digital-Defiance/react-components",
|
|
5
5
|
"description": "React MUI components for Digital Defiance Express Suite",
|
|
6
6
|
"repository": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/DropdownMenu.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAc,YAAY,EAAyB,MAAM,OAAO,CAAC;AAE5E,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAI7C,UAAU,iBAAiB;IACzB,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,EAAE,YAAY,CAAC;CACxB;AAED,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,
|
|
1
|
+
{"version":3,"file":"DropdownMenu.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/DropdownMenu.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAc,YAAY,EAAyB,MAAM,OAAO,CAAC;AAE5E,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAI7C,UAAU,iBAAiB;IACzB,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,EAAE,YAAY,CAAC;CACxB;AAED,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CA8E9C,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideMenuListItem.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/SideMenuListItem.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,EAAE,EAAe,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,WAAW,CAAC;IACtB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,CACX,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,KAC1D,IAAI,CAAC;CACX;AAED,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,
|
|
1
|
+
{"version":3,"file":"SideMenuListItem.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/SideMenuListItem.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,EAAE,EAAe,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,WAAW,CAAC;IACtB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,CACX,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,KAC1D,IAAI,CAAC;CACX;AAED,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAuDtD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -26,17 +26,17 @@ const SideMenuListItem = ({ menuItem, onClose, onNavigate, }) => {
|
|
|
26
26
|
onClose();
|
|
27
27
|
}, [onNavigate, onClose]);
|
|
28
28
|
if (menuItem.divider) {
|
|
29
|
-
return (0, jsx_runtime_1.jsx)(material_1.Divider, {}, menuItem.id);
|
|
29
|
+
return (0, jsx_runtime_1.jsx)(material_1.Divider, { sx: { ...menuItem.additionalSx } }, menuItem.id);
|
|
30
30
|
}
|
|
31
31
|
else if (menuItem.link) {
|
|
32
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.ListItemButton, { onClick: handleMenuItemClick(menuItem), children: [menuItem.icon && (0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: menuItem.icon }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: menuItem.label })] }, menuItem.id));
|
|
32
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.ListItemButton, { onClick: handleMenuItemClick(menuItem), sx: { ...menuItem.additionalSx }, children: [menuItem.icon && (0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { sx: { ...menuItem.iconSx }, children: menuItem.icon }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: menuItem.label, sx: { ...menuItem.textSx } })] }, menuItem.id));
|
|
33
33
|
}
|
|
34
34
|
else if (menuItem.action) {
|
|
35
35
|
const action = menuItem.action;
|
|
36
36
|
return ((0, jsx_runtime_1.jsxs)(material_1.ListItemButton, { onClick: async () => {
|
|
37
37
|
await action();
|
|
38
38
|
onClose();
|
|
39
|
-
}, children: [menuItem.icon && (0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: menuItem.icon }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: menuItem.label })] }, menuItem.id));
|
|
39
|
+
}, sx: { ...menuItem.additionalSx }, children: [menuItem.icon && (0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { sx: { ...menuItem.iconSx }, children: menuItem.icon }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: menuItem.label, sx: { ...menuItem.textSx } })] }, menuItem.id));
|
|
40
40
|
}
|
|
41
41
|
return null;
|
|
42
42
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { To } from 'react-router-dom';
|
|
3
3
|
import { MenuType } from '../types/MenuType';
|
|
4
|
+
import { SxProps } from '@mui/system';
|
|
5
|
+
import { Theme } from '@mui/material';
|
|
4
6
|
export interface IMenuOption {
|
|
5
7
|
/**
|
|
6
8
|
* Unique identifier for the menu option
|
|
@@ -54,5 +56,11 @@ export interface IMenuOption {
|
|
|
54
56
|
* @returns boolean
|
|
55
57
|
*/
|
|
56
58
|
filter?: (option: IMenuOption) => boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Additional CSS properties
|
|
61
|
+
*/
|
|
62
|
+
additionalSx?: SxProps<Theme>;
|
|
63
|
+
iconSx?: SxProps<Theme>;
|
|
64
|
+
textSx?: SxProps<Theme>;
|
|
57
65
|
}
|
|
58
66
|
//# sourceMappingURL=IMenuOption.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IMenuOption.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/interfaces/IMenuOption.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"IMenuOption.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/interfaces/IMenuOption.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC;IAC7C;;OAEG;IACH,cAAc,EAAE,QAAQ,EAAE,CAAC;IAC3B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;;OAIG;IACH,IAAI,CAAC,EAAE,EAAE,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IAClD;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB;;;;;OAKG;IACH,YAAY,EAAE,OAAO,GAAG,SAAS,CAAC;IAClC;;;;OAIG;IACH,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC;IAC1C;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9B,MAAM,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;CACzB"}
|