@codezee/sixtify-brahma 0.2.161 → 0.2.163
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/packages/shared-components/dist/ActionButtons/FormActionButton.d.ts.map +1 -1
- package/packages/shared-components/dist/ActionButtons/FormActionButton.js +12 -9
- package/packages/shared-components/dist/AgGrid/RedirectionCell/ClickableCell.d.ts.map +1 -1
- package/packages/shared-components/dist/AgGrid/RedirectionCell/ClickableCell.js +5 -13
- package/packages/shared-components/dist/AgGrid/RedirectionCell/RedirectionCell.d.ts +3 -2
- package/packages/shared-components/dist/AgGrid/RedirectionCell/RedirectionCell.d.ts.map +1 -1
- package/packages/shared-components/dist/AgGrid/RedirectionCell/RedirectionCell.js +22 -6
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormActionButton.d.ts","sourceRoot":"","sources":["../../src/ActionButtons/FormActionButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEhE,KAAK,qBAAqB,GAAG,WAAW,GAAG;IACzC,OAAO,EAAE,QAAQ,CAAC;CACnB,GAAG,OAAO,CAAC;IACR,UAAU,EAAE,oBAAoB,CAAC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,uBAAuB,EAAE,OAAO,CAAC;CAClC,CAAC,CAAC;AAEL,eAAO,MAAM,gBAAgB,GAAI,6HAW9B,QAAQ,CAAC,qBAAqB,CAAC,
|
|
1
|
+
{"version":3,"file":"FormActionButton.d.ts","sourceRoot":"","sources":["../../src/ActionButtons/FormActionButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEhE,KAAK,qBAAqB,GAAG,WAAW,GAAG;IACzC,OAAO,EAAE,QAAQ,CAAC;CACnB,GAAG,OAAO,CAAC;IACR,UAAU,EAAE,oBAAoB,CAAC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,uBAAuB,EAAE,OAAO,CAAC;CAClC,CAAC,CAAC;AAEL,eAAO,MAAM,gBAAgB,GAAI,6HAW9B,QAAQ,CAAC,qBAAqB,CAAC,4CAuDjC,CAAC"}
|
|
@@ -26,16 +26,19 @@ const FormActionButton = ({ actionType, onClick, shortcutKey, label, withoutModi
|
|
|
26
26
|
}
|
|
27
27
|
return "Save";
|
|
28
28
|
};
|
|
29
|
-
(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
if (!disableKeyboardShortcut) {
|
|
30
|
+
(0, utils_1.useGlobalKeyboardShortcut)({
|
|
31
|
+
key: getShortcutKey(),
|
|
32
|
+
withoutModifiers: actionType == "cancel" ? true : withoutModifiers,
|
|
33
|
+
modifierKeys: actionType != "cancel" ? ["ctrl", "shift"] : undefined,
|
|
34
|
+
onTrigger: () => {
|
|
35
|
+
if (disabled || loading) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
35
38
|
onClick();
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
}
|
|
39
42
|
return ((0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: onClick, variant: variant, loading: loading, disabled: disabled, ...rest, children: getLabel() }));
|
|
40
43
|
};
|
|
41
44
|
exports.FormActionButton = FormActionButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClickableCell.d.ts","sourceRoot":"","sources":["../../../src/AgGrid/RedirectionCell/ClickableCell.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEnD,KAAK,kBAAkB,GAAG;IACxB,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACnD,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,8DAO3B,kBAAkB,
|
|
1
|
+
{"version":3,"file":"ClickableCell.d.ts","sourceRoot":"","sources":["../../../src/AgGrid/RedirectionCell/ClickableCell.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEnD,KAAK,kBAAkB,GAAG;IACxB,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACnD,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,8DAO3B,kBAAkB,4CA2BpB,CAAC"}
|
|
@@ -4,19 +4,11 @@ exports.ClickableCell = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const material_1 = require("@mui/material");
|
|
6
6
|
const ClickableCell = ({ children, onClick, onMouseDown, disabled = false, className, sx, }) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
-
const handleMouseDown = (event) => {
|
|
14
|
-
if (disabled) {
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
onMouseDown?.(event);
|
|
18
|
-
};
|
|
19
|
-
return ((0, jsx_runtime_1.jsx)(material_1.Box, { component: "div", "data-clickable": !disabled ? "true" : undefined, onClick: onClick ? handleClick : undefined, onMouseDown: onMouseDown ? handleMouseDown : undefined, className: className, sx: {
|
|
7
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Box, { component: "div", "data-clickable": !disabled ? "true" : undefined, onClick: (e) => e.preventDefault(), onMouseDown: (e) => e.preventDefault(), onKeyDown: (e) => {
|
|
8
|
+
if (!disabled && (e.key === "Enter" || e.key === " ")) {
|
|
9
|
+
onClick?.(e);
|
|
10
|
+
}
|
|
11
|
+
}, tabIndex: disabled ? -1 : 0, role: "button", className: className, sx: {
|
|
20
12
|
width: "100%",
|
|
21
13
|
height: "100%",
|
|
22
14
|
display: "flex",
|
|
@@ -3,13 +3,14 @@ type RedirectionCellProps = {
|
|
|
3
3
|
mainLabel: string;
|
|
4
4
|
onClick: (event: MouseEvent<HTMLElement>) => void;
|
|
5
5
|
includeSubLabel?: boolean;
|
|
6
|
-
|
|
6
|
+
isSubLabelClickable?: boolean;
|
|
7
|
+
subLabel?: ReactNode;
|
|
7
8
|
avatar?: string;
|
|
8
9
|
includeAvatar?: boolean;
|
|
9
10
|
disabled?: boolean;
|
|
10
11
|
includeIcon?: boolean;
|
|
11
12
|
icon?: ReactNode;
|
|
12
13
|
};
|
|
13
|
-
export declare const RedirectionCell: ({ mainLabel, onClick, includeSubLabel, subLabel, avatar, includeAvatar, disabled, includeIcon, icon, }: RedirectionCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const RedirectionCell: ({ mainLabel, onClick, includeSubLabel, isSubLabelClickable, subLabel, avatar, includeAvatar, disabled, includeIcon, icon, }: RedirectionCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
15
|
export {};
|
|
15
16
|
//# sourceMappingURL=RedirectionCell.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RedirectionCell.d.ts","sourceRoot":"","sources":["../../../src/AgGrid/RedirectionCell/RedirectionCell.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"RedirectionCell.d.ts","sourceRoot":"","sources":["../../../src/AgGrid/RedirectionCell/RedirectionCell.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMnD,KAAK,oBAAoB,GAAG;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAClD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,6HAW7B,oBAAoB,4CA0FtB,CAAC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.RedirectionCell = void 0;
|
|
4
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
@@ -6,7 +9,8 @@ const material_1 = require("@mui/material");
|
|
|
6
9
|
const react_1 = require("react");
|
|
7
10
|
const useCellEnterClick_1 = require("../hooks/useCellEnterClick");
|
|
8
11
|
const ClickableCell_1 = require("./ClickableCell");
|
|
9
|
-
const
|
|
12
|
+
const isFunction_1 = __importDefault(require("lodash/isFunction"));
|
|
13
|
+
const RedirectionCell = ({ mainLabel, onClick, includeSubLabel = false, isSubLabelClickable = false, subLabel, avatar, includeAvatar = false, disabled = false, includeIcon = false, icon, }) => {
|
|
10
14
|
const theme = (0, material_1.useTheme)();
|
|
11
15
|
const { butterflyBlue, black } = theme.palette.app.color;
|
|
12
16
|
const cellRef = (0, react_1.useRef)(null);
|
|
@@ -15,17 +19,29 @@ const RedirectionCell = ({ mainLabel, onClick, includeSubLabel = false, subLabel
|
|
|
15
19
|
disabled,
|
|
16
20
|
});
|
|
17
21
|
const handleClick = (event) => {
|
|
18
|
-
if (!disabled) {
|
|
22
|
+
if (!disabled && (0, isFunction_1.default)(onClick)) {
|
|
19
23
|
onClick(event);
|
|
20
24
|
}
|
|
21
25
|
};
|
|
22
|
-
return ((0, jsx_runtime_1.jsx)(ClickableCell_1.ClickableCell, { onClick:
|
|
26
|
+
return ((0, jsx_runtime_1.jsx)(ClickableCell_1.ClickableCell, { onClick: handleClick, disabled: disabled, children: (0, jsx_runtime_1.jsx)(material_1.Box, { ref: cellRef, component: "div", sx: { width: "100%" }, children: (0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", alignItems: "center", justifyContent: "space-between", sx: { width: "100%" }, children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", gap: "5px", alignItems: "center", children: [includeAvatar && ((0, jsx_runtime_1.jsx)(material_1.Avatar, { src: avatar ?? "", alt: "Photo", sx: { width: 28, height: 28 } })), (0, jsx_runtime_1.jsxs)(material_1.Stack, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", sx: {
|
|
23
27
|
width: "100%",
|
|
24
|
-
color: disabled
|
|
28
|
+
color: disabled || isSubLabelClickable
|
|
29
|
+
? black[900]
|
|
30
|
+
: butterflyBlue[900],
|
|
25
31
|
}, onMouseDown: (e) => {
|
|
26
|
-
if (!disabled
|
|
32
|
+
if (!disabled &&
|
|
33
|
+
!isSubLabelClickable &&
|
|
34
|
+
(0, isFunction_1.default)(onClick)) {
|
|
35
|
+
onClick(e);
|
|
36
|
+
}
|
|
37
|
+
}, children: mainLabel }), includeSubLabel && typeof subLabel === "string" ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", color: !isSubLabelClickable ? black[900] : butterflyBlue[900], onMouseDown: (e) => {
|
|
38
|
+
if (!disabled && isSubLabelClickable) {
|
|
39
|
+
onClick(e);
|
|
40
|
+
}
|
|
41
|
+
}, children: subLabel ?? "-" })) : ((0, jsx_runtime_1.jsx)(material_1.Stack, { onClick: (e) => {
|
|
42
|
+
if (!disabled && isSubLabelClickable) {
|
|
27
43
|
onClick(e);
|
|
28
44
|
}
|
|
29
|
-
}, children:
|
|
45
|
+
}, children: subLabel }))] })] }), includeIcon && icon && (0, jsx_runtime_1.jsx)(material_1.Box, { children: icon })] }) }) }));
|
|
30
46
|
};
|
|
31
47
|
exports.RedirectionCell = RedirectionCell;
|