ag-grid-community
Version:
Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue
231 lines (230 loc) • 10.8 kB
TypeScript
import { BeanStub } from '../../context/beanStub';
import type { BeanCollection } from '../../context/context';
import type { AgColumn } from '../../entities/agColumn';
import type { RowStyle } from '../../entities/gridOptions';
import type { RowNode } from '../../entities/rowNode';
import type { AgEventType } from '../../eventTypes';
import type { CellFocusedEvent, RowEvent } from '../../events';
import type { RowContainerType } from '../../gridBodyComp/rowContainer/rowContainerCtrl';
import type { PinnedSectionWidths } from '../../headerRendering/headerUtils';
import type { BrandedType } from '../../interfaces/brandedType';
import type { RenderedRowEvent } from '../../interfaces/iCallbackParams';
import type { RefreshRowsParams } from '../../interfaces/iCellsParams';
import type { ColumnPinnedType } from '../../interfaces/iColumn';
import type { HorizontalSection, HorizontalSectionMap } from '../../interfaces/iGridSection';
import type { RowPosition } from '../../interfaces/iRowPosition';
import type { IRowStyleFeature } from '../../interfaces/iRowStyleFeature';
import type { UserCompDetails } from '../../interfaces/iUserCompDetails';
import { CellCtrl } from '../cell/cellCtrl';
import type { ICellRenderer, ICellRendererParams } from '../cellRenderers/iCellRenderer';
import type { FullWidthTarget } from './iRowModeFeature';
type RowType = 'Normal' | 'FullWidth' | 'FullWidthLoading' | 'FullWidthGroup' | 'FullWidthDetail';
export type RowCtrlInstanceId = BrandedType<string, 'RowCtrlInstanceId'>;
/** @internal AG_GRID_INTERNAL - Not for public use. Can change / be removed at any time. */
export interface IRowComp {
setDomOrder(domOrder: boolean): void;
toggleCss(cssClassName: string, on: boolean): void;
setCellCtrls(cellCtrls: CellCtrl[], useFlushSync: boolean): void;
getPinnedLeftRowElement(): HTMLElement | undefined;
getScrollingRowElement(): HTMLElement | undefined;
getPinnedRightRowElement(): HTMLElement | undefined;
refreshPinnedSections(): void;
showFullWidth(compDetails: UserCompDetails): void;
showEmbeddedFullWidth?(compDetails: HorizontalSectionMap<UserCompDetails>): void;
getFullWidthCellRenderers(): (ICellRenderer | null | undefined)[];
getFullWidthCellRendererParams(): ICellRendererParams | undefined;
getFullWidthCellRendererParamsForPinned?(pinned: ColumnPinnedType): ICellRendererParams | undefined;
setTop(top: string): void;
setTransform(transform: string): void;
setRowIndex(rowIndex: string): void;
setRowId(rowId: string): void;
setRowBusinessKey(businessKey: string): void;
setUserStyles(styles: RowStyle | undefined): void;
refreshFullWidth(getUpdatedParams: () => ICellRendererParams): boolean;
refreshEmbeddedFullWidth?(getUpdatedParams: (pinned: ColumnPinnedType) => ICellRendererParams): boolean;
}
/** @internal AG_GRID_INTERNAL - Not for public use. Can change / be removed at any time. */
export interface RowGui {
rowComp: IRowComp;
element: HTMLElement;
containerType: RowContainerType;
compBean: BeanStub;
}
/** @internal AG_GRID_INTERNAL - Not for public use. Can change / be removed at any time. */
export type PinnedCellGroupWidths = PinnedSectionWidths;
interface MappedPinnedCellGroupWidths extends PinnedCellGroupWidths {
renderLeft: boolean;
renderRight: boolean;
}
type RowCtrlEvent = RenderedRowEvent;
/** @internal AG_GRID_INTERNAL - Not for public use. Can change / be removed at any time. */
export declare class RowCtrl extends BeanStub<RowCtrlEvent> {
readonly rowNode: RowNode;
readonly useAnimationFrameForCreate: boolean;
readonly printLayout: boolean;
readonly instanceId: RowCtrlInstanceId;
private rowType;
private rowGui;
private readonly rowModeFeature;
private firstRowOnPage;
private lastRowOnPage;
private active;
private rowFocused;
private slideInAnimation;
private fadeInAnimation;
private rowDragComps;
private paginationPage;
private lastMouseDownOnDragger;
private rowLevel;
rowStyles: RowStyle;
private readonly emptyStyle;
private readonly suppressRowTransform;
rowId: string | null;
ariaRowIndex: number | null;
/** sanitised */
businessKey: string | null;
private businessKeyForNodeFunc;
rowEditStyleFeature?: IRowStyleFeature;
isEmbeddedFullWidth: boolean;
embeddedSectionHasContent: HorizontalSectionMap<boolean>;
constructor(rowNode: RowNode, beans: BeanCollection, animateIn: boolean, useAnimationFrameForCreate: boolean, printLayout: boolean);
private createRowModeFeature;
private initRowBusinessKey;
private updateRowBusinessKey;
setComp(rowComp: IRowComp, element: HTMLElement, containerType: RowContainerType, compBean: BeanStub<any> | undefined): void;
unsetComp(containerType: RowContainerType): void;
isCacheable(): boolean;
setCached(cached: boolean): void;
private initialiseRowComp;
private setRowCompRowBusinessKey;
private setRowCompRowId;
private executeSlideAndFadeAnimations;
private addRowDraggerToRow;
getModeCellRenderers(): (ICellRenderer<any> | null | undefined)[];
private executeProcessRowPostCreateFunc;
private isNodeFullWidthCell;
private setRowType;
/**
* Overridden by SpannedRowCtrl
*/
getNewCellCtrl(col: AgColumn): CellCtrl | undefined;
/**
* Overridden by SpannedRowCtrl, if span context changes cell needs rebuilt
*/
isCorrectCtrlForSpan(cell: CellCtrl): boolean;
setEmbeddedSectionHasContent(section: HorizontalSection, hasContent: boolean): void;
refreshPinnedCellGroupWidths(): void;
getMappedPinnedCellGroupWidths(): MappedPinnedCellGroupWidths;
getPinnedCellGroupWidths(): PinnedCellGroupWidths;
/**
* CellCtrls for rows whose normal-mode feature eagerly created cells in the constructor.
* React uses this to seed first render and avoid an empty row flash on bulk add.
*/
getInitialCellCtrls(containerType: RowContainerType): CellCtrl[] | null;
getDomOrder(): boolean;
private listenOnDomOrder;
private setAnimateFlags;
isFullWidth(): boolean;
/** Called by NormalRowFeature after refreshing cells */
onNormalRowRefreshed(): void;
getCurrentRowComp(): IRowComp | undefined;
getCurrentRowElement(): HTMLElement | undefined;
redrawThisRow(): void;
getRowType(): RowType;
getContainerType(): RowContainerType | undefined;
shouldCreateCellSections(): boolean;
getNotesFeature(): import("../../main-umd-noStyles").INotesFeature | undefined;
private addListeners;
/** Should only ever be triggered on source rows (i.e. not on pinned siblings) */
private onRowPinned;
private onRowNodeDataChanged;
refreshRow(params?: RefreshRowsParams & {
newData?: boolean;
}): void;
private postProcessCss;
private onRowNodeHighlightChanged;
private postProcessRowDragging;
private onDisplayedColumnsChanged;
private onVirtualColumnsChanged;
getRowPosition(): RowPosition;
onKeyboardNavigate(keyboardEvent: KeyboardEvent): void;
onTabKeyDown(keyboardEvent: KeyboardEvent): void;
getRowContentElement(): HTMLElement | null;
getNavigationColumn(): AgColumn;
getRowYPosition(): number;
onSuppressCellFocusChanged(suppressCellFocus: boolean): void;
onRowFocused(event?: CellFocusedEvent): void;
recreateCell(cellCtrl: CellCtrl): void;
onMouseEvent(eventName: string, mouseEvent: MouseEvent): void;
createRowEvent<T extends AgEventType>(type: T, domEvent?: Event): RowEvent<T>;
private createRowEventWithSource;
private onRowDblClick;
findInfoForEvent(event?: Event): {
column: AgColumn;
pinned: ColumnPinnedType;
} | undefined;
getTargets(): FullWidthTarget[];
getTarget(element?: EventTarget | null): FullWidthTarget | undefined;
private onRowMouseDown;
isSuppressMouseEvent(mouseEvent: MouseEvent): boolean;
onRowClick(mouseEvent: MouseEvent): void;
setupDetailRowAutoHeight(eDetailGui: HTMLElement): void;
private onUiLevelChanged;
private isFirstRowOnPage;
private isLastRowOnPage;
protected refreshFirstAndLastRowStyles(): void;
getAllCellCtrls(): CellCtrl[];
private postProcessClassesFromGridOptions;
private postProcessRowClassRules;
private setStylesFromGridOptions;
protected getInitialRowClasses(): string[];
private processStylesFromGridOptions;
private onRowSelected;
announceDescription(cellCtrl?: CellCtrl): void;
private announceNoteDescription;
protected addHoverFunctionality(eGui: RowGui): void;
resetHoveredStatus(el?: HTMLElement): void;
getGui(): RowGui | undefined;
private roundRowTopToBounds;
isRowRendered(): boolean;
protected onRowHeightChanged(): void;
destroyFirstPass(suppressAnimation?: boolean): void;
destroySecondPass(): void;
private setFocusedClasses;
private onCellFocusChanged;
private onPinnedRowsChanged;
private onPaginationChanged;
private onTopChanged;
private onPaginationPixelOffsetChanged;
private onStickyBottomOffsetChanged;
/**
* Applies pagination offset, eg if on second page, and page height is 500px, then removes
* 500px from the top position, so a row with rowTop 600px is displayed at location 100px.
* reverse will take the offset away rather than add.
*/
private applyPaginationOffset;
setRowTop(pixels: number): void;
/**
* Applies pagination offset and pixel scaling to produce final top position.
* Rows are positioned relative to their container, not the section.
*/
private calculateRowTopPx;
/**
* The top needs to be set into the DOM element when the element is created, not updated afterwards.
* otherwise the transition would not work, as it would be transitioning from zero (the unset value).
* for example, suppose a row that is outside the viewport, then user does a filter to remove other rows
* and this row now appears in the viewport, and the row moves up (ie it was under the viewport and not rendered,
* but now is in the viewport) then a new RowComp is created, however it should have it's position initialised
* to below the viewport, so the row will appear to animate up. if we didn't set the initial position at creation
* time, the row would animate down (ie from position zero).
*/
getInitialRowTop(): string | undefined;
getInitialTransform(): string | undefined;
private getInitialRowTopShared;
private getCalculatedRowTop;
private setRowTopStyle;
getCellCtrl(column: AgColumn, skipColSpanSearch?: boolean): CellCtrl | null;
protected onRowIndexChanged(): void;
private updateRowIndexes;
}
export {};