Summary functions & values
comins-table root imports.
getCominsSummaryValues
Section titled “getCominsSummaryValues”export declare function getCominsSummaryValues<TData>(rows: readonly TData[], columns: readonly CominsTableRuntimeColumn<TData>[], summary: CominsTableSummaryConfig<TData>): Record<string, React.ReactNode>;Aggregates only the supplied rows and returns results keyed by column ID. The caller chooses pagination, filtering and Tree scope. Reads raw dotted field values without cell formatters; ignores configurations for missing columns. Does not mutate input arrays; custom aggregate/format callbacks must also be pure.
CominsSummaryBuiltin
Section titled “CominsSummaryBuiltin”export type CominsSummaryBuiltin = "avg" | "count" | "max" | "min" | "sum";count includes all input rows, including null, undefined and string field values. sum/avg/min/max use only finite numbers; numeric strings, NaN and Infinity are excluded. With no numeric values, the result is null, not zero.
CominsSummaryAggregator
Section titled “CominsSummaryAggregator”export type CominsSummaryAggregator<TData> = (input: { column: CominsTableRuntimeColumn<TData>; rows: readonly TData[]; values: readonly unknown[];}) => React.ReactNode;column is the normalized runtime column; rows contains the supplied aggregation scope; values holds raw field values. Returns a ReactNode. Hidden, collapsed and paged scope is determined by the caller.
CominsSummaryFormatPayload
Section titled “CominsSummaryFormatPayload”export type CominsSummaryFormatPayload<TData> = { column: CominsTableRuntimeColumn<TData>; rows: readonly TData[]; value: React.ReactNode; values: readonly unknown[];};value is the computed aggregate. column/rows/values match the aggregation input. format runs after aggregation and can format output such as currency.
CominsSummaryColumn
Section titled “CominsSummaryColumn”export type CominsSummaryColumn<TData> = CominsSummaryBuiltin | CominsSummaryAggregator<TData> | CominsSummaryColumnConfig<TData>;Accepts a built-in name, custom function or configuration object. See table options for aggregate, format, colSpan and styling.