@genesislcap/grid-tabulator 14.281.1 → 14.282.0

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.
Files changed (38) hide show
  1. package/dist/custom-elements.json +57 -7
  2. package/dist/dts/cell-formatters/action.formatter.d.ts +5 -5
  3. package/dist/dts/cell-formatters/action.formatter.d.ts.map +1 -1
  4. package/dist/dts/cell-formatters/actions-menu.formatter.d.ts +10 -7
  5. package/dist/dts/cell-formatters/actions-menu.formatter.d.ts.map +1 -1
  6. package/dist/dts/cell-formatters/boolean.formatter.d.ts +4 -4
  7. package/dist/dts/cell-formatters/boolean.formatter.d.ts.map +1 -1
  8. package/dist/dts/cell-formatters/editable.formatter.d.ts +4 -4
  9. package/dist/dts/cell-formatters/editable.formatter.d.ts.map +1 -1
  10. package/dist/dts/cell-formatters/select.formatter.d.ts +14 -8
  11. package/dist/dts/cell-formatters/select.formatter.d.ts.map +1 -1
  12. package/dist/dts/cell-formatters/text.formatter.d.ts +3 -3
  13. package/dist/dts/cell-formatters/text.formatter.d.ts.map +1 -1
  14. package/dist/dts/types.d.ts +1 -0
  15. package/dist/dts/types.d.ts.map +1 -1
  16. package/dist/dts/utils/index.d.ts +1 -0
  17. package/dist/dts/utils/index.d.ts.map +1 -1
  18. package/dist/dts/utils/test-id-utils.d.ts +10 -0
  19. package/dist/dts/utils/test-id-utils.d.ts.map +1 -0
  20. package/dist/esm/cell-formatters/action.formatter.js +4 -2
  21. package/dist/esm/cell-formatters/actions-menu.formatter.js +11 -4
  22. package/dist/esm/cell-formatters/boolean.formatter.js +3 -1
  23. package/dist/esm/cell-formatters/editable.formatter.js +4 -1
  24. package/dist/esm/cell-formatters/select.formatter.js +170 -21
  25. package/dist/esm/cell-formatters/text.formatter.js +4 -1
  26. package/dist/esm/utils/index.js +1 -0
  27. package/dist/esm/utils/test-id-utils.js +15 -0
  28. package/dist/grid-tabulator.api.json +193 -43
  29. package/dist/grid-tabulator.d.ts +48 -28
  30. package/docs/api/grid-tabulator.actionformatter.md +2 -2
  31. package/docs/api/grid-tabulator.actionsmenuformatter.md +2 -2
  32. package/docs/api/grid-tabulator.booleanformatter.md +2 -2
  33. package/docs/api/grid-tabulator.editableformatter.md +2 -2
  34. package/docs/api/grid-tabulator.md +1 -1
  35. package/docs/api/grid-tabulator.selectformatter.md +4 -4
  36. package/docs/api/grid-tabulator.textformatter.md +2 -2
  37. package/docs/api-report.md +32 -24
  38. package/package.json +13 -13
@@ -2960,7 +2960,7 @@
2960
2960
  "name": "formatterParams",
2961
2961
  "default": "{}",
2962
2962
  "type": {
2963
- "text": "ActionFormatterParams"
2963
+ "text": "ActionFormatterParams<T>"
2964
2964
  },
2965
2965
  "description": "Action formatter parameters"
2966
2966
  }
@@ -3004,7 +3004,7 @@
3004
3004
  "name": "formatterParams",
3005
3005
  "default": "{}",
3006
3006
  "type": {
3007
- "text": "ActionsMenuFormatterParams"
3007
+ "text": "ActionsMenuFormatterParams<T>"
3008
3008
  },
3009
3009
  "description": "Actions menu formatter parameters"
3010
3010
  }
@@ -3048,7 +3048,7 @@
3048
3048
  "name": "formatterParams",
3049
3049
  "default": "{}",
3050
3050
  "type": {
3051
- "text": "BooleanFormatterParams"
3051
+ "text": "BooleanFormatterParams<T>"
3052
3052
  },
3053
3053
  "description": "Boolean formatter parameters"
3054
3054
  }
@@ -3098,7 +3098,7 @@
3098
3098
  "name": "formatterParams",
3099
3099
  "default": "{}",
