From 68d3559b484230068fd6ec730a98c99be56b563f Mon Sep 17 00:00:00 2001 From: jpfisher72 Date: Tue, 22 Oct 2024 16:46:00 -0400 Subject: [PATCH] Fix accidentally breaking changes --- package-lock.json | 4 ++-- package.json | 2 +- src/components/DataTable/datatable.tsx | 2 +- src/components/DataTable/types.ts | 12 ++++++++---- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 612d68f..f49655a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@weng-lab/psychscreen-ui-components", - "version": "2.0.5", + "version": "2.0.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@weng-lab/psychscreen-ui-components", - "version": "2.0.5", + "version": "2.0.6", "license": "MIT", "dependencies": { "cytoscape": "^3.30.2", diff --git a/package.json b/package.json index 3e90cf2..9518bc4 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@weng-lab/psychscreen-ui-components", "description": "Typescript and Material UI based components used for psychSCREEN", "author": "SCREEN Team @ UMass Chan Medical School", - "version": "2.0.6", + "version": "2.0.7", "license": "MIT", "type": "module", "typings": "dist/index.d.ts", diff --git a/src/components/DataTable/datatable.tsx b/src/components/DataTable/datatable.tsx index afa4847..400f612 100644 --- a/src/components/DataTable/datatable.tsx +++ b/src/components/DataTable/datatable.tsx @@ -472,7 +472,7 @@ const DataTable = ( } > {column.FunctionalRender ? ( - + column.FunctionalRender(row) ) : column.render ? ( column.render(row) ) : ( diff --git a/src/components/DataTable/types.ts b/src/components/DataTable/types.ts index 261d8b9..8d68ab3 100644 --- a/src/components/DataTable/types.ts +++ b/src/components/DataTable/types.ts @@ -1,14 +1,18 @@ -import React from "react" - export type DataTableColumn = { tooltip?: string header: string - HeaderRender?: React.FC + /** + * Custom render function for the column header + */ + HeaderRender?: () => JSX.Element; value: (row: T) => string | number search?: (row: T) => boolean unsearchable?: boolean render?: (row: T) => string | JSX.Element - FunctionalRender?: (props: { row: T }) => JSX.Element; + /** + * Custom render function for the row + */ + FunctionalRender?: (row: T) => JSX.Element; sort?: (a: T, b: T) => number unsortable?: boolean }