Skip to content
Data TableAPI Reference

Core cell values & presentation

comins-table@0.2.2React

0.2.0: Types and helpers on this page use the React-state contract from the root comins-table entry. Neutral /core has a separate type contract. See the migration guide for imports and cell policies.

Helpers for resolving values, formatting and cell props in custom renderers. Value resolution is separate from rendering built-in cell components.

export declare function getCominsCellValue<TData>(state: CominsTableState<TData>, row: TData, columnId: string): unknown;

Reads the raw value through the column field’s dotted path. Missing columns or paths return undefined.

export declare function formatCominsCellValue<TData>(state: CominsTableState<TData>, row: TData, rowId: CominsRowId, column: CominsTableRuntimeColumn<TData>): import("react").ReactNode;

Calls cell.format with the shared cell payload when present. Otherwise null/undefined becomes an empty string and other values use String(value). It does not run cell.renderer or components.

export declare function isCominsCellDisabled<TData>(state: CominsTableState<TData>, row: TData, rowId: CominsRowId, column: CominsTableRuntimeColumn<TData>): boolean;

Resolves cell.props and its static/function disabled value for this row and tests for true.

export declare function getCominsCellClassName<TData>(state: CominsTableState<TData>, row: TData, rowId: CominsRowId, column: CominsTableRuntimeColumn<TData>): string | undefined;

Resolves static/function cell.props.className; returns undefined when absent.

export declare function getCominsCellStyle<TData>(state: CominsTableState<TData>, row: TData, rowId: CominsRowId, column: CominsTableRuntimeColumn<TData>): import("react").CSSProperties | undefined;

Resolves static/function cell.props.style; returns undefined when absent.

export type CominsCellFormatParams<TData, TValue = unknown> = {
column: CominsTableRuntimeColumn<TData, TValue>;
row: TData;
rowId: CominsRowId;
value: TValue;
};
Property Behavior / default
column Runtime column definition.
row Business row data, distinct from the shared component payload’s row wrapper.
rowId Row ID.
value Cell value.
export type CominsColumnValueResolver<TData, TValue> = TValue | ((params: CominsCellFormatParams<TData, TValue>) => TValue);

Public type for a static TValue or a function resolving it from CominsCellFormatParams. The current cell.format callback uses the richer CominsCellComponentPayload.

export type CominsClipboardGuard<TData, TValue = unknown> = boolean | ((params: CominsCellComponentPayload<TData, TValue>) => boolean);

Boolean or cell-payload predicate for disabled/copyable/pasteable. disabled takes precedence and blocks copying/pasting.