@codezee/sixtify-brahma 0.2.68 → 0.2.69

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.68",
3
+ "version": "0.2.69",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/hardikranpariya/sixtify-brahma.git"
@@ -1 +1 @@
1
- {"version":3,"file":"CellSelectionTable.d.ts","sourceRoot":"","sources":["../../src/CellSelectionTable/CellSelectionTable.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAGzC,OAAO,EACL,KAAK,UAAU,EACf,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAWf,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAoB,MAAM,eAAe,CAAC;AAEzE,MAAM,MAAM,IAAI,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;AAEzD,MAAM,MAAM,uBAAuB,GAAG;IACpC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,EAAE,YAAY,EAAE,CAAC;IACrB,eAAe,EAAE,CACf,aAAa,EAAE,UAAU,CAAC,SAAS,EAAE,CAAC,EACtC,CAAC,EAAE,UAAU,KACV,IAAI,CAAC;IACV,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;IACxC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;CAC/C,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,oFAQhC,QAAQ,CAAC,uBAAuB,CAAC,4CA6QnC,CAAC"}
1
+ {"version":3,"file":"CellSelectionTable.d.ts","sourceRoot":"","sources":["../../src/CellSelectionTable/CellSelectionTable.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAGzC,OAAO,EACL,KAAK,UAAU,EACf,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAWf,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAoB,MAAM,eAAe,CAAC;AAEzE,MAAM,MAAM,IAAI,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;AAEzD,MAAM,MAAM,uBAAuB,GAAG;IACpC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,EAAE,YAAY,EAAE,CAAC;IACrB,eAAe,EAAE,CACf,aAAa,EAAE,UAAU,CAAC,SAAS,EAAE,CAAC,EACtC,CAAC,EAAE,UAAU,KACV,IAAI,CAAC;IACV,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;IACxC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;CAC/C,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,oFAQhC,QAAQ,CAAC,uBAAuB,CAAC,4CAwRnC,CAAC"}
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.CellSelectionTable = void 0;
8
8
  const jsx_runtime_1 = require("react/jsx-runtime");
9
9
  const material_1 = require("@mui/material");
10
+ const useStickyColumns_1 = require("./hook/useStickyColumns");
10
11
  const groupBy_1 = __importDefault(require("lodash/groupBy"));
11
12
  const uniqBy_1 = __importDefault(require("lodash/uniqBy"));
12
13
  const react_1 = require("react");
@@ -21,6 +22,7 @@ const CellSelectionTable = ({ columns, data, onCellSelection, cellColors, height
21
22
  const anchorRef = (0, react_1.useRef)(null);
22
23
  const hoveringRef = (0, react_1.useRef)(null);
23
24
  const [selectedRanges, setSelectedRanges] = (0, react_1.useState)([]);
25
+ const { stickyMap } = (0, useStickyColumns_1.useStickyColumns)(columns);
24
26
  const selectedSet = (0, react_1.useMemo)(() => {
25
27
  const set = new Set();
26
28
  selectedRanges.flat().forEach((cell) => {
@@ -95,10 +97,11 @@ const CellSelectionTable = ({ columns, data, onCellSelection, cellColors, height
95
97
  padding: "5px",
96
98
  height: "50px",
97
99
  },
98
- }, children: [(0, jsx_runtime_1.jsx)(material_1.TableHead, { children: (0, jsx_runtime_1.jsx)(material_1.TableRow, { children: columns.map(({ key, label, minWidth = "auto", lockPinned = false, align = "left", }) => ((0, jsx_runtime_1.jsx)(material_1.TableCell, { align: align, sx: {
100
+ }, children: [(0, jsx_runtime_1.jsx)(material_1.TableHead, { children: (0, jsx_runtime_1.jsx)(material_1.TableRow, { children: columns.map(({ key, label, minWidth = "auto", lockPinned = false, align = "left", }, ci) => ((0, jsx_runtime_1.jsx)(material_1.TableCell, { align: align, sx: {
99
101
  ...(lockPinned && {
100
- left: 0,
101
- zIndex: 5,
102
+ top: 0,
103
+ left: stickyMap.has(ci) ? stickyMap.get(ci) : 0,
104
+ zIndex: 10,
102
105
  position: "sticky",
103
106
  }),
104
107
  backgroundColor: slate[700],
@@ -113,9 +116,12 @@ const CellSelectionTable = ({ columns, data, onCellSelection, cellColors, height
113
116
  : (0, helper_1.getCellValue)(cell, "cellTooltip");
114
117
  const getColor = (0, helper_1.getCellValue)(cell, "cellBackgroundConditionKey");
115
118
  const cellActive = (0, helper_1.getCellValue)(cell, "cellActive");
119
+ const isSticky = stickyMap.has(ci);
120
+ const left = isSticky ? stickyMap.get(ci) : 0;
116
121
  return ((0, jsx_runtime_1.jsx)(material_1.TableCell, { align: align, sx: {
117
122
  ...(lockPinned && {
118
- left: 0,
123
+ top: 0,
124
+ left,
119
125
  zIndex: 5,
120
126
  position: "sticky",
121
127
  }),
@@ -0,0 +1,12 @@
1
+ import type { Column } from "../utils";
2
+ type ParsedColumn = Column & {
3
+ idx: number;
4
+ parsedMinWidth: number;
5
+ };
6
+ type UseStickyColumnsResult = {
7
+ parsedColumns: ParsedColumn[];
8
+ stickyMap: Map<number, number>;
9
+ };
10
+ export declare const useStickyColumns: (columns: Column[]) => UseStickyColumnsResult;
11
+ export {};
12
+ //# sourceMappingURL=useStickyColumns.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStickyColumns.d.ts","sourceRoot":"","sources":["../../../src/CellSelectionTable/hook/useStickyColumns.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,KAAK,YAAY,GAAG,MAAM,GAAG;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,KAAK,sBAAsB,GAAG;IAC5B,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC,CAAC;AAYF,eAAO,MAAM,gBAAgB,GAAI,SAAS,MAAM,EAAE,KAAG,sBA4BpD,CAAC"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.useStickyColumns = void 0;
7
+ const isNaN_1 = __importDefault(require("lodash/isNaN"));
8
+ const isNumber_1 = __importDefault(require("lodash/isNumber"));
9
+ const parseInt_1 = __importDefault(require("lodash/parseInt"));
10
+ const react_1 = require("react");
11
+ const parseMinWidth = (minWidth) => {
12
+ if ((0, isNumber_1.default)(minWidth)) {
13
+ return minWidth;
14
+ }
15
+ const parsed = (0, parseInt_1.default)((minWidth ?? "36").replace("px", ""));
16
+ return (0, isNaN_1.default)(parsed) ? 36 : parsed;
17
+ };
18
+ const useStickyColumns = (columns) => {
19
+ return (0, react_1.useMemo)(() => {
20
+ const { parsedColumns, stickyMap } = columns.reduce((acc, col, idx) => {
21
+ const parsedMinWidth = parseMinWidth(col.minWidth);
22
+ const parsedCol = { ...col, idx, parsedMinWidth };
23
+ acc.parsedColumns.push(parsedCol);
24
+ if (col.lockPinned) {
25
+ acc.stickyMap.set(idx, acc.offset);
26
+ acc.offset += parsedMinWidth;
27
+ }
28
+ return acc;
29
+ }, {
30
+ parsedColumns: [],
31
+ stickyMap: new Map(),
32
+ offset: 0,
33
+ });
34
+ return { parsedColumns, stickyMap };
35
+ }, [columns]);
36
+ };
37
+ exports.useStickyColumns = useStickyColumns;
@@ -0,0 +1,3 @@
1
+ import type { SVGProps } from "react";
2
+ export declare const MasterIcon: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=MasterIcon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MasterIcon.d.ts","sourceRoot":"","sources":["../../../src/Svgs/Drawer/MasterIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEtC,eAAO,MAAM,UAAU,GAAI,OAAO,QAAQ,CAAC,aAAa,CAAC,4CAqBxD,CAAC"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MasterIcon = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const MasterIcon = (props) => ((0, jsx_runtime_1.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", width: 20, height: 20, fill: "none", ...props, style: { color: "inherit" }, children: [(0, jsx_runtime_1.jsx)("g", { clipPath: "url(#clip0_2088_3743)", children: (0, jsx_runtime_1.jsx)("path", { d: "M20 15.4167V17.0833C20 18.6917 18.6917 20 17.0833 20H2.91667C1.30833 20 0 18.6917 0 17.0833V15.4167C0 13.8083 1.30833 12.5 2.91667 12.5H4.58333C5.04417 12.5 5.41667 12.8725 5.41667 13.3333C5.41667 13.7942 5.04417 14.1667 4.58333 14.1667H2.91667C2.2275 14.1667 1.66667 14.7275 1.66667 15.4167V17.0833C1.66667 17.7725 2.2275 18.3333 2.91667 18.3333H17.0833C17.7725 18.3333 18.3333 17.7725 18.3333 17.0833V15.4167C18.3333 14.7275 17.7725 14.1667 17.0833 14.1667H15.4167C14.9558 14.1667 14.5833 13.7942 14.5833 13.3333C14.5833 12.8725 14.9558 12.5 15.4167 12.5H17.0833C18.6917 12.5 20 13.8083 20 15.4167ZM20 2.91667V3.75C20 5.35833 18.6917 6.66667 17.0833 6.66667H16.6667V7.5C16.6667 8.87833 15.545 10 14.1667 10H10.8333V12.8292L11.9125 11.7508C12.2383 11.425 12.765 11.425 13.0908 11.7508C13.4167 12.0767 13.4167 12.6033 13.0908 12.9292L11.0283 14.9925C10.4617 15.5583 9.54167 15.5592 8.975 14.9925L6.91167 12.9292C6.58583 12.6033 6.58583 12.0767 6.91167 11.7508C7.2375 11.425 7.76417 11.425 8.09 11.7508L9.16667 12.8275V9.99917H5.83333C4.455 9.99917 3.33333 8.8775 3.33333 7.49917V6.66583H2.91667C1.30833 6.66583 0 5.3575 0 3.74917V2.91583C0 1.30833 1.30833 0 2.91667 0H5.41667C7.025 0 8.33333 1.30833 8.33333 2.91667V3.75C8.33333 5.35833 7.025 6.66667 5.41667 6.66667H5V7.5C5 7.95917 5.37333 8.33333 5.83333 8.33333H14.1667C14.6267 8.33333 15 7.95917 15 7.5V6.66667H14.5833C12.975 6.66667 11.6667 5.35833 11.6667 3.75V2.91667C11.6667 1.30833 12.975 0 14.5833 0H17.0833C18.6917 0 20 1.30833 20 2.91667ZM5.41667 5C6.10583 5 6.66667 4.43917 6.66667 3.75V2.91667C6.66667 2.2275 6.10583 1.66667 5.41667 1.66667H2.91667C2.2275 1.66667 1.66667 2.2275 1.66667 2.91667V3.75C1.66667 4.43917 2.2275 5 2.91667 5H5.41667ZM18.3333 2.91667C18.3333 2.2275 17.7725 1.66667 17.0833 1.66667H14.5833C13.8942 1.66667 13.3333 2.2275 13.3333 2.91667V3.75C13.3333 4.43917 13.8942 5 14.5833 5H17.0833C17.7725 5 18.3333 4.43917 18.3333 3.75V2.91667Z", fill: props.fill ?? "currentColor" }) }), (0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsx)("clipPath", { id: "clip0_2088_3743", children: (0, jsx_runtime_1.jsx)("rect", { width: "20", height: "20", fill: props.fill ?? "currentColor" }) }) })] }));
6
+ exports.MasterIcon = MasterIcon;
@@ -1,8 +1,9 @@
1
+ export * from "./MasterIcon";
1
2
  export * from "./SettingIcon";
2
3
  export * from "./SvgBankConfig";
3
4
  export * from "./SvgConfiguration";
4
- export * from "./SvgPayroll";
5
5
  export * from "./SvgEmployees";
6
6
  export * from "./SvgOrganization";
7
+ export * from "./SvgPayroll";
7
8
  export * from "./SvgTransaction";
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Svgs/Drawer/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Svgs/Drawer/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC"}
@@ -14,10 +14,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./MasterIcon"), exports);
17
18
  __exportStar(require("./SettingIcon"), exports);
18
19
  __exportStar(require("./SvgBankConfig"), exports);
19
20
  __exportStar(require("./SvgConfiguration"), exports);
20
- __exportStar(require("./SvgPayroll"), exports);
21
21
  __exportStar(require("./SvgEmployees"), exports);
22
22
  __exportStar(require("./SvgOrganization"), exports);
23
+ __exportStar(require("./SvgPayroll"), exports);
23
24
  __exportStar(require("./SvgTransaction"), exports);