aefis-core-ui 2.3.0-rc29 → 2.3.0-rc30
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/dist/index.modern.js +10 -5
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -1775,7 +1775,7 @@ AnimatedExpandMoreIcon.propTypes = {
|
|
|
1775
1775
|
sx: PropTypes.any
|
|
1776
1776
|
};
|
|
1777
1777
|
|
|
1778
|
-
const _excluded$l = ["name", "icon", "menuConfiguration", "color", "displayType", "variant", "onClick", "link"];
|
|
1778
|
+
const _excluded$l = ["name", "icon", "menuConfiguration", "color", "displayType", "variant", "onClick", "link", "data"];
|
|
1779
1779
|
const AefisButton = withStyles$1({
|
|
1780
1780
|
root: {
|
|
1781
1781
|
"&:focus": {
|
|
@@ -1806,9 +1806,9 @@ const MenuButton = /*#__PURE__*/forwardRef(function MenuButton(_ref, ref) {
|
|
|
1806
1806
|
const handleClose = () => {
|
|
1807
1807
|
setAnchorEl(null);
|
|
1808
1808
|
};
|
|
1809
|
-
const handleMenuClick = action => {
|
|
1809
|
+
const handleMenuClick = (action, data) => {
|
|
1810
1810
|
setAnchorEl(null);
|
|
1811
|
-
action && action();
|
|
1811
|
+
action && action(data);
|
|
1812
1812
|
};
|
|
1813
1813
|
const id = useUID();
|
|
1814
1814
|
const buttonId = `content-box-menu-button-${id}`;
|
|
@@ -1864,7 +1864,7 @@ const MenuButton = /*#__PURE__*/forwardRef(function MenuButton(_ref, ref) {
|
|
|
1864
1864
|
"aria-labelledby": buttonId
|
|
1865
1865
|
},
|
|
1866
1866
|
children: menuConfiguration == null ? void 0 : menuConfiguration.map((item, index) => /*#__PURE__*/jsxs(MenuItem, {
|
|
1867
|
-
onClick:
|
|
1867
|
+
onClick: data => handleMenuClick(item.onClick, data),
|
|
1868
1868
|
sx: {
|
|
1869
1869
|
borderTop: item.divider ? "1px solid #dddddd" : "none",
|
|
1870
1870
|
marginTop: item.divider ? 1 : "inherit",
|
|
@@ -1907,7 +1907,9 @@ MenuButton.propTypes = {
|
|
|
1907
1907
|
onClick: PropTypes.func
|
|
1908
1908
|
})),
|
|
1909
1909
|
/** The function to execute when the button is clicked. */
|
|
1910
|
-
onClick: PropTypes.func
|
|
1910
|
+
onClick: PropTypes.func,
|
|
1911
|
+
/** Data from the object to pass to the menu item. */
|
|
1912
|
+
data: PropTypes.any
|
|
1911
1913
|
};
|
|
1912
1914
|
|
|
1913
1915
|
const useTag = color => {
|
|
@@ -2017,6 +2019,7 @@ const ContentBox = props => {
|
|
|
2017
2019
|
headerProps.action = /*#__PURE__*/jsx(MenuButton, {
|
|
2018
2020
|
name: props.title,
|
|
2019
2021
|
menuConfiguration: props.menu,
|
|
2022
|
+
data: props.data || undefined,
|
|
2020
2023
|
displayType: "icon"
|
|
2021
2024
|
});
|
|
2022
2025
|
}
|
|
@@ -2180,6 +2183,8 @@ ContentBox.propTypes = {
|
|
|
2180
2183
|
children: PropTypes.any,
|
|
2181
2184
|
/** Add a menu to the header of the content box. */
|
|
2182
2185
|
menu: PropTypes.any,
|
|
2186
|
+
/** Data fto provide to the menu. */
|
|
2187
|
+
data: PropTypes.any,
|
|
2183
2188
|
/** Adds padding and additional formatting to the content of the content box. */
|
|
2184
2189
|
formatContent: PropTypes.bool,
|
|
2185
2190
|
/** Header for the content box. */
|