Core cell values & presentation
0.2.0: Types and helpers on this page use the React-state contract from the root
comins-tableentry. Neutral/corehas 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.
getCominsCellValue
Section titled “getCominsCellValue”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.
formatCominsCellValue
Section titled “formatCominsCellValue”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.
isCominsCellDisabled
Section titled “isCominsCellDisabled”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.
getCominsCellClassName
Section titled “getCominsCellClassName”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.
getCominsCellStyle
Section titled “getCominsCellStyle”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.
CominsCellFormatParams
Section titled “CominsCellFormatParams”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. |
CominsColumnValueResolver
Section titled “CominsColumnValueResolver”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.
CominsClipboardGuard
Section titled “CominsClipboardGuard”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.