UNPKG

@adaptabletools/adaptable

Version:

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

69 lines (68 loc) 2.67 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 all Columns of given DataType */ Scope: ColumnScope; /** * Rule used to decide whether to apply the Format; if undefined Format is always applied */ Rule?: FormatColumnRule; /** * Style to apply */ Style?: AdaptableStyle; /** * Display Format to apply to Column can be Numeric, String or Date */ DisplayFormat?: AdaptableFormat; /** * Aligns cells 'Left' or 'Right' or 'Center' */ CellAlignment?: 'Left' | 'Right' | 'Center'; /** * Which types of Rows should be formatted (data, grouped, summary) */ RowScope?: RowScope; } /** * 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';