ag-grid-enterprise
Version:
Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue
83 lines (82 loc) • 4.17 kB
TypeScript
import type { AgColumn, ColDef, ColumnEventType, ColumnState, ColumnTreeBuild, HeaderPosition, ICalculatedColumnsService, NamedBean } from 'ag-grid-community';
import { BeanStub } from 'ag-grid-community';
type CalculatedColumnDialogRestoreFocusParams = {
eventSource?: HTMLElement;
headerPosition: HeaderPosition | null;
};
export declare class CalculatedColumnsService extends BeanStub implements NamedBean, ICalculatedColumnsService {
readonly beanName: "calculatedColsSvc";
/** Dynamic calc cols (API/dialog added), keyed by colId. Insertion order = tree append order. */
private readonly dynamicColumns;
/** Added cols parked by `resetColumnState` so a later `applyColumnState` can restore them, by colId. */
private readonly inactiveDynamicColumns;
/** Build-time overrides for static (columnDefs-declared) calc cols, keyed by colId: a replacement
* colDef from `updateCalculatedColumn`, or `null` when removed. Consumed by the build via {@link overrideFor}. */
private readonly staticColOverrides;
private validationStatesByColId;
private validationStatesInitialised;
private lifecycleInitialised;
private knownCalculatedColumns;
private suppressValidationChecks;
private readonly openDialogsByColId;
private readonly scheduledLiveApplyColIds;
private readonly pendingLiveApplyUpdatesByColId;
private readonly formulaErrorsByExpression;
postConstruct(): void;
isEnabled(): boolean;
isHighlightedColumn(column: AgColumn | null): boolean;
private refreshCalculatedColumnHighlight;
private refreshOpenDialogHighlights;
private updateCalculatedColumn;
private getFormulaError;
private getFormulaExpressionError;
private validateFormulaExpression;
private getInvalidColumnReference;
private validateColumnReferences;
openCalculatedColumnDialog(column: AgColumn | null | undefined, mode: 'add' | 'edit', focus?: boolean, restoreFocusParams?: CalculatedColumnDialogRestoreFocusParams): void;
private addDynamicCalculatedColumn;
removeCalculatedColumn(column: AgColumn | null | undefined): void;
private isLiveApplyMode;
private getOptions;
overrideFor(colDef: ColDef): ColDef | null | undefined;
contributeTo(build: ColumnTreeBuild): void;
private clearDynamicColumnInstances;
resetDynamicColumnDefs(preserveCreatedColumns?: boolean): boolean;
restoreDynamicColumnDefs(state: ColumnState[]): boolean;
private getOrCreateColumn;
/** Rebuild the column tree for a calc-col mutation. Suppresses lifecycle/validation dispatch during the
* rebuild so the imperative caller (or column-state op) emits its own events, not duplicates. */
refreshDynamicColumns(source: ColumnEventType): void;
private createUniqueColId;
private getUpdatedCalculatedColDef;
private showDialog;
private restoreFocusOnDialogClose;
private scheduleLiveApplyUpdate;
private flushLiveApplyUpdate;
private cancelLiveApplyUpdate;
private closeCalculatedColumnDialog;
private getDefaultDraft;
private getDataTypeOptions;
private getValidConfiguredDataTypes;
private getDataTypeDisplayName;
private formatDataTypeName;
private getExpressionPickers;
private toDraft;
private focusCalculatedColumn;
private toColDef;
private toCalculatedColDef;
private getExpressionValidationState;
/** Fire created/expressionChanged/removed events for calc cols added, edited, or removed *declaratively*
* (via columnDefs). Imperative dialog paths rebuild through {@link refreshDynamicColumns} (counter > 0),
* so this stays silent for them and they dispatch inline — avoiding double-fire. The baseline is always
* updated (even when silent) so a later declarative load doesn't replay suppressed changes as new events. */
private checkColumnLifecycle;
private checkValidationStates;
private getEventCommonParams;
private dispatchCreatedOrRemovedEvent;
private dispatchExpressionChangedEvent;
private dispatchValidationStateChangedEvent;
private getFunctionSuggestions;
private refreshCalculatedColumn;
}
export {};