UNPKG

igniteui-angular

Version:

Ignite UI for Angular is a dependency-free Angular toolkit for building modern web apps

542 lines (541 loc) 15.1 kB
import { ChangeDetectorRef, ElementRef, TemplateRef, NgZone, OnInit, OnDestroy, OnChanges, SimpleChanges, QueryList, AfterViewInit } from '@angular/core'; import { FormControl, FormGroup } from '@angular/forms'; import { IgxTextHighlightDirective } from '../directives/text-highlight/text-highlight.directive'; import { PlatformUtil } from '../core/utils'; import { IgxGridSelectionService } from './selection/selection.service'; import { HammerGesturesManager } from '../core/touch'; import { GridSelectionMode } from './common/enums'; import { CellType, ColumnType, GridType, IgxCellTemplateContext, RowType } from './common/grid.interface'; import { IgxRowDirective } from './row.directive'; import { ISearchInfo } from './common/events'; import { ISelectionNode } from './common/types'; import { IgxOverlayService } from '../services/public_api'; import { IgxIconComponent } from '../icon/icon.component'; import { IgxTooltipDirective } from '../directives/tooltip/tooltip.directive'; import * as i0 from "@angular/core"; /** * Providing reference to `IgxGridCellComponent`: * ```typescript * @ViewChild('grid', { read: IgxGridComponent }) * public grid: IgxGridComponent; * ``` * ```typescript * let column = this.grid.columnList.first; * ``` * ```typescript * let cell = column.cells[0]; * ``` */ export declare class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy, CellType, AfterViewInit { protected selectionService: IgxGridSelectionService; grid: GridType; protected overlayService: IgxOverlayService; cdr: ChangeDetectorRef; private element; protected zone: NgZone; private touchManager; protected platformUtil: PlatformUtil; private _destroy$; /** * @hidden * @internal */ get isEmptyAddRowCell(): boolean; /** * @hidden * @internal */ errorTooltip: QueryList<IgxTooltipDirective>; /** * @hidden * @internal */ errorIcon: IgxIconComponent; /** * Gets the default error template. * @hidden @internal */ defaultErrorTemplate: TemplateRef<any>; /** * Gets the column of the cell. * ```typescript * let cellColumn = this.cell.column; * ``` * * @memberof IgxGridCellComponent */ column: ColumnType; /** * @hidden * @internal */ protected get formGroup(): FormGroup; /** * @hidden * @internal */ intRow: IgxRowDirective; /** * Gets the row of the cell. * ```typescript * let cellRow = this.cell.row; * ``` * * @memberof IgxGridCellComponent */ get row(): RowType; /** * Gets the data of the row of the cell. * ```typescript * let rowData = this.cell.rowData; * ``` * * @memberof IgxGridCellComponent */ rowData: any; /** * @hidden * @internal */ columnData: any; /** * Sets/gets the template of the cell. * ```html * <ng-template #cellTemplate igxCell let-value> * <div style="font-style: oblique; color:blueviolet; background:red"> * <span>{{value}}</span> * </div> * </ng-template> * ``` * ```typescript * @ViewChild('cellTemplate',{read: TemplateRef}) * cellTemplate: TemplateRef<any>; * ``` * ```typescript * this.cell.cellTemplate = this.cellTemplate; * ``` * ```typescript * let template = this.cell.cellTemplate; * ``` * * @memberof IgxGridCellComponent */ cellTemplate: TemplateRef<any>; cellValidationErrorTemplate: TemplateRef<any>; pinnedIndicator: TemplateRef<any>; /** * Sets/gets the cell value. * ```typescript * this.cell.value = "Cell Value"; * ``` * ```typescript * let cellValue = this.cell.value; * ``` * * @memberof IgxGridCellComponent */ value: any; /** * Gets the cell formatter. * ```typescript * let cellForamatter = this.cell.formatter; * ``` * * @memberof IgxGridCellComponent */ formatter: (value: any, rowData?: any, columnData?: any) => any; /** * Gets the cell template context object. * ```typescript * let context = this.cell.context(); * ``` * * @memberof IgxGridCellComponent */ get context(): IgxCellTemplateContext; /** * Gets the cell template. * ```typescript * let template = this.cell.template; * ``` * * @memberof IgxGridCellComponent */ get template(): TemplateRef<any>; /** * Gets the pinned indicator template. * ```typescript * let template = this.cell.pinnedIndicatorTemplate; * ``` * * @memberof IgxGridCellComponent */ get pinnedIndicatorTemplate(): TemplateRef<any>; /** * Gets the `id` of the grid in which the cell is stored. * ```typescript * let gridId = this.cell.gridID; * ``` * * @memberof IgxGridCellComponent */ get gridID(): any; /** * Gets the `index` of the row where the cell is stored. * ```typescript * let rowIndex = this.cell.rowIndex; * ``` * * @memberof IgxGridCellComponent */ get rowIndex(): number; /** * Gets the `index` of the cell column. * ```typescript * let columnIndex = this.cell.columnIndex; * ``` * * @memberof IgxGridCellComponent */ get columnIndex(): number; /** * Returns the column visible index. * ```typescript * let visibleColumnIndex = this.cell.visibleColumnIndex; * ``` * * @memberof IgxGridCellComponent */ get visibleColumnIndex(): number; set visibleColumnIndex(val: number); /** * Gets the ID of the cell. * ```typescript * let cellID = this.cell.cellID; * ``` * * @memberof IgxGridCellComponent */ get cellID(): { rowID: any; columnID: number; rowIndex: number; }; get attrCellID(): string; get title(): any; get booleanClass(): any; /** * Returns a reference to the nativeElement of the cell. * ```typescript * let cellNativeElement = this.cell.nativeElement; * ``` * * @memberof IgxGridCellComponent */ get nativeElement(): HTMLElement; /** * @hidden * @internal */ get cellSelectionMode(): GridSelectionMode; set cellSelectionMode(value: GridSelectionMode); /** * @hidden * @internal */ set lastSearchInfo(value: ISearchInfo); /** * @hidden * @internal */ lastPinned: boolean; /** * @hidden * @internal */ firstPinned: boolean; /** * Returns whether the cell is in edit mode. */ editMode: boolean; /** * Sets/get the `role` property of the cell. * Default value is `"gridcell"`. * ```typescript * this.cell.role = 'grid-cell'; * ``` * ```typescript * let cellRole = this.cell.role; * ``` * * @memberof IgxGridCellComponent */ role: string; /** * Gets whether the cell is editable. * ```typescript * let isCellReadonly = this.cell.readonly; * ``` * * @memberof IgxGridCellComponent */ get readonly(): boolean; /** @hidden @internal */ get ariaDescribeBy(): string; /** @hidden @internal */ get ariaErrorMessage(): string; /** * @hidden * @internal */ get isInvalid(): boolean; /** * @hidden * @internal */ get isValidAfterEdit(): boolean; /** * Gets the formControl responsible for value changes and validation for this cell. */ protected get formControl(): FormControl; get gridRowSpan(): number; get gridColumnSpan(): number; get rowEnd(): number; get colEnd(): number; get rowStart(): number; get colStart(): number; /** * Gets the width of the cell. * ```typescript * let cellWidth = this.cell.width; * ``` * * @memberof IgxGridCellComponent */ width: string; /** * @hidden */ active: boolean; get ariaSelected(): boolean; /** * Gets whether the cell is selected. * ```typescript * let isSelected = this.cell.selected; * ``` * * @memberof IgxGridCellComponent */ get selected(): boolean; /** * Selects/deselects the cell. * ```typescript * this.cell.selected = true. * ``` * * @memberof IgxGridCellComponent */ set selected(val: boolean); /** * Gets whether the cell column is selected. * ```typescript * let isCellColumnSelected = this.cell.columnSelected; * ``` * * @memberof IgxGridCellComponent */ get columnSelected(): boolean; /** * Sets the current edit value while a cell is in edit mode. * Only for cell editing mode. * ```typescript * this.cell.editValue = value; * ``` * * @memberof IgxGridCellComponent */ set editValue(value: any); /** * Gets the current edit value while a cell is in edit mode. * Only for cell editing mode. * ```typescript * let editValue = this.cell.editValue; * ``` * * @memberof IgxGridCellComponent */ get editValue(): any; /** * Returns whether the cell is editable. */ get editable(): boolean; /** * @hidden */ displayPinnedChip: boolean; protected get minHeight(): number; protected defaultCellTemplate: TemplateRef<any>; protected defaultPinnedIndicator: TemplateRef<any>; protected inlineEditorTemplate: TemplateRef<any>; protected addRowCellTemplate: TemplateRef<any>; protected set highlight(value: IgxTextHighlightDirective); protected get highlight(): IgxTextHighlightDirective; protected get selectionNode(): ISelectionNode; /** * Sets/gets the highlight class of the cell. * Default value is `"igx-highlight"`. * ```typescript * let highlightClass = this.cell.highlightClass; * ``` * ```typescript * this.cell.highlightClass = 'igx-cell-highlight'; * ``` * * @memberof IgxGridCellComponent */ highlightClass: string; /** * Sets/gets the active highlight class class of the cell. * Default value is `"igx-highlight__active"`. * ```typescript * let activeHighlightClass = this.cell.activeHighlightClass; * ``` * ```typescript * this.cell.activeHighlightClass = 'igx-cell-highlight_active'; * ``` * * @memberof IgxGridCellComponent */ activeHighlightClass: string; /** @hidden @internal */ get step(): number; /** @hidden @internal */ get currencyCode(): string; /** @hidden @internal */ get currencyCodeSymbol(): string; protected _lastSearchInfo: ISearchInfo; private _highlight; private _cellSelection; private _vIndex; constructor(selectionService: IgxGridSelectionService, grid: GridType, overlayService: IgxOverlayService, cdr: ChangeDetectorRef, element: ElementRef<HTMLElement>, zone: NgZone, touchManager: HammerGesturesManager, platformUtil: PlatformUtil); /** * @hidden * @internal */ onDoubleClick: (event: MouseEvent) => void; /** * @hidden * @internal */ onClick(event: MouseEvent): void; /** * @hidden * @internal */ ngOnInit(): void; ngAfterViewInit(): void; /** * @hidden * @internal */ errorShowing: boolean; private openErrorTooltip; /** * @hidden * @internal */ ngOnDestroy(): void; /** * @hidden * @internal */ ngOnChanges(changes: SimpleChanges): void; /** * @hidden @internal */ private resizeAndRepositionOverlayById; /** * Starts/ends edit mode for the cell. * * ```typescript * cell.setEditMode(true); * ``` */ setEditMode(value: boolean): void; /** * Sets new value to the cell. * ```typescript * this.cell.update('New Value'); * ``` * * @memberof IgxGridCellComponent */ update(val: any): void; /** * * @hidden * @internal */ pointerdown: (event: PointerEvent) => void; /** * * @hidden * @internal */ pointerenter: (event: PointerEvent) => void; /** * @hidden * @internal */ focusout: () => void; private closeErrorTooltip; /** * @hidden * @internal */ pointerup: (event: PointerEvent) => void; /** * @hidden * @internal */ activate(event: FocusEvent | KeyboardEvent): void; /** * If the provided string matches the text in the cell, the text gets highlighted. * ```typescript * this.cell.highlightText('Cell Value', true); * ``` * * @memberof IgxGridCellComponent */ highlightText(text: string, caseSensitive?: boolean, exactMatch?: boolean): number; /** * Clears the highlight of the text in the cell. * ```typescript * this.cell.clearHighLight(); * ``` * * @memberof IgxGridCellComponent */ clearHighlight(): void; /** * @hidden * @internal */ calculateSizeToFit(range: any): number; /** * @hidden * @internal */ get searchMetadata(): Map<string, any>; /** * @hidden * @internal */ private _updateCRUDStatus; private addPointerListeners; private removePointerListeners; private getCellType; static ɵfac: i0.ɵɵFactoryDeclaration<IgxGridCellComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<IgxGridCellComponent, "igx-grid-cell", never, { "column": { "alias": "column"; "required": false; }; "intRow": { "alias": "intRow"; "required": false; }; "row": { "alias": "row"; "required": false; }; "rowData": { "alias": "rowData"; "required": false; }; "columnData": { "alias": "columnData"; "required": false; }; "cellTemplate": { "alias": "cellTemplate"; "required": false; }; "cellValidationErrorTemplate": { "alias": "cellValidationErrorTemplate"; "required": false; }; "pinnedIndicator": { "alias": "pinnedIndicator"; "required": false; }; "value": { "alias": "value"; "required": false; }; "formatter": { "alias": "formatter"; "required": false; }; "visibleColumnIndex": { "alias": "visibleColumnIndex"; "required": false; }; "cellSelectionMode": { "alias": "cellSelectionMode"; "required": false; }; "lastSearchInfo": { "alias": "lastSearchInfo"; "required": false; }; "lastPinned": { "alias": "lastPinned"; "required": false; }; "firstPinned": { "alias": "firstPinned"; "required": false; }; "editMode": { "alias": "editMode"; "required": false; }; "width": { "alias": "width"; "required": false; }; "active": { "alias": "active"; "required": false; }; "displayPinnedChip": { "alias": "displayPinnedChip"; "required": false; }; }, {}, never, never, true, never>; static ngAcceptInputType_editMode: unknown; }