From 6472bb6f043464f08a93a780cd5bc05f486f1bce Mon Sep 17 00:00:00 2001 From: Michael Meier Date: Wed, 24 Apr 2024 09:51:17 +0200 Subject: [PATCH] fix(DataTable): fix rowClass type definition and improve usage documentation for rowClass and rowStyle. Fixes #5498 --- components/lib/datatable/DataTable.d.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/components/lib/datatable/DataTable.d.ts b/components/lib/datatable/DataTable.d.ts index 8d95f3ab1..02b4aa450 100755 --- a/components/lib/datatable/DataTable.d.ts +++ b/components/lib/datatable/DataTable.d.ts @@ -1066,12 +1066,15 @@ export interface DataTableProps { editingRows?: any[] | DataTableEditingRows; /** * A function that takes the row data as a parameter and returns a string to apply a particular class for the row. + * The return value is added to the row's :classes array (see Vue.js class bindings). */ - rowClass?: (data: any) => object | undefined; + rowClass?: (data: any) => string | object | undefined; /** - * A function that takes the row data as a parameter and returns the inline style for the corresponding row. + * A function that takes the row data as a parameter and returns the inline style object for the corresponding row. + * The function may also return an array of style objects which will be merged. + * The return value of this function is directly applied as a Vue.js style-binding on the table row. */ - rowStyle?: (data: any) => object | undefined; + rowStyle?: (data: any) => object | object[] | undefined; /** * When specified, enables horizontal and/or vertical scrolling. * @defaultValue false