3100
3100
  "type": {
3101
- "text": "EditableFormatterParams"
3101
+ "text": "EditableFormatterParams<T>"
3102
3102
  },
3103
3103
  "description": "Editable formatter parameters"
3104
3104
  }
@@ -3270,12 +3270,12 @@
3270
3270
  {
3271
3271
  "name": "formatterParams",
3272
3272
  "type": {
3273
- "text": "SelectFormatterParams"
3273
+ "text": "SelectFormatterParams<T>"
3274
3274
  },
3275
3275
  "description": "Select formatter parameters"
3276
3276
  }
3277
3277
  ],
3278
- "description": "Formatter that displays a value from a select list of options\nStyled to match grid-pro select renderer.",
3278
+ "description": "Formatter that displays a select component with options.\nReturns a wrapped div containing the select, similar to boolean.formatter.",
3279
3279
  "privacy": "public"
3280
3280
  }
3281
3281
  ],
@@ -3314,7 +3314,7 @@
3314
3314
  "name": "formatterParams",
3315
3315
  "default": "{}",
3316
3316
  "type": {
3317
- "text": "TextFormatterParams"
3317
+ "text": "TextFormatterParams<T>"
3318
3318
  },
3319
3319
  "description": "Text formatter parameters"
3320
3320
  }
@@ -4700,6 +4700,14 @@
4700
4700
  "name": "*",
4701
4701
  "package": "./string-utils"
4702
4702
  }
4703
+ },
4704
+ {
4705
+ "kind": "js",
4706
+ "name": "*",
4707
+ "declaration": {
4708
+ "name": "*",
4709
+ "package": "./test-id-utils"
4710
+ }
4703
4711
  }
4704
4712
  ]
4705
4713
  },
@@ -4793,6 +4801,48 @@
4793
4801
  }
4794
4802
  }
4795
4803
  ]
4804
+ },
4805
+ {
4806
+ "kind": "javascript-module",
4807
+ "path": "src/utils/test-id-utils.ts",
4808
+ "declarations": [
4809
+ {
4810
+ "kind": "function",
4811
+ "name": "getDataTestId",
4812
+ "return": {
4813
+ "type": {
4814
+ "text": ""
4815
+ }
4816
+ },
4817
+ "parameters": [
4818
+ {
4819
+ "name": "dataTestId",
4820
+ "type": {
4821
+ "text": "((rowData: T) => string) | string | undefined"
4822
+ },
4823
+ "description": "The dataTestId value (string or function)"
4824
+ },
4825
+ {
4826
+ "name": "rowData",
4827
+ "type": {
4828
+ "text": "T"
4829
+ },
4830
+ "description": "The row data to pass to the function if dataTestId is a function"
4831
+ }
4832
+ ],
4833
+ "description": "Resolves a dataTestId value that can be either a string or a function"
4834
+ }
4835
+ ],
4836
+ "exports": [
4837
+ {
4838
+ "kind": "js",
4839
+ "name": "getDataTestId",
4840
+ "declaration": {
4841
+ "name": "getDataTestId",
4842
+ "module": "src/utils/test-id-utils.ts"
4843
+ }
4844
+ }
4845
+ ]
4796
4846
  }
4797
4847
  ]
4798
4848
  }
@@ -21,12 +21,12 @@
21
21
  *
22
22
  * @alpha
23
23
  */
