From 94ffcaa5b7eaaab6b4a298afc14e01e89e7618be Mon Sep 17 00:00:00 2001 From: Lukas Harbarth Date: Fri, 31 Oct 2025 14:54:48 +0100 Subject: [PATCH] fix(AnalyticalTable): fix cell types & add missing cell & row types --- .../components/AnalyticalTable/types/index.ts | 38 +++++++++++++------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/packages/main/src/components/AnalyticalTable/types/index.ts b/packages/main/src/components/AnalyticalTable/types/index.ts index d2599aafc5e..e4a8133d7df 100644 --- a/packages/main/src/components/AnalyticalTable/types/index.ts +++ b/packages/main/src/components/AnalyticalTable/types/index.ts @@ -93,8 +93,16 @@ export interface ColumnType extends Omit export interface CellType { column: ColumnType; row: RowType; - value: string | undefined; - getCellProps: (props?: any) => any; + value: string | undefined | null; + getCellProps: (userProps?: any) => any; + /** + * Indicates whether the cell is aggregated. + * + * __Note:__ This is a numeric flag where `1` means true and `0` means false. + */ + isAggregated: 0 | 1; + isGrouped: boolean; + isPlaceholder: boolean; [key: string]: any; } @@ -257,27 +265,33 @@ export interface WCRPropertiesType { onFilter: AnalyticalTablePropTypes['onFilter']; } -export type CellInstance = TableInstance & { cell: CellType } & Omit; +export type CellInstance = TableInstance & { cell: CellType } & Omit< + CellType, + 'getCellProps' | 'isAggregated' | 'isGrouped' | 'isPlaceholder' + >; export interface RowType { - allCells: Record[]; canExpand: boolean; - cells: Record[]; + cells: CellType[]; + allCells: Record[]; depth: number; - getRowProps: (props?: any) => any; - getToggleRowExpandedProps: (userProps?: any) => any; - getToggleRowSelectedProps: (userProps?: any) => any; id: string; index: number; - isExpanded: boolean; + isExpanded: boolean | undefined; isSelected: boolean; isSomeSelected: boolean; + getRowProps: (props?: any) => any; original: Record; originalSubRows: Record[]; - subRows: Record[]; - toggleRowExpanded: (isExpanded?: boolean) => void; - toggleRowSelected: (isSelected?: boolean) => void; + subRows: RowType[]; values: Record; + groupByID?: string; + groupByVal?: string; + leafRows?: Omit[]; + getToggleRowExpandedProps?: (userProps?: any) => any; + getToggleRowSelectedProps?: (userProps?: any) => any; + toggleRowExpanded?: (isExpanded?: boolean) => void; + toggleRowSelected?: (isSelected?: boolean) => void; [key: string]: any; }