UNPKG

@adaptabletools/adaptable

Version:

Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements

194 lines (193 loc) 4.99 kB
import { AdaptableObject } from './AdaptableObject'; import { BaseCellDataType } from 'ag-grid-enterprise'; /** * Defines data type of a Column; can be an AG Grid BaseCellDataType or an AdapTable array-related one */ export type AdaptableColumnDataType = BaseCellDataType | 'textArray' | 'numberArray' | 'tupleArray' | 'objectArray' | 'unknown'; /** * Column Types recognised by AdapTable; to be set in GridOptions */ export type AdaptableSpecialColumnType = 'calculatedColumn' | 'freeTextColumn' | 'actionColumn' | 'fdc3Column'; export declare const CALCULATED_COLUMN_TYPE: AdaptableSpecialColumnType; export declare const FREE_TEXT_COLUMN_TYPE: AdaptableSpecialColumnType; export declare const ACTION_COLUMN_TYPE: AdaptableSpecialColumnType; export declare const FDC3_COLUMN_TYPE: AdaptableSpecialColumnType; /** * Base class for AdapTable Column containing most important properties */ export interface AdaptableColumnBase extends AdaptableObject { /** * Name of Column in AG Grid (e.g. field or colId) */ columnId: string; /** * How Column is referred to in Adaptable UI; `Caption` property in AG Grid */ friendlyName: string; /** * DataType of the Column */ dataType: AdaptableColumnDataType; /** * Column Types of the Column */ columnTypes?: string[]; } export declare const isValidOrderForColumnGroups: ({ oldColumns, newColumns, }: { oldColumns: AdaptableColumn[]; newColumns: AdaptableColumn[]; }) => boolean; /** * Defines a Column Group */ export interface AdaptableColumnGroup { /** * Whether the Group can be split */ allowGroupSplit: boolean; /** * Id for the Column Group */ columnGroupId: string; /** * Friendly name for the Group */ friendlyName: string; /** * Number of Columns in the the Group */ groupCount: number; } /** * Defines an AdapTable Column - created at run-time based on AG Grid ColDef */ export interface AdaptableColumn<TData = any> extends AdaptableColumnBase { /** * Field in the row to get cell data from */ field?: Extract<keyof TData, string>; /** * Whether the Column is always hidden */ alwaysHidden: boolean; /** * Whether the Column is the Tree Column (in Tree View) */ isTreeColumn: boolean; /** * Is this the Primary Key Column */ isPrimaryKey: boolean; /** * Column width */ width?: number; /** * Flex details of the Column */ flex?: number; /** * Is Column editable; returns FALSE if Column has conditional/dynamic editability, assuming some rows are editable */ readOnly: boolean; /** * Is Column currently visible */ visible: boolean; /** * Is the Column ONLY available as a field and never visible */ fieldOnly: boolean; /** * Is Column sortable */ sortable: boolean; /** * Is Column able to be filtered */ filterable: boolean; /** * Can Column be moved at run-time to a new position */ moveable: boolean; /** * Can Column be removed from the grid */ hideable: boolean; /** * Can Column form a Row Group */ groupable: boolean; /** * Can Column be used in a Pivot Layout */ pivotable: boolean; /** * Is Column able to display aggregations (e.g. 'sum') when grouped */ aggregatable: boolean; /** * Can the Column be in included in Queries / Expressions */ queryable: boolean; /** * Whether the Column can be included in Reports */ exportable: boolean; /** * Available Aggregations for the Column */ availableAggregationFunctions?: string[]; /** * Custom Aggregation function for the Column */ aggregationFunction?: string; /** * Is Column currently Row-Grouped */ isGrouped: boolean; /** * Is Column a generated Row Group Column */ isGeneratedRowGroupColumn: boolean; /** * Is Column a generated Pivot Result Column */ isGeneratedPivotResultColumn: boolean; /** * Is Column pinned or locked into position */ isFixed: boolean; /** * The pinned position of the Column */ pinned: 'left' | 'right' | false; /** * Is it a Sparkline Column */ isSparkline: boolean; /** * The parent Column group (if Column belongs to one) */ columnGroup?: AdaptableColumnGroup; /** * Is Column a Calculated Column */ isCalculatedColumn: boolean; /** * Is Column a Free Text Column */ isFreeTextColumn: boolean; /** * Is Column an Action Column */ isActionColumn: boolean; } export interface AdaptableColumnProperties { sortable: boolean; filterable: boolean; moveable: boolean; groupable: boolean; pivotable: boolean; aggregatable: boolean; }