24
- export interface ActionFormatterParams {
25
- actionClick?: (rowData: any) => void;
24
+ export interface ActionFormatterParams<T = any> {
25
+ actionClick?: (rowData: T) => void;
26
26
  actionName?: string;
27
27
  appearance?: string;
28
- dataTestId?: string;
29
- isDisabled?: (rowData: any) => boolean;
28
+ dataTestId?: ((rowData: T) => string) | string;
29
+ isDisabled?: (rowData: T) => boolean;
30
30
  uniqueFieldName?: string;
31
31
  prefix?: string;
32
32
  actionButtonStyle?: string;
@@ -41,5 +41,5 @@ export interface ActionFormatterParams {
41
41
  * @returns HTML content for the action button
42
42
  * @public
43
43
  */
44
- export declare function actionFormatter(cell: any, formatterParams?: ActionFormatterParams): string;
44
+ export declare function actionFormatter<T = any>(cell: any, formatterParams?: ActionFormatterParams<T>): string;
45
45
  //# sourceMappingURL=action.formatter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"action.formatter.d.ts","sourceRoot":"","sources":["../../../src/cell-formatters/action.formatter.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,qBAAqB;IACpC,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,CAAC;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,OAAO,CAAC;IACvC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,GAAG,EAAE,eAAe,GAAE,qBAA0B,GAAG,MAAM,CAgF9F"}
1
+ {"version":3,"file":"action.formatter.d.ts","sourceRoot":"","sources":["../../../src/cell-formatters/action.formatter.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,qBAAqB,CAAC,CAAC,GAAG,GAAG;IAC5C,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,IAAI,CAAC;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,KAAK,MAAM,CAAC,GAAG,MAAM,CAAC;IAC/C,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,OAAO,CAAC;IACrC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,CAAC,GAAG,GAAG,EACrC,IAAI,EAAE,GAAG,EACT,eAAe,GAAE,qBAAqB,CAAC,CAAC,CAAM,GAC7C,MAAM,CAiFR"}
@@ -11,10 +11,10 @@
11
11
  *
12
12
  * @alpha
13
13
  */
14
- export interface MenuItemAction {
14
+ export interface MenuItemAction<T = any> {
15
15
  label: string;
16
- action: (rowData: any) => void;
17
- isDisabled?: (rowData: any) => boolean;
16
+ action: (rowData: T) => void;
17
+ isDisabled?: (rowData: T) => boolean;
18
18
  icon?: string;
19
19
  cssClass?: string;
20
20
  }
@@ -31,18 +31,21 @@ export interface MenuItemAction {
31
31
  *
32
32
  * `buttonAppearance`: Optional appearance for the button that opens the menu.
33
33
  *
34
+ * `dataTestId`: Data test ID for testing
35
+ *
34
36
  * @alpha
35
37
  */
36
- export interface ActionsMenuFormatterParams {
38
+ export interface ActionsMenuFormatterParams<T = any> {
37
39
  actions?: Array<{
38
40
  name: string;
39
- callback: (rowData: any) => void;
40
- isDisabled?: (rowData: any) => boolean;
41
+ callback: (rowData: T) => void;
42
+ isDisabled?: (rowData: T) => boolean;
41
43
  }>;
42
44
  prefix?: string;
43
45
  menuName?: string;
44
46
  isVertical?: boolean;
45
47
  buttonAppearance?: string;
48
+ dataTestId?: ((rowData: T) => string) | string;
46
49
  }
47
50
  /**
48
51
  * Formatter that displays a dropdown menu of actions in the cell.
@@ -53,5 +56,5 @@ export interface ActionsMenuFormatterParams {
53
56
  * @returns HTML content for the actions menu
54
57
  * @public
55
58
  */
56
- export declare function actionsMenuFormatter(cell: any, formatterParams?: ActionsMenuFormatterParams): string;
59
+ export declare function actionsMenuFormatter<T = any>(cell: any, formatterParams?: ActionsMenuFormatterParams<T>): string;
57
60
  //# sourceMappingURL=actions-menu.formatter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"actions-menu.formatter.d.ts","sourceRoot":"","sources":["../../../src/cell-formatters/actions-menu.formatter.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,OAAO,CAAC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,0BAA0B;IACzC,OAAO,CAAC,EAAE,KAAK,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,CAAC;QACjC,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,OAAO,CAAC;KACxC,CAAC,CAAC;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,GAAG,EACT,eAAe,GAAE,0BAA+B,GAC/C,MAAM,CA4ER"}
1
+ {"version":3,"file":"actions-menu.formatter.d.ts","sourceRoot":"","sources":["../../../src/cell-formatters/actions-menu.formatter.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC,GAAG,GAAG;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,IAAI,CAAC;IAC7B,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,OAAO,CAAC;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,0BAA0B,CAAC,CAAC,GAAG,GAAG;IACjD,OAAO,CAAC,EAAE,KAAK,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,IAAI,CAAC;QAC/B,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,OAAO,CAAC;KACtC,CAAC,CAAC;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,KAAK,MAAM,CAAC,GAAG,MAAM,CAAC;CAChD;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,GAAG,GAAG,EAC1C,IAAI,EAAE,GAAG,EACT,eAAe,GAAE,0BAA0B,CAAC,CAAC,CAAM,GAClD,MAAM,CAoFR"}
@@ -9,9 +9,9 @@
9
9
  *
10
10
  * @alpha
11
11
  */
12
- export interface BooleanFormatterParams {
13
- isDisabled?: (rowData: any) => boolean;
14
- dataTestId?: string;
12
+ export interface BooleanFormatterParams<T = any> {
13
+ isDisabled?: (rowData: T) => boolean;
14
+ dataTestId?: ((rowData: T) => string) | string;
15
15
  prefix?: string;
16
16
  }
17
17
  /**
@@ -23,5 +23,5 @@ export interface BooleanFormatterParams {
23
23
  * @returns HTML content for the boolean value
24
24
  * @public
25
25
  */
26
- export declare function booleanFormatter(cell: any, formatterParams?: BooleanFormatterParams): string;
26
+ export declare function booleanFormatter<T = any>(cell: any, formatterParams?: BooleanFormatterParams<T>): string;
27
27
  //# sourceMappingURL=boolean.formatter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"boolean.formatter.d.ts","sourceRoot":"","sources":["../../../src/cell-formatters/boolean.formatter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,WAAW,sBAAsB;IACrC,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,OAAO,CAAC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,GAAG,EAAE,eAAe,GAAE,sBAA2B,GAAG,MAAM,CAoBhG"}
1
+ {"version":3,"file":"boolean.formatter.d.ts","sourceRoot":"","sources":["../../../src/cell-formatters/boolean.formatter.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,MAAM,WAAW,sBAAsB,CAAC,CAAC,GAAG,GAAG;IAC7C,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,OAAO,CAAC;IACrC,UAAU,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,KAAK,MAAM,CAAC,GAAG,MAAM,CAAC;IAC/C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,GAAG,GAAG,EACtC,IAAI,EAAE,GAAG,EACT,eAAe,GAAE,sBAAsB,CAAC,CAAC,CAAM,GAC9C,MAAM,CAqBR"}
@@ -19,13 +19,13 @@
19
19
  *
20
20
  * @alpha
21
21
  */
22
- export interface EditableFormatterParams {
22
+ export interface EditableFormatterParams<T = any> {
23
23
  value?: any;
24
- data?: any;
24
+ data?: T;
25
25
  field?: string;
26
26
  cssClass?: string;
27
27
  nullText?: string;
28
- dataTestId?: string;
28
+ dataTestId?: ((rowData: T) => string) | string;
29
29
  icon?: string;
30
30
  prefix?: string;
31
31
  }
@@ -36,5 +36,5 @@ export interface EditableFormatterParams {
36
36
  * @returns HTML content for the editable cell
37
37
  * @public
38
38
  */
39
- export declare function editableFormatter(cell: any, formatterParams?: EditableFormatterParams): string;
39
+ export declare function editableFormatter<T = any>(cell: any, formatterParams?: EditableFormatterParams<T>): string;
40
40
  //# sourceMappingURL=editable.formatter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"editable.formatter.d.ts","sourceRoot":"","sources":["../../../src/cell-formatters/editable.formatter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,uBAAuB;IACtC,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,GAAG,EACT,eAAe,GAAE,uBAA4B,GAC5C,MAAM,CAuBR"}
1
+ {"version":3,"file":"editable.formatter.d.ts","sourceRoot":"","sources":["../../../src/cell-formatters/editable.formatter.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,uBAAuB,CAAC,CAAC,GAAG,GAAG;IAC9C,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,KAAK,MAAM,CAAC,GAAG,MAAM,CAAC;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,GAAG,GAAG,EACvC,IAAI,EAAE,GAAG,EACT,eAAe,GAAE,uBAAuB,CAAC,CAAC,CAAM,GAC/C,MAAM,CAyBR"}
@@ -5,11 +5,14 @@
5
5
  *
6
6
  * `label`: The text to display
7
7
  *
8
+ * `isDisabled`: Optional function to determine if this option should be disabled for the given row data
9
+ *
8
10
  * @alpha
9
11
  */
10
- export interface SelectOption {
12
+ export interface SelectOption<T = any> {
11
13
  value: string | number;
12
14
  label: string;
15
+ isDisabled?: (rowData: T) => boolean;
13
16
  }
14
17
  /**
15
18
  * Parameters for the select formatter
@@ -22,22 +25,25 @@ export interface SelectOption {
22
25
  *
23
26
  * `prefix`: The prefix to use for element classes, e.g., 'foundation', 'zero', 'rapid'. Defaults to 'foundation' if not specified.
24
27
  *
28
+ * `onChange`: Optional callback when the selection changes
29
+ *
25
30
  * @alpha
26
31
  */
27
- export interface SelectFormatterParams {
28
- options: SelectOption[];
32
+ export interface SelectFormatterParams<T = any> {
33
+ options: SelectOption<T>[];
29
34
  nullText?: string;
30
- dataTestId?: string;
35
+ dataTestId?: ((rowData: T) => string) | string;
31
36
  prefix?: string;
37
+ onChange?: (value: string, rowData: T) => void;
32
38
  }
33
39
  /**
34
- * Formatter that displays a value from a select list of options
35
- * Styled to match grid-pro select renderer.
40
+ * Formatter that displays a select component with options.
41
+ * Returns a wrapped div containing the select, similar to boolean.formatter.
36
42
  *
37
43
  * @param cell - The cell component provided by Tabulator
38
44
  * @param formatterParams - Select formatter parameters
39
- * @returns Text content for the selected option
45
+ * @returns An empty string, as the component is added directly to the cell element
40
46
  * @public
41
47
  */
42
- export declare function selectFormatter(cell: any, formatterParams: SelectFormatterParams): string;
48
+ export declare function selectFormatter<T = any>(cell: any, formatterParams: SelectFormatterParams<T>): string;
43
49
  //# sourceMappingURL=select.formatter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"select.formatter.d.ts","sourceRoot":"","sources":["../../../src/cell-formatters/select.formatter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,GAAG,EAAE,eAAe,EAAE,qBAAqB,GAAG,MAAM,CA2BzF"}
1
+ {"version":3,"file":"select.formatter.d.ts","sourceRoot":"","sources":["../../../src/cell-formatters/select.formatter.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,GAAG;IACnC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,OAAO,CAAC;CACtC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,qBAAqB,CAAC,CAAC,GAAG,GAAG;IAC5C,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,KAAK,MAAM,CAAC,GAAG,MAAM,CAAC;IAC/C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,KAAK,IAAI,CAAC;CAChD;AAsFD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,CAAC,GAAG,GAAG,EACrC,IAAI,EAAE,GAAG,EACT,eAAe,EAAE,qBAAqB,CAAC,CAAC,CAAC,GACxC,MAAM,CAsHR"}
@@ -15,12 +15,12 @@
15
15
  *
16
16
  * @alpha
17
17
  */
18
- export interface TextFormatterParams {
18
+ export interface TextFormatterParams<T = any> {
19
19
  specialValue?: any;
20
20
  specialColor?: string;
21
21
  specialFontWeight?: string;
22
22
  prefix?: string;
23
- dataTestId?: string;
23
+ dataTestId?: ((rowData: T) => string) | string;
24
24
  nullText?: string;
25
25
  }
26
26
  /**
@@ -32,5 +32,5 @@ export interface TextFormatterParams {
32
32
  * @returns Text content for the cell
33
33
  * @public
34
34
  */
35
- export declare function textFormatter(cell: any, formatterParams?: TextFormatterParams): string;
35
+ export declare function textFormatter<T = any>(cell: any, formatterParams?: TextFormatterParams<T>): string;
36
36
  //# sourceMappingURL=text.formatter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"text.formatter.d.ts","sourceRoot":"","sources":["../../../src/cell-formatters/text.formatter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,mBAAmB;IAClC,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,GAAG,EAAE,eAAe,GAAE,mBAAwB,GAAG,MAAM,CA+B1F"}
1
+ {"version":3,"file":"text.formatter.d.ts","sourceRoot":"","sources":["../../../src/cell-formatters/text.formatter.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,mBAAmB,CAAC,CAAC,GAAG,GAAG;IAC1C,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,KAAK,MAAM,CAAC,GAAG,MAAM,CAAC;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,CAAC,GAAG,GAAG,EACnC,IAAI,EAAE,GAAG,EACT,eAAe,GAAE,mBAAmB,CAAC,CAAC,CAAM,GAC3C,MAAM,CAiCR"}
@@ -10,6 +10,7 @@ import { FormatterTypes } from './cell-formatters/constants';
10
10
  */
11
11
  export type Options = {
12
12
  formatters?: Record<string, Formatter>;
13
+ columns?: ColumnDefinition[];
13
14
  } & Omit<TabulatorOptions, 'formatters'>;
14
15
  /**
15
16
  * Extended FormatterParams type that includes all of our custom formatter parameter interfaces
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EACV,gBAAgB,IAAI,yBAAyB,EAC7C,SAAS,EACT,eAAe,IAAI,wBAAwB,EAC3C,OAAO,IAAI,gBAAgB,EAC5B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D;;;GAGG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CACxC,GAAG,IAAI,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAC;AAEzC;;;GAGG;AACH,MAAM,MAAM,eAAe,GACvB,wBAAwB,GACxB,qBAAqB,GACrB,0BAA0B,GAC1B,sBAAsB,GACtB,uBAAuB,GACvB,qBAAqB,GACrB,mBAAmB,CAAC;AAExB;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,CAAC,EAAE,SAAS,GAAG,cAAc,CAAC;IACvC,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC,GAAG,IAAI,CAAC,yBAAyB,EAAE,WAAW,GAAG,iBAAiB,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EACV,gBAAgB,IAAI,yBAAyB,EAC7C,SAAS,EACT,eAAe,IAAI,wBAAwB,EAC3C,OAAO,IAAI,gBAAgB,EAC5B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D;;;GAGG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACvC,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAC9B,GAAG,IAAI,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAC;AAEzC;;;GAGG;AACH,MAAM,MAAM,eAAe,GACvB,wBAAwB,GACxB,qBAAqB,GACrB,0BAA0B,GAC1B,sBAAsB,GACtB,uBAAuB,GACvB,qBAAqB,GACrB,mBAAmB,CAAC;AAExB;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,CAAC,EAAE,SAAS,GAAG,cAAc,CAAC;IACvC,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC,GAAG,IAAI,CAAC,yBAAyB,EAAE,WAAW,GAAG,iBAAiB,CAAC,CAAC"}
@@ -1,3 +1,4 @@
1
1
  export * from './logger';
2
2
  export * from './string-utils';
3
+ export * from './test-id-utils';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Resolves a dataTestId value that can be either a string or a function
3
+ *
4
+ * @param dataTestId - The dataTestId value (string or function)
5
+ * @param rowData - The row data to pass to the function if dataTestId is a function
6
+ * @returns The resolved test ID string or undefined if not provided
7
+ * @alpha
8
+ */
9
+ export declare function getDataTestId<T = any>(dataTestId: ((rowData: T) => string) | string | undefined, rowData: T): string | undefined;
10
+ //# sourceMappingURL=test-id-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-id-utils.d.ts","sourceRoot":"","sources":["../../../src/utils/test-id-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,CAAC,GAAG,GAAG,EACnC,UAAU,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,KAAK,MAAM,CAAC,GAAG,MAAM,GAAG,SAAS,EACzD,OAAO,EAAE,CAAC,GACT,MAAM,GAAG,SAAS,CAIpB"}
@@ -1,4 +1,5 @@
1
1
  import { DOM } from '@microsoft/fast-element';
2
+ import { getDataTestId } from '../utils';
2
3
  /**
3
4
  * Formatter that displays an action button in the cell.
4
5
  * Styled to match grid-pro action renderer.
@@ -27,8 +28,9 @@ export function actionFormatter(cell, formatterParams = {}) {
27
28
  // Set appearance
28
29
  actionButton.setAttribute('appearance', appearance);
29
30
  // Set data-test-id if provided
30
- if (dataTestId) {
31
- actionButton.setAttribute('data-test-id', dataTestId);
31
+ const testId = getDataTestId(dataTestId, rowData);
32
+ if (testId) {
33
+ actionButton.setAttribute('data-test-id', testId);
32
34
  }
33
35
  // Set content
34
36
  actionButton.textContent = actionName;
@@ -1,4 +1,5 @@
1
1
  import { DOM } from '@microsoft/fast-element';
2
+ import { getDataTestId } from '../utils';
2
3
  /**
3
4
  * Formatter that displays a dropdown menu of actions in the cell.
4
5
  * Styled to match grid-pro actions-menu renderer.
@@ -9,7 +10,8 @@ import { DOM } from '@microsoft/fast-element';
9
10
  * @public
10
11
  */
11
12
  export function actionsMenuFormatter(cell, formatterParams = {}) {
12
- const { actions = [], prefix = 'foundation', menuName, isVertical = false, buttonAppearance, } = formatterParams;
13
+ const rowData = cell.getData();
14
+ const { actions = [], prefix = 'foundation', menuName, isVertical = false, buttonAppearance, dataTestId, } = formatterParams;
13
15
  // Create container for styling (similar to grid-pro implementation)
14
16
  const containerDiv = document.createElement('div');
15
17
  containerDiv.style.cssText =
@@ -19,6 +21,11 @@ export function actionsMenuFormatter(cell, formatterParams = {}) {
19
21
  // Create actions menu element - using 'as any' to match main.ts
20
22
  const actionsMenu = document.createElement(elementTagName);
21
23
  actionsMenu.style.width = '100%';
24
+ // Set data-test-id if provided
25
+ const testId = getDataTestId(dataTestId, rowData);
26
+ if (testId) {
27
+ actionsMenu.setAttribute('data-test-id', testId);
28
+ }
22
29
  // Set the menu name based on prefix (this exactly matches main.ts)
23
30
  actionsMenu.name = prefix === 'foundation' ? '⋮' : '+';
24
31
  // Override with custom name if provided
@@ -40,13 +47,13 @@ export function actionsMenuFormatter(cell, formatterParams = {}) {
40
47
  // If the action has an isDisabled function, wrap it in a safe function
41
48
  if (safeAction.isDisabled) {
42
49
  const originalIsDisabled = safeAction.isDisabled;
43
- safeAction.isDisabled = (rowData) => {
50
+ safeAction.isDisabled = (rowDataIsDisabled) => {
44
51
  try {
45
52
  // Make sure rowData exists and the original function is callable
46
- if (!rowData || typeof originalIsDisabled !== 'function') {
53
+ if (!rowDataIsDisabled || typeof originalIsDisabled !== 'function') {
47
54
  return false;
48
55
  }
49
- return originalIsDisabled(rowData);
56
+ return originalIsDisabled(rowDataIsDisabled);
50
57
  }
51
58
  catch (error) {
52
59
  console.warn('Error in isDisabled function:', error);
@@ -1,3 +1,4 @@
1
+ import { getDataTestId } from '../utils';
1
2
  /**
2
3
  * Formatter that displays boolean values using a checkbox component.
3
4
  * Styled to match grid-pro boolean renderer.
@@ -15,7 +16,8 @@ export function booleanFormatter(cell, formatterParams = {}) {
15
16
  // Determine if the checkbox should be disabled
16
17
  const disabled = isDisabled && isDisabled(rowData);
17
18
  // Generate test ID if needed
18
- const testIdAttr = dataTestId ? ` data-test-id="${dataTestId}"` : '';
19
+ const testId = getDataTestId(dataTestId, rowData);
20
+ const testIdAttr = testId ? ` data-test-id="${testId}"` : '';
19
21
  // The element tagname should be exactly "{prefix}-checkbox"
20
22
  const elementTagName = `${prefix}-checkbox`;
21
23
  // Container div with flex styling to match grid-pro
@@ -1,3 +1,4 @@
1
+ import { getDataTestId } from '../utils';
1
2
  /**
2
3
  * Formatter that displays an editable cell with validation state
3
4
  * @param cell - The cell component provided by Tabulator
@@ -7,9 +8,11 @@
7
8
  */
8
9
  export function editableFormatter(cell, formatterParams = {}) {
9
10
  const value = cell.getValue();
11
+ const rowData = cell.getData();
10
12
  const { cssClass, nullText = '', dataTestId, icon = 'edit', prefix = 'foundation', } = formatterParams;
11
13
  // Generate test ID if needed
12
- const testIdAttr = dataTestId ? ` data-test-id="${dataTestId}"` : '';
14
+ const testId = getDataTestId(dataTestId, rowData);
15
+ const testIdAttr = testId ? ` data-test-id="${testId}"` : '';
13
16
  // Handle null/undefined values
14
17
  const displayValue = value === null || value === undefined ? nullText : value;
15
18
  // Create class with proper prefix