UNPKG

ag-grid-community

Version:

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

133 lines (132 loc) • 6.55 kB
import { BeanStub } from '../context/beanStub'; import type { BeanCollection } from '../context/context'; import type { VerticalSection } from '../interfaces/iGridSection'; import type { LayoutView } from '../styling/layoutFeature'; import { GridBodyScrollFeature } from './gridBodyScrollFeature'; export interface PinnedSectionState { height: number; invisible: boolean; } /** @internal AG_GRID_INTERNAL - Not for public use. Can change / be removed at any time. */ export interface IGridBodyComp extends LayoutView { setColumnMovingCss(cssClass: string, on: boolean): void; setCellSelectableCss(cssClass: string | null, on: boolean): void; setPinnedSection(section: VerticalSection, state: PinnedSectionState): void; setStickyBottomHeight(height: string): void; setStickyBottomWidth(width: string): void; setColumnCount(count: number): void; setRowCount(count: number): void; setRowAnimationCssOnScrollableArea(animate: boolean): void; setPreventRowAnimationCssOnContainers(prevent: boolean): void; setGridScrollableAreaWidth(width: string): void; setPinnedColumnsOverflowing(overflowing: boolean): void; setGridRole(role: 'grid' | 'treegrid'): void; } /** @internal AG_GRID_INTERNAL - Not for public use. Can change / be removed at any time. */ export declare class GridBodyCtrl extends BeanStub { private ctrlsSvc; private colModel; private scrollVisibleSvc; private rowGroupColsSvc?; private pinnedRowModel?; private filterManager?; wireBeans(beans: BeanCollection): void; private comp; eGridBody: HTMLElement; eGridViewport: HTMLElement; eScrollingRows: HTMLElement; isTreeGrid: boolean; private eTop; private eTopExtraRows; private eBottom; private topPinnedRowsHeight; private bottomPinnedRowsHeight; stickyTopHeight: number; stickyBottomHeight: number; private reportedViewportWidth; private scrollableAreaWidth; private pinnedLeftWidth; private pinnedRightWidth; scrollFeature: GridBodyScrollFeature; private columnWidthAnimationDepth; private columnWidthAnimationTimeout; setComp(comp: IGridBodyComp, eGridBody: HTMLElement, eGridViewport: HTMLElement, eScrollingRows: HTMLElement, eTop: HTMLElement, eTopExtraRows: HTMLElement, eBottom: HTMLElement): void; private addEventListeners; private toggleRowResizeStyles; private onGridColumnsChanged; private onScrollVisibilityChanged; private updateViewportGeometry; /** The one place the horizontal widths are worked out; consumers are pushed the result. */ private updateWidths; getHorizontalContentWidth(pinnedColumnsOverflowing: boolean, verticalScrollShowing?: boolean): number; /** Raw width of the displayed columns, without the scroll-range adjustments of `getHorizontalContentWidth`. */ getColumnsWidth(): number; isPinnedWidthOverflowingViewport(viewportWidth: number | undefined, verticalScrollShowing?: boolean): boolean; private getPinnedWidth; /** For sizes re-pushed whenever the width changes, so they cannot be fresher than the report driving * them. Anything whose result outlives the frame must measure instead. */ getReportedViewportWidth(): number; /** Measured on demand: a resize reaches the grid asynchronously, so a width kept past the call that * took it can be the pre-resize one. */ getHorizontalViewportWidth(): number; /** A non-positive width means "not laid out yet", not a width: taken as one it would report every * pinned column as overflowing the viewport. */ refreshViewportWidth(width: number): boolean; getViewportWidthWithoutScrollbar(viewportWidth?: number, verticalScrollShowing?: boolean): number; getCenterWidth(viewportWidth?: number): number; /** Measurement-free, and 0 until something has reported a positive viewport width. */ getReportedCenterWidth(): number; getHorizontalScrollLeft(): number; setHorizontalScrollLeft(value: number): void; getHorizontalScrollPosition(): { left: number; right: number; }; /** Pass values already held by the caller so a scroll does not read them back from the DOM, and a * synchronous layout measurement is not replaced by the last asynchronously reported width. */ updateColumnViewport(afterScroll?: boolean, scrollLeft?: number, centerWidth?: number): void; private updateGridViewportWidth; private setGridRole; private addFocusListeners; setColumnMovingCss(moving: boolean): void; /** Animates the column widths and positions laid out until the matching `finishColumnWidthAnimation`; nestable. */ startColumnWidthAnimation(): void; /** * `skipTransition` removes the class before any style recalc sees it, so nothing laid out since animates. It does * so even while an outer window, such as a pending async auto-size, is still open. */ finishColumnWidthAnimation(skipTransition?: boolean): void; /** Ends any open or lingering animation window so widths written next apply immediately. */ cancelColumnWidthAnimation(): void; private removeColumnWidthAnimation; setCellTextSelection(selectable?: boolean): void; private updateScrollingClasses; /** Read by the sticky group header labels' offsets. */ private updatePinnedWidths; private updatePinnedColumnStickyOffsets; private disableBrowserDragging; private addStopEditingWhenGridLosesFocus; updateRowCount(): void; private setupRowAnimationCssClass; private addBodyViewportListener; private onStickyWheel; private onBodyViewportContextMenu; private onBodyViewportWheel; scrollVertically(pixels: number): number; private setPinnedRowsHeights; private refreshTopSection; private refreshBottomSection; setStickyTopHeight(height?: number): void; setStickyBottomHeight(height?: number): void; private updateStickyRowsHeightAdjustment; private setStickyWidth; getHeaderRowsOffset(): number; getTopPinnedRowsOffset(): number; getBottomPinnedRowsOffset(): number; getBodyViewportHeight(totalViewportHeight: number): number; /** Total scroll content height calculated from JS values. Used by FakeVScrollComp * to avoid reading eGridViewport.scrollHeight which can return stale intermediate values. */ getScrollContentHeight(viewportHeight: number): number; getVerticalScrollbarWidth(verticalScrollShowing?: boolean): number; getHorizontalScrollbarHeight(): number; }