@codezee/sixtify-brahma 0.2.160 → 0.2.162

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codezee/sixtify-brahma",
3
- "version": "0.2.160",
3
+ "version": "0.2.162",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/hardikranpariya/sixtify-brahma.git"
@@ -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,4CAoCpB,CAAC"}
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
- const handleClick = (event) => {
8
- if (disabled) {
9
- return;
10
- }
11
- onClick?.(event);
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",
@@ -1,13 +1,16 @@
1
- import type { MouseEvent } from "react";
1
+ import type { MouseEvent, ReactNode } from "react";
2
2
  type RedirectionCellProps = {
3
3
  mainLabel: string;
4
4
  onClick: (event: MouseEvent<HTMLElement>) => void;
5
5
  includeSubLabel?: boolean;
6
- subLabel?: string;
6
+ isSubLabelClickable?: boolean;
7
+ subLabel?: ReactNode;
7
8
  avatar?: string;
8
9
  includeAvatar?: boolean;
9
10
  disabled?: boolean;
11
+ includeIcon?: boolean;
12
+ icon?: ReactNode;
10
13
  };
11
- export declare const RedirectionCell: ({ mainLabel, onClick, includeSubLabel, subLabel, avatar, includeAvatar, disabled, }: 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;
12
15
  export {};
13
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,MAAM,OAAO,CAAC;AAKxC,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,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,qFAQ7B,oBAAoB,4CAkEtB,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 RedirectionCell = ({ mainLabel, onClick, includeSubLabel = false, subLabel, avatar, includeAvatar = false, disabled = false, }) => {
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: onClick, disabled: disabled, children: (0, jsx_runtime_1.jsx)(material_1.Box, { ref: cellRef, component: "div", onClick: handleClick, sx: { width: "100%" }, children: (0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", gap: "5px", alignItems: "center", sx: { width: "100%" }, 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.Box, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", sx: {
23
- width: "100%",
24
- color: disabled ? black[900] : butterflyBlue[900],
25
- }, onMouseDown: (e) => {
26
- if (!disabled) {
27
- onClick(e);
28
- }
29
- }, children: mainLabel }), includeSubLabel && ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", color: butterflyBlue[400], children: subLabel ?? "-" }))] })] }) }) }));
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: {
27
+ width: "100%",
28
+ color: disabled || isSubLabelClickable
29
+ ? black[900]
30
+ : butterflyBlue[900],
31
+ }, onMouseDown: (e) => {
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) {
43
+ onClick(e);
44
+ }
45
+ }, children: subLabel }))] })] }), includeIcon && icon && (0, jsx_runtime_1.jsx)(material_1.Box, { children: icon })] }) }) }));
30
46
  };
31
47
  exports.RedirectionCell = RedirectionCell;