ag-grid-community
Version:
Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue
36 lines (35 loc) • 2.14 kB
TypeScript
import type { NamedBean } from '../context/bean';
import { BeanStub } from '../context/beanStub';
import type { AgColumn } from '../entities/agColumn';
import type { AgColumnGroup } from '../entities/agColumnGroup';
import type { ColKey } from '../entities/colDef';
import type { ColumnEventType } from '../events';
import { SetPinnedWidthFeature } from '../gridBodyComp/rowContainer/setPinnedWidthFeature';
import type { ColumnPinnedType } from '../interfaces/iColumn';
/** Minimum center viewport width (in px) reserved when pinned columns are present. */
export declare const MIN_CENTER_VIEWPORT_WIDTH = 50;
export declare class PinnedColumnService extends BeanStub implements NamedBean {
beanName: "pinnedCols";
private gridBodyCtrl?;
leftWidth: number;
rightWidth: number;
postConstruct(): void;
private checkContainerWidths;
keepPinnedColumnsNarrowerThanViewport(): void;
createPinnedWidthFeature(isLeft: boolean, ...elements: (HTMLElement | undefined)[]): SetPinnedWidthFeature;
setColsPinned(keys: ColKey[], pinned: ColumnPinnedType, source: ColumnEventType): void;
initCol(column: AgColumn): void;
setColPinned(column: AgColumn, pinned: ColumnPinnedType, source: ColumnEventType): void;
/**
* `change` to a user resize of `column`, held to the pinned room: a pinned column grows, or a centre one shrinks into
* a pinned neighbour, only as far as the room left, counting as free what the resize took since `startWidth`.
*/
limitResize(column: AgColumn | AgColumnGroup, takeFromAdjacent: boolean, change: number, startWidth?: number): number;
/** Whether an auto-size from `source` stops at the pinned room: a resize handle's or a menu's does, the API's not. */
limitsAutoSize(source: ColumnEventType): boolean;
/** How much wider the pinned columns can grow before the centre narrows below its minimum, `freed` px of them not
* counted. Reads the observed viewport width, not the layout, so a drag can ask on every move. */
getPinnedRoom(freed: number): number;
private isNextPinned;
private getPinnedColumnsOverflowingViewport;
}