UNPKG

ag-grid-community

Version:

Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue

87 lines (86 loc) • 5.14 kB
import type { IAgEventEmitter, IEventListener } from 'ag-stack'; import type { VisibleColsService } from '../columns/visibleColsService'; import { BeanStub } from '../context/beanStub'; import type { AgColumnGroupEvent, Column, ColumnGroup, ColumnGroupShowType, ColumnPinnedType, HeaderColumnId } from '../interfaces/iColumn'; import type { AgColumn, ColumnLane } from './agColumn'; import type { AgProvidedColumnGroup } from './agProvidedColumnGroup'; import type { AbstractColDef, ColGroupDef, HeaderLocation } from './colDef'; export declare const isColumnGroup: (col: Column | ColumnGroup | string) => col is AgColumnGroup; /** @internal AG_GRID_INTERNAL - Not for public use. Can change / be removed at any time. */ export declare class AgColumnGroup<TValue = any> extends BeanStub<AgColumnGroupEvent> implements ColumnGroup<TValue>, IAgEventEmitter<AgColumnGroupEvent> { readonly providedColumnGroup: AgProvidedColumnGroup; readonly groupId: string; readonly partId: number; pinned: ColumnPinnedType; readonly isColumn: false; readonly uniqueId: HeaderColumnId; /** Sanitised version of the column id */ readonly colIdSanitised: string; children: (AgColumn | AgColumnGroup)[] | null; displayedChildren: (AgColumn | AgColumnGroup)[] | null; /** The `displayedChildren` its last `displayedChildrenChanged` reported. */ private reportedDisplayedChildren; /** Bumped on each `displayedChildrenChanged`, so a walk a listener's own update interrupted can tell it was told. */ private childrenReports; autoHeaderHeight: number | null; left: number | null; /** The `left` its last `leftChanged` reported. */ private reportedLeft; /** Where the group was before the latest layout moved it; a header drawn by a column move starts here. */ oldLeft: number | null; parent: AgColumnGroup | null; /** Most recent build token that claimed this instance — sweeps use it to spot orphans. */ buildToken: number; /** `pinned` resolved to a lane; written wherever `pinned` is. */ pinnedLane: ColumnLane; constructor(providedColumnGroup: AgProvidedColumnGroup, groupId: string, partId: number, pinned: ColumnPinnedType); getParent(): AgColumnGroup | null; getUniqueId(): HeaderColumnId; isEmptyGroup(): boolean; /** Returns true only when every leaf column in this group is currently moving. */ isMoving(): boolean; setLeftFromChildren(): void; getLeft(): number | null; /** Reports its layout changes; returns whether its own or a descendant's displayed children changed. */ dispatchLayoutEvents(): boolean; __addEventListener<T extends AgColumnGroupEvent>(eventType: T, listener: IEventListener<T>): void; __removeEventListener<T extends AgColumnGroupEvent>(eventType: T, listener: IEventListener<T>): void; /** PUBLIC USE ONLY: grid code uses `__addEventListener` and `__removeEventListener`, which skip the wrapping. */ addEventListener<T extends AgColumnGroupEvent>(eventType: T, userListener: IEventListener<T>, async?: boolean): void; /** PUBLIC USE ONLY: grid code uses `__addEventListener` and `__removeEventListener`, which skip the wrapping. */ removeEventListener<T extends AgColumnGroupEvent>(eventType: T, userListener: IEventListener<T>, async?: boolean): void; getPinned(): ColumnPinnedType; getGroupId(): string; getDisplayName(location?: HeaderLocation): string; getPartId(): number; getActualWidth(): number; isResizable(): boolean; getMinWidth(): number; getDisplayedChildren(): (AgColumn | AgColumnGroup)[] | null; getLeafColumns(): AgColumn[]; getDisplayedLeafColumns(): AgColumn[]; /** 1-based aria column index for this group's header cell: first leaf column's index */ get ariaColIndex(): number; getDefinition(): AbstractColDef | null; getColGroupDef(): ColGroupDef | null; isPadding(): boolean; isExpandable(): boolean; isExpanded(): boolean; isAutoHeaderHeight(): boolean; getAutoHeaderHeight(): number | null; /** Returns true if the header height has changed */ setAutoHeaderHeight(height: number | null): boolean; private addDisplayedLeafColumns; private addLeafColumns; getChildren(): (AgColumn | AgColumnGroup)[] | null; getColumnGroupShow(): ColumnGroupShowType | undefined; getProvidedColumnGroup(): AgProvidedColumnGroup; getPaddingLevel(): number; } /** First/last (`last`) leaf under `group`, walking `children` or `displayedChildren` (`displayed`) — the * `get(Displayed)LeafColumns()` edge without allocating the array; `null` if empty. */ export declare const edgeLeafColumn: (group: AgColumnGroup, displayed: boolean, last: boolean) => AgColumn | null; /** Walk up `column`'s parent chain to the group sitting at header-row `level`. */ export declare const getColGroupAtLevel: (column: AgColumn, level: number) => AgColumnGroup | null; /** The displayed group at `columnGroup`'s level just after it, or null. */ export declare const getColGroupAfter: (visibleCols: VisibleColsService, columnGroup: AgColumnGroup) => AgColumnGroup | null;