@codezee/sixtify-brahma 0.2.146 → 0.2.147
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
CHANGED
|
@@ -6,7 +6,8 @@ export type ActionButtonsProps = DataProps & {
|
|
|
6
6
|
sx?: SxProps;
|
|
7
7
|
buttonSx?: SxProps;
|
|
8
8
|
shouldOpenMenuOnShortcut?: boolean;
|
|
9
|
+
disable?: boolean;
|
|
9
10
|
shortcutKey?: string;
|
|
10
11
|
};
|
|
11
|
-
export declare function ActionButtons({ buttons, justifyContent, sx, buttonSx, shouldOpenMenuOnShortcut, shortcutKey, }: ActionButtonsProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function ActionButtons({ buttons, justifyContent, sx, buttonSx, shouldOpenMenuOnShortcut, disable, shortcutKey, }: ActionButtonsProps): import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
//# sourceMappingURL=ActionButtons.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionButtons.d.ts","sourceRoot":"","sources":["../../src/ActionButtons/ActionButtons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAKzD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEvD,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG;IAC3C,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,cAAc,CAAC,EAAE,UAAU,CAAC,gBAAgB,CAAC,CAAC;IAC9C,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,cAAsB,EACtB,EAAE,EACF,QAAQ,EACR,wBAAgC,EAChC,WAAiB,GAClB,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"ActionButtons.d.ts","sourceRoot":"","sources":["../../src/ActionButtons/ActionButtons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAKzD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEvD,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG;IAC3C,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,cAAc,CAAC,EAAE,UAAU,CAAC,gBAAgB,CAAC,CAAC;IAC9C,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,cAAsB,EACtB,EAAE,EACF,QAAQ,EACR,wBAAgC,EAChC,OAAe,EACf,WAAiB,GAClB,EAAE,kBAAkB,2CA2IpB"}
|
|
@@ -9,7 +9,7 @@ const material_1 = require("@mui/material");
|
|
|
9
9
|
const noop_1 = __importDefault(require("lodash/noop"));
|
|
10
10
|
const react_1 = require("react");
|
|
11
11
|
const utils_1 = require("../utils");
|
|
12
|
-
function ActionButtons({ buttons, justifyContent = "end", sx, buttonSx, shouldOpenMenuOnShortcut = false, shortcutKey = "a", }) {
|
|
12
|
+
function ActionButtons({ buttons, justifyContent = "end", sx, buttonSx, shouldOpenMenuOnShortcut = false, disable = false, shortcutKey = "a", }) {
|
|
13
13
|
const [anchorEl, setAnchorEl] = (0, react_1.useState)(null);
|
|
14
14
|
const [openMenuKey, setOpenMenuKey] = (0, react_1.useState)(null);
|
|
15
15
|
const buttonRefs = (0, react_1.useRef)({});
|
|
@@ -26,7 +26,7 @@ function ActionButtons({ buttons, justifyContent = "end", sx, buttonSx, shouldOp
|
|
|
26
26
|
key: shortcutKey,
|
|
27
27
|
modifierKeys: ["ctrl", "shift"],
|
|
28
28
|
onTrigger: () => {
|
|
29
|
-
if (shouldOpenMenuOnShortcut) {
|
|
29
|
+
if (shouldOpenMenuOnShortcut && !disable) {
|
|
30
30
|
const buttonWithMenu = buttons.find((button) => !!button.menuItems?.length && !button.hidden);
|
|
31
31
|
if (buttonWithMenu) {
|
|
32
32
|
const buttonElement = buttonRefs.current[buttonWithMenu.key];
|
|
@@ -49,7 +49,7 @@ function ActionButtons({ buttons, justifyContent = "end", sx, buttonSx, shouldOp
|
|
|
49
49
|
...button,
|
|
50
50
|
onClick,
|
|
51
51
|
};
|
|
52
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [button.label ? ((0, jsx_runtime_1.jsx)(material_1.Button, { sx: buttonSx, ...buttonProps, ref: (el) => {
|
|
52
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [button.label ? ((0, jsx_runtime_1.jsx)(material_1.Button, { sx: buttonSx, ...buttonProps, disabled: disable || button.disabled, ref: (el) => {
|
|
53
53
|
buttonRefs.current[key] = el;
|
|
54
54
|
}, children: button.label }, key)) : ((0, jsx_runtime_1.jsx)(material_1.IconButton, { ref: (el) => {
|
|
55
55
|
buttonRefs.current[key] = el;
|