igniteui-angular
Version:
Ignite UI for Angular is a dependency-free Angular toolkit for building modern web apps
440 lines (439 loc) • 13.5 kB
TypeScript
import { AfterContentInit, AfterViewInit, ChangeDetectorRef, DoCheck, ElementRef, OnDestroy, OnInit, QueryList, TemplateRef, ViewContainerRef } from '@angular/core';
import { IgxHierarchicalGridAPIService } from './hierarchical-grid-api.service';
import { IgxRowIslandComponent } from './row-island.component';
import { IgxColumnComponent } from '../columns/column.component';
import { IgxHierarchicalGridBaseDirective } from './hierarchical-grid-base.directive';
import { CellType, GridType, RowType } from '../common/grid.interface';
import type { IgxPaginatorComponent } from '../../paginator/paginator.component';
import { IgxGridExcelStyleFilteringComponent } from '../filtering/excel-style/excel-style-filtering.component';
import { IgxActionStripToken } from '../../action-strip/token';
import * as i0 from "@angular/core";
/**
* @hidden @internal
*/
export declare class IgxChildGridRowComponent implements AfterViewInit, OnInit {
readonly gridAPI: IgxHierarchicalGridAPIService;
element: ElementRef<HTMLElement>;
cdr: ChangeDetectorRef;
layout: IgxRowIslandComponent;
/**
* @hidden
*/
get parentHasScroll(): boolean;
/**
* @hidden
*/
parentGridID: string;
/**
* The data passed to the row component.
*
* ```typescript
* // get the row data for the first selected row
* let selectedRowData = this.grid.selectedRows[0].data;
* ```
*/
get data(): any;
set data(value: any);
/**
* The index of the row.
*
* ```typescript
* // get the index of the second selected row
* let selectedRowIndex = this.grid.selectedRows[1].index;
* ```
*/
index: number;
container: ViewContainerRef;
/**
* @hidden
*/
hGrid: IgxHierarchicalGridComponent;
/**
* Get a reference to the grid that contains the selected row.
*
* ```typescript
* handleRowSelection(event) {
* // the grid on which the rowSelected event was triggered
* const grid = event.row.grid;
* }
* ```
*
* ```html
* <igx-grid
* [data]="data"
* (rowSelected)="handleRowSelection($event)">
* </igx-grid>
* ```
*/
get parentGrid(): IgxHierarchicalGridComponent;
get level(): number;
/**
* The native DOM element representing the row. Could be null in certain environments.
*
* ```typescript
* // get the nativeElement of the second selected row
* let selectedRowNativeElement = this.grid.selectedRows[1].nativeElement;
* ```
*/
get nativeElement(): HTMLElement;
/**
* Returns whether the row is expanded.
* ```typescript
* const RowExpanded = this.grid1.rowList.first.expanded;
* ```
*/
expanded: boolean;
private _data;
constructor(gridAPI: IgxHierarchicalGridAPIService, element: ElementRef<HTMLElement>, cdr: ChangeDetectorRef);
/**
* @hidden
*/
ngOnInit(): void;
/**
* @hidden
*/
ngAfterViewInit(): void;
private setupEventEmitters;
private _handleLayoutChanges;
static ɵfac: i0.ɵɵFactoryDeclaration<IgxChildGridRowComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<IgxChildGridRowComponent, "igx-child-grid-row", never, { "layout": { "alias": "layout"; "required": false; }; "parentGridID": { "alias": "parentGridID"; "required": false; }; "data": { "alias": "data"; "required": false; }; "index": { "alias": "index"; "required": false; }; }, {}, never, never, true, never>;
}
/**
* Hierarchical grid
*
* @igxModule IgxHierarchicalGridModule
*
*/
export declare class IgxHierarchicalGridComponent extends IgxHierarchicalGridBaseDirective implements GridType, AfterViewInit, AfterContentInit, OnInit, OnDestroy, DoCheck {
/**
* @hidden @internal
*/
role: string;
/**
* @hidden
*/
childLayoutList: QueryList<IgxRowIslandComponent>;
/**
* @hidden
*/
allLayoutList: QueryList<IgxRowIslandComponent>;
/** @hidden @internal */
paginatorList: QueryList<IgxPaginatorComponent>;
/** @hidden @internal */
toolbarOutlet: ViewContainerRef;
/** @hidden @internal */
paginatorOutlet: ViewContainerRef;
/**
* @hidden
*/
templateOutlets: QueryList<any>;
/**
* @hidden
*/
hierarchicalRows: QueryList<IgxChildGridRowComponent>;
protected hierarchicalRecordTemplate: TemplateRef<any>;
protected childTemplate: TemplateRef<any>;
protected get headerHierarchyExpander(): ElementRef<HTMLElement>;
/**
* @hidden
*/
childLayoutKeys: any[];
/** @hidden @internal */
dataSetByUser: boolean;
/**
* @hidden
*/
highlightedRowID: any;
/**
* @hidden
*/
updateOnRender: boolean;
/**
* @hidden
*/
parent: IgxHierarchicalGridComponent;
/**
* @hidden @internal
*/
childRow: IgxChildGridRowComponent;
protected actionStripComponents: QueryList<IgxActionStripToken>;
/** @hidden @internal */
get actionStrip(): IgxActionStripToken;
private _data;
private h_id;
private childGridTemplates;
/**
* Gets/Sets the value of the `id` attribute.
*
* @remarks
* If not provided it will be automatically generated.
* @example
* ```html
* <igx-hierarchical-grid [id]="'igx-hgrid-1'" [data]="Data" [autoGenerate]="true"></igx-hierarchical-grid>
* ```
*/
get id(): string;
set id(value: string);
/**
* Gets/Sets the array of data that populates the component.
* ```html
* <igx-hierarchical-grid [data]="Data" [autoGenerate]="true"></igx-hierarchical-grid>
* ```
*
* @memberof IgxHierarchicalGridComponent
*/
set data(value: any[] | null);
/**
* Returns an array of data set to the `IgxHierarchicalGridComponent`.
* ```typescript
* let filteredData = this.grid.filteredData;
* ```
*
* @memberof IgxHierarchicalGridComponent
*/
get data(): any[] | null;
/** @hidden @internal */
get paginator(): IgxPaginatorComponent;
/** @hidden @internal */
get excelStyleFilteringComponent(): IgxGridExcelStyleFilteringComponent;
/**
* Gets/Sets the total number of records in the data source.
*
* @remarks
* This property is required for remote grid virtualization to function when it is bound to remote data.
* @example
* ```typescript
* const itemCount = this.grid1.totalItemCount;
* this.grid1.totalItemCount = 55;
* ```
*/
set totalItemCount(count: number);
get totalItemCount(): number;
/**
* Sets if all immediate children of the `IgxHierarchicalGridComponent` should be expanded/collapsed.
* Default value is false.
* ```html
* <igx-hierarchical-grid [id]="'igx-grid-1'" [data]="Data" [autoGenerate]="true" [expandChildren]="true"></igx-hierarchical-grid>
* ```
*
* @memberof IgxHierarchicalGridComponent
*/
set expandChildren(value: boolean);
/**
* Gets if all immediate children of the `IgxHierarchicalGridComponent` previously have been set to be expanded/collapsed.
* If previously set and some rows have been manually expanded/collapsed it will still return the last set value.
* ```typescript
* const expanded = this.grid.expandChildren;
* ```
*
* @memberof IgxHierarchicalGridComponent
*/
get expandChildren(): boolean;
/**
* Gets the unique identifier of the parent row. It may be a `string` or `number` if `primaryKey` of the
* parent grid is set or an object reference of the parent record otherwise.
* ```typescript
* const foreignKey = this.grid.foreignKey;
* ```
*
* @memberof IgxHierarchicalGridComponent
*/
get foreignKey(): any;
/**
* @hidden
*/
get hasExpandableChildren(): boolean;
/**
* @hidden
*/
get resolveRowEditContainer(): TemplateRef<import("../common/grid.interface").IgxGridRowEditTemplateContext>;
/**
* @hidden
*/
get resolveRowEditActions(): TemplateRef<import("../common/grid.interface").IgxGridRowEditActionsTemplateContext>;
/**
* @hidden
*/
get resolveRowEditText(): TemplateRef<import("../common/grid.interface").IgxGridRowEditTextTemplateContext>;
/** @hidden */
hideActionStrip(): void;
/**
* @hidden
*/
get parentRowOutletDirective(): any;
/**
* @hidden
*/
ngOnInit(): void;
/**
* @hidden
*/
ngAfterViewInit(): void;
/**
* @hidden
*/
ngAfterContentInit(): void;
/**
* Returns the `RowType` by index.
*
* @example
* ```typescript
* const myRow = this.grid1.getRowByIndex(1);
* ```
* @param index
*/
getRowByIndex(index: number): RowType;
/**
* Returns the `RowType` by key.
*
* @example
* ```typescript
* const myRow = this.grid1.getRowByKey(1);
* ```
* @param key
*/
getRowByKey(key: any): RowType;
/**
* @hidden @internal
*/
allRows(): RowType[];
/**
* Returns the collection of `IgxHierarchicalGridRow`s for current page.
*
* @hidden @internal
*/
dataRows(): RowType[];
/**
* Returns an array of the selected `IgxGridCell`s.
*
* @example
* ```typescript
* const selectedCells = this.grid.selectedCells;
* ```
*/
get selectedCells(): CellType[];
/**
* Returns a `CellType` object that matches the conditions.
*
* @example
* ```typescript
* const myCell = this.grid1.getCellByColumn(2, "UnitPrice");
* ```
* @param rowIndex
* @param columnField
*/
getCellByColumn(rowIndex: number, columnField: string): CellType;
/**
* Returns a `CellType` object that matches the conditions.
*
* @remarks
* Requires that the primaryKey property is set.
* @example
* ```typescript
* grid.getCellByKey(1, 'index');
* ```
* @param rowSelector match any rowID
* @param columnField
*/
getCellByKey(rowSelector: any, columnField: string): CellType;
pinRow(rowID: any, index?: number): boolean;
/** @hidden @internal */
setDataInternal(value: any): void;
unpinRow(rowID: any): boolean;
/**
* @hidden @internal
*/
dataLoading(event: any): void;
/** @hidden */
featureColumnsWidth(): number;
/**
* @hidden
*/
onRowIslandChange(): void;
/** @hidden @internal **/
ngOnDestroy(): void;
/**
* @hidden
*/
isRowHighlighted(rowData: any): boolean;
/**
* @hidden
*/
isHierarchicalRecord(record: any): boolean;
/**
* @hidden
*/
isChildGridRecord(record: any): boolean;
/**
* @hidden
*/
trackChanges(index: any, rec: any): any;
/**
* @hidden
*/
getContext(rowData: any, rowIndex: any, pinned: any): any;
/**
* @hidden
*/
get rootGrid(): GridType;
/**
* @hidden
*/
get iconTemplate(): TemplateRef<any>;
/**
* @hidden
* @internal
*/
getDragGhostCustomTemplate(): TemplateRef<any>;
/**
* @hidden
* Gets the visible content height that includes header + tbody + footer.
* For hierarchical child grid it may be scrolled and not fully visible.
*/
getVisibleContentHeight(): any;
/**
* @hidden
*/
toggleAll(): void;
/**
* @hidden
* @internal
*/
hasExpandedRecords(): boolean;
getDefaultExpandState(record: any): boolean;
/**
* @hidden
*/
isExpanded(record: any): boolean;
/**
* @hidden
*/
viewCreatedHandler(args: any): void;
/**
* @hidden
*/
viewMovedHandler(args: any): void;
/** @hidden @internal **/
onContainerScroll(): void;
/**
* @hidden
*/
createRow(index: number, data?: any): RowType;
/** @hidden @internal */
getChildGrids(inDeph?: boolean): GridType[];
protected generateDataFields(data: any[]): string[];
protected resizeNotifyHandler(): void;
/**
* @hidden
*/
protected initColumns(collection: IgxColumnComponent[], cb?: (args: any) => void): void;
protected setupColumns(): void;
protected getColumnList(): IgxColumnComponent[];
protected onColumnsChanged(): void;
protected _shouldAutoSize(renderedHeight: any): boolean;
private updateColumnList;
private _clearSeletionHighlights;
static ɵfac: i0.ɵɵFactoryDeclaration<IgxHierarchicalGridComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<IgxHierarchicalGridComponent, "igx-hierarchical-grid", never, { "id": { "alias": "id"; "required": false; }; "data": { "alias": "data"; "required": false; }; "totalItemCount": { "alias": "totalItemCount"; "required": false; }; "expandChildren": { "alias": "expandChildren"; "required": false; }; }, {}, ["childLayoutList", "allLayoutList", "paginatorList", "actionStripComponents"], ["igx-grid-toolbar,igc-grid-toolbar", "igx-grid-footer,igc-grid-footer", "igx-paginator,igc-paginator", "igx-grid-state,igc-grid-state", "igx-column,igc-column,igx-column-group,igc-column-group,igx-action-strip,igc-action-strip", "igx-row-island,igc-row-island"], true, never>;
static ngAcceptInputType_expandChildren: unknown;
}