igniteui-angular
Version:
Ignite UI for Angular is a dependency-free Angular toolkit for building modern web apps
1,387 lines (1,371 loc) • 1.54 MB
TypeScript
import * as i0 from '@angular/core';
import { InjectionToken, AfterViewInit, AfterViewChecked, OnDestroy, OnChanges, ElementRef, Renderer2, SimpleChanges, EventEmitter, TemplateRef, ApplicationRef, NgZone, Type, ViewContainerRef, OnInit, ChangeDetectorRef, ComponentRef, Injector, DoCheck, IterableDiffers, EmbeddedViewRef, IterableDiffer, TrackByFunction, IterableChanges, QueryList, AfterContentChecked, AfterContentInit, PipeTransform, DestroyRef, EnvironmentInjector, SimpleChange } from '@angular/core';
import * as _angular_forms from '@angular/forms';
import { FormGroup, ValidationErrors, FormControl, NgModel, NgControl, FormControlName, ControlValueAccessor, Validator, AbstractControl, FormGroupDirective, RequiredValidator, MinValidator, MaxValidator, EmailValidator, MinLengthValidator, MaxLengthValidator, PatternValidator } from '@angular/forms';
import * as _angular_animations from '@angular/animations';
import { AnimationReferenceMetadata, AnimationBuilder } from '@angular/animations';
import * as rxjs from 'rxjs';
import { BehaviorSubject, Subject, Observable, Subscription } from 'rxjs';
import { NgForOfContext } from '@angular/common';
import { DomSanitizer, SafeHtml, EventManager, HammerGestureConfig } from '@angular/platform-browser';
import { HttpClient } from '@angular/common/http';
import * as igniteui_angular from 'igniteui-angular';
import { IMXIcon } from '@igniteui/material-icons-extended';
/**
* Common interface for Components with show and collapse functionality
*/
interface IToggleView {
element: any;
open(...args: any[]): any;
close(...args: any[]): any;
toggle(...args: any[]): any;
}
/**
* Common service to be injected between components where those implementing common
* ToggleView interface can register and toggle directives can call their methods.
* TODO: Track currently active? Events?
*/
declare class IgxNavigationService {
private navs;
constructor();
add(id: string, navItem: IToggleView): void;
remove(id: string): void;
get(id: string): IToggleView;
toggle(id: string, ...args: any[]): any;
open(id: string, ...args: any[]): any;
close(id: string, ...args: any[]): any;
static ɵfac: i0.ɵɵFactoryDeclaration<IgxNavigationService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<IgxNavigationService>;
}
/**
* Directive that can toggle targets through provided NavigationService.
*
* Usage:
* ```
* <button type="button" igxNavToggle="ID">Toggle</button>
* ```
* Where the `ID` matches the ID of compatible `IToggleView` component.
*/
declare class IgxNavigationToggleDirective {
private target;
state: IgxNavigationService;
constructor(nav: IgxNavigationService);
toggleNavigationDrawer(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<IgxNavigationToggleDirective, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<IgxNavigationToggleDirective, "[igxNavToggle]", never, { "target": { "alias": "igxNavToggle"; "required": false; }; }, {}, never, never, true, never>;
}
/**
* Directive that can close targets through provided NavigationService.
*
* Usage:
* ```
* <button type="button" igxNavClose="ID">Close</button>
* ```
* Where the `ID` matches the ID of compatible `IToggleView` component.
*/
declare class IgxNavigationCloseDirective {
private target;
state: IgxNavigationService;
constructor(nav: IgxNavigationService);
closeNavigationDrawer(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<IgxNavigationCloseDirective, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<IgxNavigationCloseDirective, "[igxNavClose]", never, { "target": { "alias": "igxNavClose"; "required": false; }; }, {}, never, never, true, never>;
}
declare class ThemeToken {
private t?;
private document;
subject: BehaviorSubject<IgxTheme>;
constructor(t?: IgxTheme);
onChange(callback: (theme: IgxTheme) => void): rxjs.Subscription;
set(theme: IgxTheme): void;
get theme(): IgxTheme;
get preferToken(): boolean;
}
declare const THEME_TOKEN: InjectionToken<ThemeToken>;
declare const Theme: {
readonly Material: "material";
readonly Fluent: "fluent";
readonly Bootstrap: "bootstrap";
readonly IndigoDesign: "indigo";
};
/**
* Determines the component theme.
*/
type IgxTheme = (typeof Theme)[keyof typeof Theme];
/**
* Utility service taking care of various utility functions such as
* detecting browser features, general cross browser DOM manipulation, etc.
*
* @hidden @internal
*/
declare class PlatformUtil {
private platformId;
isBrowser: boolean;
isIOS: boolean;
isSafari: boolean;
isFirefox: boolean;
isEdge: boolean;
isChromium: boolean;
browserVersion: number;
/** @hidden @internal */
isElements: boolean;
KEYMAP: {
readonly ENTER: "Enter";
readonly SPACE: " ";
readonly ESCAPE: "Escape";
readonly ARROW_DOWN: "ArrowDown";
readonly ARROW_UP: "ArrowUp";
readonly ARROW_LEFT: "ArrowLeft";
readonly ARROW_RIGHT: "ArrowRight";
readonly END: "End";
readonly HOME: "Home";
readonly PAGE_DOWN: "PageDown";
readonly PAGE_UP: "PageUp";
readonly F2: "F2";
readonly TAB: "Tab";
readonly SEMICOLON: ";";
readonly DELETE: "Delete";
readonly BACKSPACE: "Backspace";
readonly CONTROL: "Control";
readonly X: "x";
readonly Y: "y";
readonly Z: "z";
};
constructor(platformId: any);
/**
* @hidden @internal
* Returns the actual size of the node content, using Range
* ```typescript
* let range = document.createRange();
* let column = this.grid.columnList.filter(c => c.field === 'ID')[0];
*
* let size = getNodeSizeViaRange(range, column.cells[0].nativeElement);
*
* @remarks
* The last parameter is useful when the size of the element to measure is modified by a
* parent element that has explicit size. In such cases the calculated size is never lower
* and the function may instead remove the parent size while measuring to get the correct value.
* ```
*/
getNodeSizeViaRange(range: Range, node: HTMLElement, sizeHoldingNode?: HTMLElement): number;
/**
* Returns true if the current keyboard event is an activation key (Enter/Space bar)
*
* @hidden
* @internal
*
* @memberof PlatformUtil
*/
isActivationKey(event: KeyboardEvent): boolean;
/**
* Returns true if the current keyboard event is a combination that closes the filtering UI of the grid. (Escape/Ctrl+Shift+L)
*
* @hidden
* @internal
* @param event
* @memberof PlatformUtil
*/
isFilteringKeyCombo(event: KeyboardEvent): boolean;
/**
* @hidden @internal
*/
isLeftClick(event: PointerEvent | MouseEvent): boolean;
/**
* @hidden @internal
*/
isNavigationKey(key: string): boolean;
static ɵfac: i0.ɵɵFactoryDeclaration<PlatformUtil, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<PlatformUtil>;
}
interface CancelableEventArgs {
/**
* Provides the ability to cancel the event.
*/
cancel: boolean;
}
interface IBaseEventArgs {
/**
* Provides reference to the owner component.
*/
owner?: any;
}
interface CancelableBrowserEventArgs extends CancelableEventArgs {
/** Browser event */
event?: Event;
}
interface IBaseCancelableBrowserEventArgs extends CancelableBrowserEventArgs, IBaseEventArgs {
}
interface IBaseCancelableEventArgs extends CancelableEventArgs, IBaseEventArgs {
}
/**
* Collection re-created w/ the built in track by identity will always log
* warning even for valid cases of recalculating all collection items.
* See https://github.com/angular/angular/blob/55581b4181639568fb496e91055142a1b489e988/packages/core/src/render3/instructions/control_flow.ts#L393-L409
* Current solution explicit track function doing the same as suggested in:
* https://github.com/angular/angular/issues/56471#issuecomment-2180315803
* This should be used with moderation and when necessary.
* @internal
*/
declare function trackByIdentity<T>(item: T): T;
interface IBaseSearchInfo {
searchText: string;
caseSensitive: boolean;
exactMatch: boolean;
matchCount: number;
content: string;
}
/**
* An interface describing information for the active highlight.
*/
interface IActiveHighlightInfo {
/**
* The row of the highlight.
*/
row?: any;
/**
* The column of the highlight.
*/
column?: any;
/**
* The index of the highlight.
*/
index: number;
/**
* Additional, custom checks to perform prior an element highlighting.
*/
metadata?: Map<string, any>;
}
declare class IgxTextHighlightDirective implements AfterViewInit, AfterViewChecked, OnDestroy, OnChanges {
private element;
private service;
private renderer;
/**
* Determines the `CSS` class of the highlight elements.
* This allows the developer to provide custom `CSS` to customize the highlight.
*
* ```html
* <div
* igxTextHighlight
* [cssClass]="myClass">
* </div>
* ```
*/
cssClass: string;
/**
* Determines the `CSS` class of the active highlight element.
* This allows the developer to provide custom `CSS` to customize the highlight.
*
* ```html
* <div
* igxTextHighlight
* [activeCssClass]="activeHighlightClass">
* </div>
* ```
*/
activeCssClass: string;
/**
* @hidden
*/
containerClass: string;
/**
* Identifies the highlight within a unique group.
* This allows it to have several different highlight groups,
* with each of them having their own active highlight.
*
* ```html
* <div
* igxTextHighlight
* [groupName]="myGroupName">
* </div>
* ```
*/
groupName: string;
/**
* The underlying value of the element that will be highlighted.
*
* ```typescript
* // get
* const elementValue = this.textHighlight.value;
* ```
*
* ```html
* <!--set-->
* <div
* igxTextHighlight
* [value]="newValue">
* </div>
* ```
*/
get value(): any;
set value(value: any);
/**
* The identifier of the row on which the directive is currently on.
*
* ```html
* <div
* igxTextHighlight
* [row]="0">
* </div>
* ```
*/
row: any;
/**
* The identifier of the column on which the directive is currently on.
*
* ```html
* <div
* igxTextHighlight
* [column]="0">
* </div>
* ```
*/
column: any;
/**
* A map that contains all additional conditions, that you need to activate a highlighted
* element. To activate the condition, you will have to add a new metadata key to
* the `metadata` property of the IActiveHighlightInfo interface.
*
* @example
* ```typescript
* // Set a property, which would disable the highlight for a given element on a certain condition
* const metadata = new Map<string, any>();
* metadata.set('highlightElement', false);
* ```
* ```html
* <div
* igxTextHighlight
* [metadata]="metadata">
* </div>
* ```
*/
metadata: Map<string, any>;
/**
* @hidden
*/
get lastSearchInfo(): IBaseSearchInfo;
/**
* @hidden
*/
parentElement: any;
private _container;
private destroy$;
private _value;
private _lastSearchInfo;
private _div;
private _observer;
private _nodeWasRemoved;
private _forceEvaluation;
private _activeElementIndex;
private _valueChanged;
private _defaultCssClass;
private _defaultActiveCssClass;
constructor(element: ElementRef, service: IgxTextHighlightService, renderer: Renderer2);
/**
* @hidden
*/
ngOnDestroy(): void;
/**
* @hidden
*/
ngOnChanges(changes: SimpleChanges): void;
/**
* @hidden
*/
ngAfterViewInit(): void;
/**
* @hidden
*/
ngAfterViewChecked(): void;
/**
* Clears the existing highlight and highlights the searched text.
* Returns how many times the element contains the searched text.
*/
highlight(text: string, caseSensitive?: boolean, exactMatch?: boolean): number;
/**
* Clears any existing highlight.
*/
clearHighlight(): void;
/**
* Activates the highlight if it is on the currently active row and column.
*/
activateIfNecessary(): void;
/**
* Attaches a MutationObserver to the parentElement and watches for when the container element is removed/readded to the DOM.
* Should be used only when necessary as using many observers may lead to performance degradation.
*/
observe(): void;
private activate;
private deactivate;
private clearChildElements;
private getHighlightedText;
private appendText;
private appendSpan;
private appendDiv;
private searchNeedsEvaluation;
static ɵfac: i0.ɵɵFactoryDeclaration<IgxTextHighlightDirective, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<IgxTextHighlightDirective, "[igxTextHighlight]", never, { "cssClass": { "alias": "cssClass"; "required": false; }; "activeCssClass": { "alias": "activeCssClass"; "required": false; }; "containerClass": { "alias": "containerClass"; "required": false; }; "groupName": { "alias": "groupName"; "required": false; }; "value": { "alias": "value"; "required": false; }; "row": { "alias": "row"; "required": false; }; "column": { "alias": "column"; "required": false; }; "metadata": { "alias": "metadata"; "required": false; }; }, {}, never, never, true, never>;
}
declare class IgxTextHighlightService {
highlightGroupsMap: Map<string, IActiveHighlightInfo>;
onActiveElementChanged: EventEmitter<string>;
constructor();
/**
* Activates the highlight at a given index.
* (if such index exists)
*/
setActiveHighlight(groupName: string, highlight: IActiveHighlightInfo): void;
/**
* Clears any existing highlight.
*/
clearActiveHighlight(groupName: any): void;
/**
* Destroys a highlight group.
*/
destroyGroup(groupName: string): void;
static ɵfac: i0.ɵɵFactoryDeclaration<IgxTextHighlightService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<IgxTextHighlightService>;
}
/**
* Enumeration representing different filter modes for grid filtering.
* - quickFilter: Default mode with a filter row UI between the column headers and the first row of records.
* - excelStyleFilter: Filter mode where an Excel-style filter is used.
*/
declare const FilterMode: {
readonly quickFilter: "quickFilter";
readonly excelStyleFilter: "excelStyleFilter";
};
type FilterMode = (typeof FilterMode)[keyof typeof FilterMode];
/**
* Enumeration representing the position of grid summary rows.
* - top: Default value; Summary rows are displayed at the top of the grid.
* - bottom: Summary rows are displayed at the bottom of the grid.
*/
declare const GridSummaryPosition: {
readonly top: "top";
readonly bottom: "bottom";
};
type GridSummaryPosition = (typeof GridSummaryPosition)[keyof typeof GridSummaryPosition];
/**
* Enumeration representing different calculation modes for grid summaries.
* - rootLevelOnly: Summaries are calculated only for the root level.
* - childLevelsOnly: Summaries are calculated only for child levels.
* - rootAndChildLevels: Default value; Summaries are calculated for both root and child levels.
*/
declare const GridSummaryCalculationMode: {
readonly rootLevelOnly: "rootLevelOnly";
readonly childLevelsOnly: "childLevelsOnly";
readonly rootAndChildLevels: "rootAndChildLevels";
};
type GridSummaryCalculationMode = (typeof GridSummaryCalculationMode)[keyof typeof GridSummaryCalculationMode];
/**
* Type representing the triggers for grid cell validation.
* - 'change': Validation is triggered when the cell value changes.
* - 'blur': Validation is triggered when the cell loses focus.
*/
type GridValidationTrigger = 'change' | 'blur';
/**
* Type representing the type of the target object (elements of the grid) for keydown (fired when a key is pressed) events in the grid.
* - 'dataCell': Represents a data cell within the grid. It contains and displays individual data values
* - 'summaryCell': Summary cells display aggregated/summarized data at the bottom of the grid. They provide insights like total record count, min/max values, etc.
* - 'groupRow': Group row within the grid. Group rows are used to group related data rows by columns. Contains the related group expression, level, sub-records and group value.
* - 'hierarchicalRow': Hierarchical rows are similar to group rows, but represent a more complex hierarchical structure, allowing for nested grouping
* - 'headerCell': Represents a header cell within the grid. Header cells are used to display column headers, providing context and labels for the columns.
* - 'masterDetailRow': Represents a grid row that can be expanded in order to show additional information
*/
type GridKeydownTargetType = 'dataCell' | 'summaryCell' | 'groupRow' | 'hierarchicalRow' | 'headerCell' | 'masterDetailRow';
/**
* Enumeration representing different selection modes for the grid elements if can be selected.
* - 'none': No selection is allowed. Default row and column selection mode.
* - 'single': Only one element can be selected at a time. Selecting a new one will deselect the previously selected one.
* - 'multiple': Default cell selection mode. More than one element can be selected at a time.
* - 'multipleCascade': Similar to multiple selection. It is used in hierarchical or tree grids. Allows selection not only to an individual item but also all its related or nested items in a single action
*/
declare const GridSelectionMode: {
readonly none: "none";
readonly single: "single";
readonly multiple: "multiple";
readonly multipleCascade: "multipleCascade";
};
type GridSelectionMode = (typeof GridSelectionMode)[keyof typeof GridSelectionMode];
/** Enumeration representing different column display order options. */
declare const ColumnDisplayOrder: {
readonly Alphabetical: "Alphabetical";
readonly DisplayOrder: "DisplayOrder";
};
type ColumnDisplayOrder = (typeof ColumnDisplayOrder)[keyof typeof ColumnDisplayOrder];
/**
* Enumeration representing the possible positions for pinning columns.
* - Start: Columns are pinned to the start of the grid.
* - End: Columns are pinned to the end of the grid.
*/
declare enum ColumnPinningPosition {
Start = 0,
End = 1
}
/**
* Enumeration representing the possible positions for pinning rows.
* - Top: Rows are pinned to the top of the grid.
* - Bottom: Rows are pinned to the bottom of the grid.
*/
declare enum RowPinningPosition {
Top = 0,
Bottom = 1
}
/**
* Enumeration representing different paging modes for the grid.
* - Local: The grid will use local data to extract pages during paging.
* - Remote: The grid will expect pages to be delivered from a remote location and will only raise events during paging interactions.
*/
declare const GridPagingMode: {
readonly Local: "local";
readonly Remote: "remote";
};
type GridPagingMode = (typeof GridPagingMode)[keyof typeof GridPagingMode];
/**
* @hidden @internal
*
* Enumeration representing the possible predefined size options of the grid.
* - Small: This is the smallest size with 32px row height. Left and Right paddings are 12px. Minimal column width is 56px.
* - Medium: This is the middle size with 40px row height. Left and Right paddings are 16px. Minimal column width is 64px.
* - Large: this is the default Grid size with the lowest intense and row height equal to 50px. Left and Right paddings are 24px. Minimal column width is 80px.
*/
declare const Size$1: {
readonly Small: "1";
readonly Medium: "2";
readonly Large: "3";
};
type Size$1 = (typeof Size$1)[keyof typeof Size$1];
/**
* Provides base filtering operations
* Implementations should be Singleton
*
* @export
*/
declare class IgxFilteringOperand {
protected static _instance: IgxFilteringOperand;
operations: IFilteringOperation[];
constructor();
static instance(): IgxFilteringOperand;
/**
* Returns an array of names of the conditions which are visible in the filtering UI
*/
conditionList(): string[];
/**
* Returns an array of names of the conditions which are visible in the UI, including "In" and "Not In", allowing the creation of sub-queries.
* @hidden @internal
*/
extendedConditionList(): string[];
/**
* Returns an instance of the condition with the specified name.
*
* @param name The name of the condition.
*/
condition(name: string): IFilteringOperation;
/**
* Adds a new condition to the filtering operations.
*
* @param operation The filtering operation.
*/
append(operation: IFilteringOperation): void;
protected findValueInSet(target: any, searchVal: Set<any>): boolean;
}
/**
* Provides filtering operations for booleans
*
* @export
*/
declare class IgxBooleanFilteringOperand extends IgxFilteringOperand {
protected constructor();
}
/**
* @internal
* @hidden
*/
declare class IgxBaseDateTimeFilteringOperand extends IgxFilteringOperand {
protected constructor();
/**
* Splits a Date object into parts
*
* @memberof IgxDateFilteringOperand
*/
static getDateParts(date: Date, dateFormat?: string): IDateParts;
protected findValueInSet(target: any, searchVal: Set<any>): boolean;
protected validateInputData(target: Date): void;
}
/**
* Provides filtering operations for Dates
*
* @export
*/
declare class IgxDateFilteringOperand extends IgxBaseDateTimeFilteringOperand {
protected constructor();
protected findValueInSet(target: any, searchVal: Set<any>): boolean;
}
declare class IgxDateTimeFilteringOperand extends IgxBaseDateTimeFilteringOperand {
protected constructor();
}
declare class IgxTimeFilteringOperand extends IgxBaseDateTimeFilteringOperand {
protected constructor();
protected findValueInSet(target: any, searchVal: Set<any>): boolean;
}
/**
* Provides filtering operations for numbers
*
* @export
*/
declare class IgxNumberFilteringOperand extends IgxFilteringOperand {
protected constructor();
}
/**
* Provides filtering operations for strings
*
* @export
*/
declare class IgxStringFilteringOperand extends IgxFilteringOperand {
protected constructor();
/**
* Applies case sensitivity on strings if provided
*
* @memberof IgxStringFilteringOperand
*/
static applyIgnoreCase(a: string, ignoreCase: boolean): string;
}
/**
* Interface describing filtering operations
*
* @export
*/
interface IFilteringOperation {
name: string;
isUnary: boolean;
isNestedQuery?: boolean;
iconName: string;
hidden?: boolean;
logic?: null | ((value: any, searchVal?: any, ignoreCase?: boolean) => boolean);
}
/**
* Interface describing Date object in parts
*
* @export
*/
interface IDateParts {
year: number;
month: number;
day: number;
hours: number;
minutes: number;
seconds: number;
milliseconds: number;
}
declare enum FilteringLogic {
And = 0,
Or = 1
}
/**
* Represents filtering expressions.
*/
declare interface IFilteringExpression {
fieldName: string;
condition?: IFilteringOperation | null;
conditionName?: string | null;
searchVal?: any;
searchTree?: IExpressionTree | null;
ignoreCase?: boolean;
}
declare enum FilteringExpressionsTreeType {
Regular = 0,
Advanced = 1
}
declare interface IExpressionTree {
filteringOperands: (IExpressionTree | IFilteringExpression)[];
operator: FilteringLogic;
fieldName?: string | null;
entity?: string | null;
returnFields?: string[] | null;
}
declare interface IFilteringExpressionsTree extends IBaseEventArgs, IExpressionTree {
filteringOperands: (IFilteringExpressionsTree | IFilteringExpression)[];
type?: FilteringExpressionsTreeType;
/**
* @deprecated in version 18.2.0. Use `ExpressionsTreeUtil.find` instead.
*/
find?: (fieldName: string) => IFilteringExpressionsTree | IFilteringExpression;
/**
* @deprecated in version 18.2.0. Use `ExpressionsTreeUtil.findIndex` instead.
*/
findIndex?: (fieldName: string) => number;
}
declare class FilteringExpressionsTree implements IFilteringExpressionsTree {
/**
* Sets/gets the filtering operands.
* ```typescript
* const gridExpressionsTree = new FilteringExpressionsTree(FilteringLogic.And);
* const expression = [
* {
* condition: IgxStringFilteringOperand.instance().condition('contains'),
* fieldName: 'Column Field',
* searchVal: 'Value',
* ignoreCase: false
* }];
* gridExpressionsTree.filteringOperands.push(expression);
* this.grid.filteringExpressionsTree = gridExpressionsTree;
* ```
* ```typescript
* let filteringOperands = gridExpressionsTree.filteringOperands;
* ```
*
* @memberof FilteringExpressionsTree
*/
filteringOperands: (IFilteringExpressionsTree | IFilteringExpression)[];
/**
* Sets/gets the operator.
* ```typescript
* gridExpressionsTree.operator = FilteringLogic.And;
* ```
* ```typescript
* let operator = gridExpressionsTree.operator;
* ```
*
* @memberof FilteringExpressionsTree
*/
operator: FilteringLogic;
/**
* Sets/gets the field name of the column where the filtering expression is placed.
* ```typescript
* gridExpressionTree.fieldName = 'Column Field';
* ```
* ```typescript
* let columnField = expressionTree.fieldName;
* ```
*
* @memberof FilteringExpressionsTree
*/
fieldName?: string;
/**
* Sets/gets the type of the filtering expressions tree.
* ```typescript
* gridExpressionTree.type = FilteringExpressionsTree.Advanced;
* ```
* ```typescript
* let type = expressionTree.type;
* ```
*
* @memberof FilteringExpressionsTree
*/
type?: FilteringExpressionsTreeType;
/**
* Sets/gets the entity.
* ```typescript
* gridExpressionsTree.entity = 'Entity A';
* ```
* ```typescript
* let entity = gridExpressionsTree.entity;
* ```
*
* @memberof FilteringExpressionsTree
*/
entity?: string;
/**
* Sets/gets the return fields.
* ```typescript
* gridExpressionsTree.returnFields = ['Column Field 1', 'Column Field 2'];
* ```
* ```typescript
* let returnFields = gridExpressionsTree.returnFields;
* ```
*
* @memberof FilteringExpressionsTree
*/
returnFields?: string[];
constructor(operator: FilteringLogic, fieldName?: string, entity?: string, returnFields?: string[]);
/**
* Checks if filtering expressions tree is empty.
*
* @param expressionTree filtering expressions tree.
*/
static empty(expressionTree: IFilteringExpressionsTree): boolean;
/**
* Returns the filtering expression for a column with the provided fieldName.
* ```typescript
* let filteringExpression = gridExpressionTree.find('Column Field');
* ```
*
* @memberof FilteringExpressionsTree
* @deprecated in version 18.2.0. Use `ExpressionsTreeUtil.find` instead.
*/
find(fieldName: string): IFilteringExpressionsTree | IFilteringExpression;
/**
* Returns the index of the filtering expression for a column with the provided fieldName.
* ```typescript
* let filteringExpressionIndex = gridExpressionTree.findIndex('Column Field');
* ```
*
* @memberof FilteringExpressionsTree
* @deprecated in version 18.2.0. Use `ExpressionsTreeUtil.findIndex` instead.
*/
findIndex(fieldName: string): number;
}
type KeyOfOrString<T, K = keyof T> = K extends keyof T ? K : string;
declare enum SortingDirection {
None = 0,
Asc = 1,
Desc = 2
}
interface ISortingExpression<T = any> extends IBaseEventArgs {
fieldName: KeyOfOrString<T> & string;
dir: SortingDirection;
ignoreCase?: boolean;
strategy?: ISortingStrategy;
}
interface ISortingStrategy {
sort: (data: any[], fieldName: string, dir: SortingDirection, ignoreCase: boolean, valueResolver: (obj: any, key: string, isDate?: boolean) => any, isDate?: boolean, isTime?: boolean, grid?: GridType) => any[];
}
declare class DefaultSortingStrategy implements ISortingStrategy {
protected static _instance: DefaultSortingStrategy;
protected constructor();
static instance(): DefaultSortingStrategy;
sort(data: any[], fieldName: string, dir: SortingDirection, ignoreCase: boolean, valueResolver: (obj: any, key: string, isDate?: boolean) => any, isDate?: boolean, isTime?: boolean): any[];
compareValues(a: any, b: any): number;
protected compareObjects(obj1: any, obj2: any, key: string, reverse: number, ignoreCase: boolean, valueResolver: (obj: any, key: string, isDate?: boolean, isTime?: boolean) => any, isDate: boolean, isTime: boolean): number;
protected arraySort(data: any[], compareFn?: (arg0: any, arg1: any) => number): any[];
}
declare class GroupMemberCountSortingStrategy implements ISortingStrategy {
protected static _instance: GroupMemberCountSortingStrategy;
protected constructor();
static instance(): GroupMemberCountSortingStrategy;
sort(data: any[], fieldName: string, dir: SortingDirection): any[];
groupBy(data: any, key: any): any;
protected compareObjects(obj1: any, obj2: any, data: any[], fieldName: string, reverse: number): number;
}
declare class FormattedValuesSortingStrategy extends DefaultSortingStrategy {
protected static _instance: FormattedValuesSortingStrategy;
constructor();
static instance(): FormattedValuesSortingStrategy;
sort(data: any[], fieldName: string, dir: SortingDirection, ignoreCase: boolean, valueResolver: (obj: any, key: string, isDate?: boolean) => any, isDate?: boolean, isTime?: boolean, grid?: GridType): any[];
protected compareObjects(obj1: any, obj2: any, key: string, reverse: number, ignoreCase: boolean, valueResolver: (obj: any, key: string, isDate?: boolean, isTime?: boolean) => any, isDate: boolean, isTime: boolean, grid?: GridType): number;
}
interface IGroupingExpression extends ISortingExpression {
groupingComparer?: (a: any, b: any, currRec?: any, groupRec?: any) => number;
}
declare abstract class IgxExporterOptionsBase {
protected _fileExtension: string;
/**
* Specifies whether hidden columns should be exported.
* ```typescript
* let ignoreColumnsVisibility = this.exportOptions.ignoreColumnsVisibility;
* this.exportOptions.ignoreColumnsVisibility = true;
* ```
*
* @memberof IgxExporterOptionsBase
*/
ignoreColumnsVisibility: boolean;
/**
* Specifies whether filtered out rows should be exported.
* ```typescript
* let ignoreFiltering = this.exportOptions.ignoreFiltering;
* this.exportOptions.ignoreFiltering = true;
* ```
*
* @memberof IgxExporterOptionsBase
*/
ignoreFiltering: boolean;
/**
* Specifies if the exporter should ignore the current column order in the IgxGrid.
* ```typescript
* let ignoreColumnsOrder = this.exportOptions.ignoreColumnsOrder;
* this.exportOptions.ignoreColumnsOrder = true;
* ```
*
* @memberof IgxExporterOptionsBase
*/
ignoreColumnsOrder: boolean;
/**
* Specifies whether the exported data should be sorted as in the provided IgxGrid.
* When you export grouped data, setting ignoreSorting to true will cause
* the grouping to fail because it relies on the sorting of the records.
* ```typescript
* let ignoreSorting = this.exportOptions.ignoreSorting;
* this.exportOptions.ignoreSorting = true;
* ```
*
* @memberof IgxExporterOptionsBase
*/
ignoreSorting: boolean;
/**
* Specifies whether the exported data should be grouped as in the provided IgxGrid.
* ```typescript
* let ignoreGrouping = this.exportOptions.ignoreGrouping;
* this.exportOptions.ignoreGrouping = true;
* ```
*
* @memberof IgxExporterOptionsBase
*/
ignoreGrouping: boolean;
/**
* Specifies whether the exported data should include multi column headers as in the provided IgxGrid.
* ```typescript
* let ignoreMultiColumnHeaders = this.exportOptions.ignoreMultiColumnHeaders;
* this.exportOptions.ignoreMultiColumnHeaders = true;
* ```
*
* @memberof IgxExporterOptionsBase
*/
ignoreMultiColumnHeaders: boolean;
/**
* Specifies whether the exported data should include column summaries.
* ```typescript
* let exportSummaries = this.exportOptions.exportSummaries;
* this.exportOptions.exportSummaries = true;
* ```
*
* @memberof IgxExporterOptionsBase
*/
exportSummaries: boolean;
/**
* Specifies whether the exported data should have frozen headers.
* ```typescript
* let freezeHeaders = this.exportOptions.freezeHeaders;
* this.exportOptions.freezeHeaders = true;
* ```
*
* @memberof IgxExporterOptionsBase
*/
freezeHeaders: boolean;
/**
* Specifies whether the headers should be exported if there is no data.
* ```typescript
* let alwaysExportHeaders = this.exportOptions.alwaysExportHeaders;
* this.exportOptions.alwaysExportHeaders = false;
* ```
*
* @memberof IgxExporterOptionsBase
*/
alwaysExportHeaders: boolean;
private _fileName;
constructor(fileName: string, _fileExtension: string);
private setFileName;
/**
* Gets the file name which will be used for the exporting operation.
* ```typescript
* let fileName = this.exportOptions.fileName;
* ```
*
* @memberof IgxExporterOptionsBase
*/
get fileName(): string;
/**
* Sets the file name which will be used for the exporting operation.
* ```typescript
* this.exportOptions.fileName = 'exportedData01';
* ```
*
* @memberof IgxExporterOptionsBase
*/
set fileName(value: string);
}
/** The event arguments when data from a grid is being copied. */
interface IGridClipboardEvent {
/** `data` can be of any type and refers to the data that is being copied/stored to the clipboard */
data: any[];
/**
* `cancel` returns whether an external event has intercepted the copying
* If the value becomes "true", it returns/exits from the method, instantiating the interface
*/
cancel: boolean;
}
/** Represents an event argument related to grid cell interactions. */
interface IGridCellEventArgs extends IBaseEventArgs {
/** Represents the grid cell that triggered the event. */
cell: CellType;
/**
* Represents the original event that occurred
* Examples of such events include: selecting, clicking, double clicking, etc.
*/
event: Event;
}
/** Represents an event argument related to grid row interactions. */
interface IGridRowEventArgs extends IBaseEventArgs {
/** Represents the grid row that triggered the event. */
row: RowType;
/**
* Represents the original event that occurred
* Examples of such events include: selecting, clicking, double clicking, etc.
*/
event: Event;
}
/** Represents an event argument for the grid contextMenu output */
interface IGridContextMenuEventArgs extends IGridCellEventArgs, IGridRowEventArgs {
}
/** Represents event arguments related to grid editing completion. */
interface IGridEditDoneEventArgs extends IBaseEventArgs {
/**
* @deprecated since version 17.1.0. Use the `rowKey` property instead.
*/
rowID: any;
/**
* @deprecated since version 17.1.0. Use the `rowKey` property instead.
*/
primaryKey: any;
rowKey: any;
cellID?: {
rowID: any;
columnID: any;
rowIndex: number;
};
/**
* `rowData` represents the updated/committed data of the row after the edit (newValue)
* The only case rowData (of the current object) is used directly, is when there is no rowEditing or transactions enabled
*/
rowData: any;
/**
* Represents the previous (before editing) value of the edited cell.
* It's used when the event has been stopped/exited.
*/
oldValue: any;
/**
* Optional
* Represents the value, that is being entered in the edited cell
* When there is no `newValue` and the event has ended, the value of the cell returns to the `oldValue`
*/
newValue?: any;
/**
* Optional
* Represents the original event, that has triggered the edit
*/
event?: Event;
/**
* Optional
* Represents the column information of the edited cell
*/
column?: ColumnType;
/**
* Optional
* Represents the grid instance that owns the edit event.
*/
owner?: GridType;
/**
* Optional
* Indicates if the editing consists of adding a new row
*/
isAddRow?: boolean;
/**
* Optional
* Indicates if the new value would be valid.
* It can be set to return the result of the methods for validation of the grid
*/
valid?: boolean;
}
/**
* Represents event arguments related to grid editing.
* The event is cancelable
* It contains information about the row and the column, as well as the old and nwe value of the element/cell
*/
interface IGridEditEventArgs extends CancelableEventArgs, IGridEditDoneEventArgs {
}
interface IRowDataCancelableEventArgs extends IRowDataEventArgs, IGridEditEventArgs {
/**
* @deprecated
*/
cellID?: {
rowID: any;
columnID: any;
rowIndex: number;
};
/**
* @deprecated
*/
oldValue: any;
/**
* @deprecated
*/
newValue?: any;
/**
* @deprecated
*/
isAddRow?: boolean;
owner: GridType;
}
/**
* The event arguments after a column's pin state is changed.
* `insertAtIndex`specifies at which index in the pinned/unpinned area the column was inserted.
* `isPinned` returns the actual pin state of the column after the operation completed.
*/
interface IPinColumnEventArgs extends IBaseEventArgs {
column: ColumnType;
/**
* If pinned, specifies at which index in the pinned area the column is inserted.
* If unpinned, specifies at which index in the unpinned area the column is inserted.
*/
insertAtIndex: number;
/**
* Returns the actual pin state of the column.
* If pinning/unpinning is successful, value of `isPinned` will change accordingly when read in the "-ing" and "-ed" event.
*/
isPinned: boolean;
}
/**
* The event arguments before a column's pin state is changed.
* `insertAtIndex`specifies at which index in the pinned/unpinned area the column is inserted.
* Can be changed in the `columnPin` event.
* `isPinned` returns the actual pin state of the column. When pinning/unpinning is successful,
* the value of `isPinned` will change accordingly when read in the "-ing" and "-ed" event.
*/
interface IPinColumnCancellableEventArgs extends IPinColumnEventArgs, CancelableEventArgs {
}
/**
* Represents event arguments related to events, that can occur for rows in a grid
* Example for events: adding, deleting, selection, transaction, etc.
*/
interface IRowDataEventArgs extends IBaseEventArgs {
/**
* @deprecated since version 17.1.0. Use the `rowData` property instead.
*/
data: any;
rowData: any;
/**
* Represents the unique key, the row can be associated with.
* Available if `primaryKey` exists
* @deprecated since version 17.1.0. Use the `rowKey` property instead.
*/
primaryKey: any;
rowKey: any;
/** Represents the grid instance that owns the edit event. */
owner: GridType;
}
/** The event arguments when a column is being resized */
interface IColumnResizeEventArgs extends IBaseEventArgs {
/** Represents the information of the column that is being resized */
column: ColumnType;
/** Represents the old width of the column before the resizing */
prevWidth: string;
/** Represents the new width, the column is being resized to */
newWidth: string;
}
/**
* The event arguments when a column is being resized
* It contains information about the column, it's old and new width
* The event can be canceled
*/
interface IColumnResizingEventArgs extends IColumnResizeEventArgs, CancelableEventArgs {
}
/**
* The event arguments when the selection state of a row is being changed
* The event is cancelable
*/
interface IRowSelectionEventArgs extends CancelableEventArgs, IBaseEventArgs {
/** Represents an array of rows, that have already been selected */
readonly oldSelection: any[];
/** Represents the newly selected rows */
newSelection: any[];
/**
* Represents an array of all added rows
* Whenever a row has been selected, the array is "refreshed" with the selected rows
*/
readonly added: any[];
/**
* Represents an array of all rows, removed from the selection
* Whenever a row has been deselected, the array is "refreshed" with the rows,
* that have been previously selected, but are no longer
*/
readonly removed: any[];
/**
* Represents the original event, that has triggered the selection change
* selecting, deselecting
*/
readonly event?: Event;
/** Indicates whether or not all rows of the grid have been selected */
readonly allRowsSelected?: boolean;
}
/**
* The event arguments when the selection state of a column is being changed
* The event is cancelable
*/
interface IColumnSelectionEventArgs extends CancelableEventArgs, IBaseEventArgs {
/** Represents an array of columns, that have already been selected */
readonly oldSelection: string[];
/** Represents the newly selected columns */
newSelection: string[];
/**
* Represents an array of all added columns
* Whenever a column has been selected, the array is "refreshed" with the selected columns
*/
readonly added: string[];
/**
* Represents an array of all columns, removed from the selection
* Whenever a column has been deselected, the array is "refreshed" with the columns, that have been previously selected, but are no longer
*/
readonly removed: string[];
/**
* Represents the original event, that has triggered the selection change
* selecting, deselecting
*/
readonly event?: Event;
}
interface ISearchInfo extends IBaseSearchInfo {
matchInfoCache: any[];
activeMatchIndex: number;
}
/**
* Represents the arguments for the grid toolbar export event.
* It provides information about the grid instance, exporter service, export options,
* and allows the event to be canceled.
*/
interface IGridToolbarExportEventArgs extends IBaseEventArgs {
/** `grid` represents a reference to the instance of the grid te event originated from */
grid: GridType;
/**
* The `exporter` is a base service.
* The type (an abstract class `IgxBaseExporter`) has it's own properties and methods
* It is used to define the format and options of the export, the exported element
* and methods for preparing the data from the elements for exporting
*/
exporter: IgxBaseExporter;
/**
* Represents the different settings, that can be given to an export
* The type (an abstract class `IgxExporterOptionsBase`) has properties for column settings
* (whether they should be ignored) as well as method for generating a file name
*/
options: IgxExporterOptionsBase;
/**
* `cancel` returns whether the event has been intercepted and stopped
* If the value becomes "true", it returns/exits from the method, instantiating the interface
*/
cancel: boolean;
}
/** Represents event arguments related to the start of a column moving operation in a grid. */
interface IColumnMovingStartEventArgs extends IBaseEventArgs {
/**
* Represents the column that is being moved.
* The `ColumnType` contains the information (the grid it belongs to, css data, settings, etc.) of the column in its properties
*/
source: ColumnType;
}
/** Represents event arguments related to a column moving operation in a grid */
interface IColumnMovingEventArgs extends IBaseEventArgs {
/**
* Represents the column that is being moved.
* The `ColumnType` contains the information (the grid it belongs to, css data, settings, etc.) of the column in its properties
*/
source: ColumnType;
/**
* `cancel` returns whether the event has been intercepted and stopped
* If the value becomes "true", it returns/exits from the method, instantiating the interface
*/
cancel: boolean;
}
/** Represents event arguments related to the end of a column moving operation in a grid */
interface IColumnMovingEndEventArgs extends IBaseEventArgs {
/**
* The source of the event represents the column that is being moved.
* The `ColumnType` contains the information (the grid it belongs to, css data, settings, etc.) of the column in its properties
*/
source: ColumnType;
/**
* The target of the event represents the column, the source is being moved to.
* The `ColumnType` contains the information (the grid it belongs to, css data, settings, etc.) of the column in its properties
*/
target: ColumnType;
/**
* `cancel` returns whether the event has been intercepted and stopped
* If the value becomes "true", it returns/exits from the method, instantiating the interface
*/
cancel: boolean;
}
/**
* Represents an event, emitted when keydown is triggered over element inside grid's body
* This event is fired only if the key combination is supported in the grid.
*/
interface IGridKeydownEventArgs extends IBaseEventArgs {
/** The `targetType` represents the type of the targeted object. For example a cell or a row */
targetType: GridKeydownTargetType;
/** Represents the information and details of the object itself */
target: any;
/** Represents the original event, that occurred. */
event: Event;
/**
* The event is cancelable
* `cancel` returns whether the event has been intercepted and stopped
* If the value becomes "true", it returns/exits from the method, instantiating the interface
*/
cancel: boolean;
}
/** The event is triggered when getting the current position of a certain cell */
interface ICellPosition {
/** It returns the position (index) of the row, the cell is in */
rowIndex: number;
/**
* It returns the position (index) of the column, the cell is in
* Counts only the visible (non hidden) columns
*/
visibleColumnIndex: number;
}
/** Emitted when a dragging operation is finished (when the row is dropped) */
interface IRowDragEndEventArgs extends IBaseEventArgs {
/** Represents the drag directive or information associated with the drag operation */
dragDirective: any;
/** Represents the information of the row that is being dragged. */
dragData: RowType;
/** Represents the HTML element itself */
dragElement: HTMLElement;
/** `animation` returns whether the event is animated */
animation: boolean;
}
/**
* Emitted when a dragging operation is starting (when the row is "picked")
* The event is cancelable
*/
interface IRowDragStartEventArgs extends CancelableEventArgs, IBaseEventArgs {
/** Represents the drag directive or information associated with the drag operation */
dragDirective: any;
/** Represents the information of the row that is being dragged. */
dragData: RowType;
/** Represents the HTML element itself */
dragElement: HTMLElement;
}
/** Represents event arguments related to the row's expansion state being changed in a grid */
interface IRowToggleEventArgs extends IBaseEventArgs {
/**
* Represents the ID of the row that emitted the event (which state is changed)
* @deprecated since version 17.1.0. Use the `rowKey` property instead.
*/
rowID: any;
rowKey: any;
/**
* Returns the state of the row after the operation has ended
* Indicating whether the row is being expanded (true) or collapsed (false)
*/
expanded: boolean;
/**
* Optional
* Represents the original event, that has triggered the expansion/collapse
*/
event?: Event;
/**
* The event is cancelable
* `cancel` returns whether the event has been intercepted and stopped
* If the value becomes "true", it returns/exits from the method, instantiating the interface
*/
cancel: boolean;
}
/**
* Event emitted when a row's pin state changes.
* The event is cancelable
*/
interface IPinRowEventArgs extends IBaseEventArgs, CancelableEventArgs {
/**
* The ID of the row, that was pinned/unpinned.
* ID is either the primaryKey value or the data record instance.
* @deprecated since version 17.1.0. Use the `rowKey` property instead.
*/
readonly rowID: any;
readonly rowKey: any;
row?: RowType;
/** The index at which to pin the row in the pinned rows collection. */
insertAtIndex?: number;
/** Whether or not the row is pinned or unpinned. */
readonly isPinned: boolean;
}
/**
* Event emitted when a grid is scrolled.
*/
interface IGridScrollEventArgs extends IBaseEventArgs