From 8a8ec6439ff93363f0ac56965e0ed975ce526082 Mon Sep 17 00:00:00 2001 From: Daniel <46283763+danielHin@users.noreply.github.com> Date: Fri, 24 Oct 2025 14:16:40 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#73955=20fix(tabula?= =?UTF-8?q?tur-tables)=20-=20update=20GlobalTooltipOptions=20Signature=20b?= =?UTF-8?q?y=20@danielHin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/tabulator-tables/index.d.ts | 4 +++- types/tabulator-tables/package.json | 2 +- .../tabulator-tables/tabulator-tables-tests.ts | 17 +++++++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/types/tabulator-tables/index.d.ts b/types/tabulator-tables/index.d.ts index 1161efb0acbe51..be15ae819d1aa1 100755 --- a/types/tabulator-tables/index.d.ts +++ b/types/tabulator-tables/index.d.ts @@ -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, diff --git a/types/tabulator-tables/package.json b/types/tabulator-tables/package.json index 9a6243749f1625..949271c8c55f0c 100644 --- a/types/tabulator-tables/package.json +++ b/types/tabulator-tables/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/tabulator-tables", - "version": "6.2.9999", + "version": "6.3.9999", "projects": [ "http://tabulator.info" ], diff --git a/types/tabulator-tables/tabulator-tables-tests.ts b/types/tabulator-tables/tabulator-tables-tests.ts index 33b8d6abfba946..7bca1800fb5239 100644 --- a/types/tabulator-tables/tabulator-tables-tests.ts +++ b/types/tabulator-tables/tabulator-tables-tests.ts @@ -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 = {};