@codezee/sixtify-brahma 0.2.140 → 0.2.142

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.140",
3
+ "version": "0.2.142",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/hardikranpariya/sixtify-brahma.git"
@@ -1,31 +1,12 @@
1
1
  import type { ColDef, RowSelectionOptions } from "ag-grid-community";
2
- type UseAgGridRowSelectionConfigArgs = {
3
- columnDefs: ColDef[];
2
+ type UseAgGridRowSelectionConfigArgs<TData> = {
3
+ columnDefs: ColDef<TData>[];
4
4
  enableClickSelection?: boolean;
5
- isRowSelectable?: RowSelectionOptions["isRowSelectable"];
5
+ isRowSelectable?: RowSelectionOptions<TData>["isRowSelectable"];
6
6
  };
7
- export declare const useAgGridRowSelectionConfig: ({ columnDefs, enableClickSelection, isRowSelectable, }: UseAgGridRowSelectionConfigArgs) => {
8
- rowSelection: RowSelectionOptions | undefined;
9
- selectionColumnDef: {
10
- headerName: string;
11
- width: number;
12
- minWidth: number;
13
- maxWidth: number;
14
- pinned: "left";
15
- lockPinned: boolean;
16
- lockPosition: boolean;
17
- suppressMovable: boolean;
18
- suppressHeaderMenuButton: boolean;
19
- suppressHeaderContextMenu: boolean;
20
- suppressSizeToFit: boolean;
21
- resizable: boolean;
22
- sortable: boolean;
23
- filter: boolean;
24
- suppressHeaderKeyboardEvent: () => true;
25
- suppressKeyboardEvent: () => true;
26
- headerComponent: () => null;
27
- cellRenderer: () => null;
28
- } | undefined;
7
+ export declare const useAgGridRowSelectionConfig: <TData>({ columnDefs, enableClickSelection, isRowSelectable, }: UseAgGridRowSelectionConfigArgs<TData>) => {
8
+ rowSelection: RowSelectionOptions<TData> | undefined;
9
+ selectionColumnDef: import("ag-grid-community").SelectionColumnDef | undefined;
29
10
  };
30
11
  export {};
31
12
  //# sourceMappingURL=useAgGridRowSelectionConfig.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useAgGridRowSelectionConfig.d.ts","sourceRoot":"","sources":["../../../src/AgGrid/hooks/useAgGridRowSelectionConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAGrE,KAAK,+BAA+B,GAAG;IACrC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,eAAe,CAAC,EAAE,mBAAmB,CAAC,iBAAiB,CAAC,CAAC;CAC1D,CAAC;AAEF,eAAO,MAAM,2BAA2B,GAAI,wDAIzC,+BAA+B;;;;;;;;;;;;;;;;;;;;;;CAmDjC,CAAC"}
1
+ {"version":3,"file":"useAgGridRowSelectionConfig.d.ts","sourceRoot":"","sources":["../../../src/AgGrid/hooks/useAgGridRowSelectionConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EAEN,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAG3B,KAAK,+BAA+B,CAAC,KAAK,IAAI;IAC5C,UAAU,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;IAC5B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,eAAe,CAAC,EAAE,mBAAmB,CAAC,KAAK,CAAC,CAAC,iBAAiB,CAAC,CAAC;CACjE,CAAC;AAEF,eAAO,MAAM,2BAA2B,GAAI,KAAK,EAAE,wDAIhD,+BAA+B,CAAC,KAAK,CAAC;;;CAsExC,CAAC"}
@@ -4,19 +4,28 @@ exports.useAgGridRowSelectionConfig = void 0;
4
4
  const react_1 = require("react");
5
5
  const useAgGridRowSelectionConfig = ({ columnDefs, enableClickSelection = false, isRowSelectable, }) => {
6
6
  const hasCustomCheckboxColumn = (0, react_1.useMemo)(() => {
7
- return columnDefs.some((col) => {
8
- return !!col["checkboxSelection"];
7
+ return columnDefs.some((colDef) => {
8
+ const checkboxSelection = colDef["checkboxSelection"];
9
+ const hasCheckboxSelection = !!checkboxSelection;
10
+ const hasCustomHeaderOnId = colDef.field != null &&
11
+ String(colDef.field) === "id" &&
12
+ colDef.headerComponent != null;
13
+ return hasCheckboxSelection || hasCustomHeaderOnId;
9
14
  });
10
15
  }, [columnDefs]);
11
16
  const rowSelection = (0, react_1.useMemo)(() => {
12
17
  if (!hasCustomCheckboxColumn) {
13
18
  return undefined;
14
19
  }
20
+ const hasSelectableRows = Boolean(isRowSelectable);
15
21
  return {
16
22
  mode: "multiRow",
17
23
  enableClickSelection,
18
- checkboxes: false,
19
- ...(isRowSelectable && { isRowSelectable }),
24
+ checkboxes: hasSelectableRows,
25
+ ...(isRowSelectable && {
26
+ isRowSelectable,
27
+ hideDisabledCheckboxes: true,
28
+ }),
20
29
  };
21
30
  }, [hasCustomCheckboxColumn, enableClickSelection, isRowSelectable]);
22
31
  const selectionColumnDef = (0, react_1.useMemo)(() => {
@@ -0,0 +1,2 @@
1
+ export declare const extractPrefixedValue: (value?: string | null) => string;
2
+ //# sourceMappingURL=extractPrefixedValue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractPrefixedValue.d.ts","sourceRoot":"","sources":["../../../src/AgGrid/utils/extractPrefixedValue.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,GAAI,QAAQ,MAAM,GAAG,IAAI,KAAG,MAe5D,CAAC"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.extractPrefixedValue = void 0;
4
+ const extractPrefixedValue = (value) => {
5
+ if (!value) {
6
+ return "-";
7
+ }
8
+ const valueStr = String(value);
9
+ const parts = valueStr.split(".");
10
+ const extracted = parts.length > 1
11
+ ? (parts[parts.length - 1] ?? valueStr ?? "")
12
+ : (valueStr ?? "");
13
+ return extracted === "null" || extracted === "" ? "-" : extracted;
14
+ };
15
+ exports.extractPrefixedValue = extractPrefixedValue;
@@ -1,2 +1,3 @@
1
1
  export * from "./ag-grid-custom-filter";
2
+ export * from "./extractPrefixedValue";
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/AgGrid/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/AgGrid/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC"}
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./ag-grid-custom-filter"), exports);
18
+ __exportStar(require("./extractPrefixedValue"), exports);