@codezee/sixtify-brahma 0.2.159 → 0.2.161

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.159",
3
+ "version": "0.2.161",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/hardikranpariya/sixtify-brahma.git"
@@ -1,4 +1,4 @@
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;
@@ -7,7 +7,9 @@ type RedirectionCellProps = {
7
7
  avatar?: string;
8
8
  includeAvatar?: boolean;
9
9
  disabled?: boolean;
10
+ includeIcon?: boolean;
11
+ icon?: ReactNode;
10
12
  };
11
- export declare const RedirectionCell: ({ mainLabel, onClick, includeSubLabel, subLabel, avatar, includeAvatar, disabled, }: RedirectionCellProps) => import("react/jsx-runtime").JSX.Element;
13
+ export declare const RedirectionCell: ({ mainLabel, onClick, includeSubLabel, subLabel, avatar, includeAvatar, disabled, includeIcon, icon, }: RedirectionCellProps) => import("react/jsx-runtime").JSX.Element;
12
14
  export {};
13
15
  //# 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;AAKnD,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;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,wGAU7B,oBAAoB,4CAsEtB,CAAC"}
@@ -6,7 +6,7 @@ const material_1 = require("@mui/material");
6
6
  const react_1 = require("react");
7
7
  const useCellEnterClick_1 = require("../hooks/useCellEnterClick");
8
8
  const ClickableCell_1 = require("./ClickableCell");
9
- const RedirectionCell = ({ mainLabel, onClick, includeSubLabel = false, subLabel, avatar, includeAvatar = false, disabled = false, }) => {
9
+ const RedirectionCell = ({ mainLabel, onClick, includeSubLabel = false, subLabel, avatar, includeAvatar = false, disabled = false, includeIcon = false, icon, }) => {
10
10
  const theme = (0, material_1.useTheme)();
11
11
  const { butterflyBlue, black } = theme.palette.app.color;
12
12
  const cellRef = (0, react_1.useRef)(null);
@@ -19,13 +19,13 @@ const RedirectionCell = ({ mainLabel, onClick, includeSubLabel = false, subLabel
19
19
  onClick(event);
20
20
  }
21
21
  };
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 ?? "-" }))] })] }) }) }));
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", 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.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 ?? "-" }))] })] }), includeIcon && icon && (0, jsx_runtime_1.jsx)(material_1.Box, { children: icon })] }) }) }));
30
30
  };
31
31
  exports.RedirectionCell = RedirectionCell;
@@ -207,7 +207,7 @@ function Select({ control, defaultValue, name, required = false, label, multiple
207
207
  hasPendingChange.current = false;
208
208
  setPendingValue(null);
209
209
  }
210
- }, inputRef: setInputRef, onKeyDown: (event) => {
210
+ }, inputRef: (el) => setInputRef(el), onKeyDown: (event) => {
211
211
  handleKeyDown(event, () => {
212
212
  setOpen(false);
213
213
  }, open);
@@ -1,6 +1,6 @@
1
1
  export declare function useFormFieldFocus(isOpen?: boolean | undefined): {
2
2
  inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
3
- setInputRef: (ref: HTMLInputElement | null) => void;
3
+ setInputRef: (ref: HTMLDivElement | HTMLInputElement | null) => void;
4
4
  maintainFocus: () => void;
5
5
  maintainFocusAfterClose: () => void;
6
6
  handleKeyDown: <T extends HTMLElement = HTMLElement>(event: React.KeyboardEvent<T>, onClose?: () => void, isPopupOpen?: boolean) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"useFormFieldFocus.d.ts","sourceRoot":"","sources":["../../../src/utils/hooks/useFormFieldFocus.ts"],"names":[],"mappings":"AAEA,wBAAgB,iBAAiB,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS;;uBA8GtB,gBAAgB,GAAG,IAAI;;;oBAf1D,CAAC,SAAS,WAAW,uBACb,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,YACnB,MAAM,IAAI,gBACN,OAAO;EAgD1B"}
1
+ {"version":3,"file":"useFormFieldFocus.d.ts","sourceRoot":"","sources":["../../../src/utils/hooks/useFormFieldFocus.ts"],"names":[],"mappings":"AAEA,wBAAgB,iBAAiB,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS;;uBAgHpD,cAAc,GAAG,gBAAgB,GAAG,IAAI;;;oBAhB7C,CAAC,SAAS,WAAW,uBACb,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,YACnB,MAAM,IAAI,gBACN,OAAO;EAsD1B"}
@@ -9,7 +9,7 @@ function useFormFieldFocus(isOpen) {
9
9
  const blurTimeoutRef = (0, react_1.useRef)(null);
10
10
  const [hasInputElement, setHasInputElement] = (0, react_1.useState)(false);
11
11
  (0, react_1.useEffect)(() => {
12
- const inputElement = inputRef.current;
12
+ const inputElement = inputRef.current instanceof HTMLInputElement ? inputRef.current : null;
13
13
  if (!inputElement) {
14
14
  return;
15
15
  }
@@ -97,7 +97,8 @@ function useFormFieldFocus(isOpen) {
97
97
  setHasInputElement(true);
98
98
  if (wasFocusedRef.current) {
99
99
  requestAnimationFrame(() => {
100
- if (inputRef.current && document.activeElement !== inputRef.current) {
100
+ if (inputRef.current &&
101
+ document.activeElement !== inputRef.current) {
101
102
  inputRef.current.focus();
102
103
  }
103
104
  });