UNPKG

@adaptabletools/adaptable

Version:

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

92 lines (91 loc) 3.27 kB
import { BaseState } from './BaseState'; import { AdaptableStyle } from './Common/AdaptableStyle'; import { AdaptableFormat } from './Common/AdaptableFormat'; import { ColumnScope } from './Common/ColumnScope'; import { RowScope } from './Common/RowScope'; import { SuspendableObject } from './Common/SuspendableObject'; import { XOR } from '../Utilities/Extensions/TypeExtensions'; import { TypeHint } from './Common/Types'; import { AdaptableBooleanQuery } from '../types'; import { AdaptableColumnPredicate } from './Common/AdaptablePredicate'; /** * Adaptable State Section for Format Column Module */ export interface FormatColumnState extends BaseState { /** * Collection of Format Columns */ FormatColumns?: FormatColumn[]; } /** * Object used in Format Column function */ export interface FormatColumn extends SuspendableObject { /** * Where Format will be applied: whole Row, some Columns, or Columns of DataType */ Scope: ColumnScope; /** * Where in Column to apply Format (`cell` or `columnHeader`) * * @defaultValue 'cell' */ Target?: FormatColumnTarget; /** * Rule to decide whether to apply Format; if undefined Format is always applied */ Rule?: FormatColumnRule; /** * AdapTable Style to apply */ Style?: AdaptableStyle; /** * Display Format to apply to Column can be Numeric, String or Date */ DisplayFormat?: AdaptableFormat; /** * Align cells 'Left' or 'Right' or 'Center' */ CellAlignment?: CellAlignment; /** * Which types of Rows to apply format (data, grouped, summary, total) */ RowScope?: RowScope; /** * When to format Columns in Column Groups ('Expanded', 'Collapsed', 'Both') * */ ColumnGroupScope?: ColumnGroupScope; } /** * Specifies whether Column's cells or header is formatted */ export type FormatColumnTarget = 'cell' | 'columnHeader'; /** * Defines Column Group Scope */ export type ColumnGroupScope = 'Expanded' | 'Collapsed' | 'Both'; /** * Behaviour for aligning Cell contents */ export type CellAlignment = 'Left' | 'Right' | 'Center'; /** * The Format Column Rule - can be either a Predicate or a BooleanExpression */ export type FormatColumnRule = XOR<{ Predicates: FormatColumnPredicate[]; }, AdaptableBooleanQuery>; /** * Predicate used when creating a Format Column */ export interface FormatColumnPredicate extends AdaptableColumnPredicate { PredicateId: TypeHint<string, SystemFormatColumnPredicateId>; } /** * Array containing all System Format Column Predicates */ export type SystemFormatColumnPredicateIds = SystemFormatColumnPredicateId[]; /** * List of System Predicates available for Format Columns */ export type SystemFormatColumnPredicateId = 'Blanks' | 'NonBlanks' | 'Equals' | 'NotEquals' | 'GreaterThan' | 'LessThan' | 'Positive' | 'Negative' | 'Zero' | 'Between' | 'NotBetween' | 'Is' | 'IsNot' | 'Contains' | 'NotContains' | 'StartsWith' | 'EndsWith' | 'Regex' | 'Today' | 'Yesterday' | 'Tomorrow' | 'ThisWeek' | 'ThisMonth' | 'ThisQuarter' | 'ThisYear' | 'InPast' | 'InFuture' | 'Before' | 'After' | 'On' | 'NotOn' | 'NextWorkDay' | 'LastWorkDay' | 'WorkDay' | 'Holiday' | 'True' | 'False' | 'In' | 'NotIn';