Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion types/tabulator-tables/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1556,7 +1556,9 @@ export type GroupValuesArg = any[][];

export type TextDirection = "auto" | "ltr" | "rtl";

export type GlobalTooltipOption = boolean | ((event: MouseEvent, cell: CellComponent, onRender: () => void) => string);
export type GlobalTooltipOption =
| boolean
| ((event: MouseEvent, cell: CellComponent, onRender: () => void) => string | HTMLElement);

export type CustomMutator = (
value: any,
Expand Down
2 changes: 1 addition & 1 deletion types/tabulator-tables/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@types/tabulator-tables",
"version": "6.2.9999",
"version": "6.3.9999",
"projects": [
"http://tabulator.info"
],
Expand Down
17 changes: 17 additions & 0 deletions types/tabulator-tables/tabulator-tables-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,23 @@ colDef.tooltip = (event: MouseEvent, cell: CellComponent, onRendered: (callback:
return cell.getValue();
};

// Additional tests for tooltip signature / return values
// boolean values
colDef.tooltip = false;
colDef.tooltip = true;

// function returning a string
colDef.tooltip = (e: MouseEvent, cell: CellComponent) => {
return "Tooltip";
};

// function returning an HTMLElement
colDef.tooltip = (e: MouseEvent, cell: CellComponent) => {
const el = document.createElement("div");
el.innerText = "Tooltip";
return el;
};

// Cell Component

let cell = <CellComponent> {};
Expand Down