igniteui-angular
Version:
Ignite UI for Angular is a dependency-free Angular toolkit for building modern web apps
1,343 lines (1,334 loc) • 386 kB
TypeScript
import * as i0 from '@angular/core';
import { EventEmitter, InjectionToken, QueryList, ElementRef, TemplateRef, ChangeDetectorRef, ViewContainerRef, DoCheck, IterableDiffer, OnDestroy, AfterViewInit, OnInit, AfterContentInit, IterableDiffers, PipeTransform, EnvironmentInjector, Injector, NgZone, OnChanges, SimpleChanges } from '@angular/core';
import * as igniteui_angular_core from 'igniteui-angular/core';
import { IBaseEventArgs, GridTypeBase, GridColumnDataType, ColumnType, CancelableEventArgs, IFilteringExpressionsTree, ISortingExpression, IGroupingExpression, TransactionService, Transaction, State, SortingDirection, IDataCloneStrategy, IGridMergeStrategy, IGridResourceStrings, ɵSize as _Size, IgxSummaryResult, IGroupByRecord, ITreeGridRecord, IPathSegment, ColumnPinningPosition, FilteringExpressionsTree, GridSummaryCalculationMode, IGridSortingStrategy, IGridGroupingStrategy, FilteringLogic, IFilteringStrategy, ISortingOptions, IGroupByExpandState, IgxOverlayOutletDirective, OverlaySettings, IFilteringExpression, IgxOverlayService, IFilteringOperation, PlatformUtil, IgxFilteringOperand, ISortingStrategy, IColumnPipeArgs, IColumnEditorOptions, MRLColumnSizeInfo, MRLResizeColumnInfo, FieldType, IgxFilterItem, trackByIdentity, IgxActionStripToken, IPagingState, IGroupingState, FilteringStrategy, PositionSettings, ConnectedPositioningStrategy, Point } from 'igniteui-angular/core';
import { IBaseSearchInfo, IgxGridForOfDirective, IForOfState, IgxToggleDirective, IgxForOfDirective, IDragStartEventArgs, IgxButtonDirective, IgxDropDirective, IgxDragDirective, ToggleViewCancelableEventArgs, ToggleViewEventArgs, IgxTooltipDirective, IgxTextHighlightDirective } from 'igniteui-angular/directives';
import { Subject, Observable, Subscription } from 'rxjs';
import * as _angular_forms from '@angular/forms';
import { FormGroup, ValidationErrors, FormControl, RequiredValidator, MinValidator, MaxValidator, EmailValidator, MinLengthValidator, MaxLengthValidator, PatternValidator, Validator } from '@angular/forms';
import { IgxPaginatorComponent } from 'igniteui-angular/paginator';
import { IgxCheckboxComponent, IChangeCheckboxEventArgs } from 'igniteui-angular/checkbox';
import * as igniteui_angular_grids_core from 'igniteui-angular/grids/core';
import { IgxChipsAreaComponent, IgxChipComponent, IBaseChipEventArgs, IChipsAreaReorderEventArgs } from 'igniteui-angular/chips';
import { IgxQueryBuilderComponent } from 'igniteui-angular/query-builder';
import { IgxSelectComponent } from 'igniteui-angular/select';
import { IgxInputDirective } from 'igniteui-angular/input-group';
import { IgxButtonGroupComponent } from 'igniteui-angular/button-group';
import { IgxDropDownComponent, ISelectionEventArgs } from 'igniteui-angular/drop-down';
import { IgxListComponent } from 'igniteui-angular/list';
import { IgxTreeComponent, ITreeNodeSelectionEvent } from 'igniteui-angular/tree';
import { IgxIconService, IgxIconComponent } from 'igniteui-angular/icon';
import { IgxDatePickerComponent } from 'igniteui-angular/date-picker';
import { IgxTimePickerComponent } from 'igniteui-angular/time-picker';
import { jsPDF } from 'jspdf';
/**
* 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];
/**
* 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 cell merging modes for the grid elements.
* - 'never': Never merge cells.
* - 'always': Always merge adjacent cells based on merge strategy.
* - 'onSort': Only merge cells in column that are sorted.
*/
declare const GridCellMergeMode: {
readonly always: "always";
readonly onSort: "onSort";
};
type GridCellMergeMode = (typeof GridCellMergeMode)[keyof typeof GridCellMergeMode];
/** 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 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];
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);
}
declare enum ExportRecordType {
GroupedRecord = "GroupedRecord",
TreeGridRecord = "TreeGridRecord",
DataRecord = "DataRecord",
HierarchicalGridRecord = "HierarchicalGridRecord",
HeaderRecord = "HeaderRecord",
SummaryRecord = "SummaryRecord",
PivotGridRecord = "PivotGridRecord"
}
declare enum ExportHeaderType {
RowHeader = "RowHeader",
ColumnHeader = "ColumnHeader",
MultiRowHeader = "MultiRowHeader",
MultiColumnHeader = "MultiColumnHeader",
PivotRowHeader = "PivotRowHeader",
PivotMergedHeader = "PivotMergedHeader"
}
interface IExportRecord {
data: any;
level: number;
type: ExportRecordType;
owner?: string | GridTypeBase;
hidden?: boolean;
summaryKey?: string;
hierarchicalOwner?: string;
references?: IColumnInfo[];
rawData?: any;
dimensionKeys?: string[];
}
interface IColumnList {
columns: IColumnInfo[];
columnWidths: number[];
indexOfLastPinnedColumn: number;
maxLevel?: number;
maxRowLevel?: number;
}
interface IColumnInfo {
header: string;
field: string;
skip: boolean;
dataType?: GridColumnDataType;
skipFormatter?: boolean;
formatter?: any;
headerType?: ExportHeaderType;
startIndex?: number;
columnSpan?: number;
rowSpan?: number;
level?: number;
exportIndex?: number;
pinnedIndex?: number;
columnGroupParent?: ColumnType | string;
columnGroup?: ColumnType | string;
currencyCode?: string;
displayFormat?: string;
dateFormat?: string;
digitsInfo?: string;
}
/**
* rowExporting event arguments
* this.exporterService.rowExporting.subscribe((args: IRowExportingEventArgs) => {
* // set args properties here
* })
*/
interface IRowExportingEventArgs extends IBaseEventArgs {
/**
* Contains the exporting row data
*/
rowData: any;
/**
* Contains the exporting row index
*/
rowIndex: number;
/**
* Skip the exporting row when set to true
*/
cancel: boolean;
}
/**
* columnExporting event arguments
* ```typescript
* this.exporterService.columnExporting.subscribe((args: IColumnExportingEventArgs) => {
* // set args properties here
* });
* ```
*/
interface IColumnExportingEventArgs extends IBaseEventArgs {
/**
* Contains the exporting column header
*/
header: string;
/**
* Contains the exporting column field name
*/
field: string;
/**
* Contains the exporting column index
*/
columnIndex: number;
/**
* Skip the exporting column when set to true
*/
cancel: boolean;
/**
* Export the column's data without applying its formatter, when set to true
*/
skipFormatter: boolean;
/**
* A reference to the grid owner.
*/
grid?: GridTypeBase;
}
declare const DEFAULT_OWNER = "default";
declare const GRID_ROOT_SUMMARY = "igxGridRootSummary";
declare const GRID_PARENT = "grid-parent";
declare const GRID_LEVEL_COL = "GRID_LEVEL_COL";
declare abstract class IgxBaseExporter {
exportEnded: EventEmitter<IBaseEventArgs>;
/**
* This event is emitted when a row is exported.
* ```typescript
* this.exporterService.rowExporting.subscribe((args: IRowExportingEventArgs) => {
* // put event handler code here
* });
* ```
*
* @memberof IgxBaseExporter
*/
rowExporting: EventEmitter<IRowExportingEventArgs>;
/**
* This event is emitted when a column is exported.
* ```typescript
* this.exporterService.columnExporting.subscribe((args: IColumnExportingEventArgs) => {
* // put event handler code here
* });
* ```
*
* @memberof IgxBaseExporter
*/
columnExporting: EventEmitter<IColumnExportingEventArgs>;
protected _sort: any;
protected pivotGridFilterFieldsCount: number;
protected _ownersMap: Map<any, IColumnList>;
private locale;
private _setChildSummaries;
private isPivotGridExport;
private options;
private summaries;
private rowIslandCounter;
private flatRecords;
private pivotGridColumns;
private pivotGridRowDimensionsMap;
private ownerGrid;
/**
* Method for exporting IgxGrid component's data.
* ```typescript
* this.exporterService.export(this.igxGridForExport, this.exportOptions);
* ```
*
* @memberof IgxBaseExporter
*/
export(grid: any, options: IgxExporterOptionsBase): void;
/**
* Method for exporting any kind of array data.
* ```typescript
* this.exporterService.exportData(this.arrayForExport, this.exportOptions);
* ```
*
* @memberof IgxBaseExporter
*/
exportData(data: any[], options: IgxExporterOptionsBase): void;
private addToRowDimensionsMap;
private exportGridRecordsData;
private calculateColumnSpans;
private exportRow;
private reorderColumns;
private prepareData;
private preparePivotGridData;
private prepareHierarchicalGridData;
private addHierarchicalGridData;
private prepareSummaries;
private prepareIslandData;
private getAllChildColumnsAndData;
private prepareGridData;
private prepareTreeGridData;
private addTreeGridData;
private getTreeGridChildData;
private addFlatData;
private setSummaries;
private addGroupedData;
private getColumns;
private mapHierarchicalGridColumns;
private getAutoGeneratedColumns;
private addPivotRowHeaders;
private addPivotGridColumns;
private preparePivotGridColumns;
private groupByKeys;
private calculateRowSpan;
private createRowDimension;
private addLevelColumns;
private addLevelData;
private resetDefaults;
protected abstract exportDataImplementation(data: any[], options: IgxExporterOptionsBase, done: () => void): void;
}
/** 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 {
/** The scroll direction - vertical or horizontal. */
direction: string;
/** The original browser scroll event. */
event: Event;
/** The new scroll position */
scrollPosition: number;
}
/**
* Event emitted when a checkbox in the checkbox
* list of an IgxColumnActions component is clicked.
*/
interface IColumnToggledEventArgs extends IBaseEventArgs {
/** The column that is toggled. */
column: ColumnType;
/** The checked state after the action. */
checked: boolean;
}
/** Emitted when the active node is changed */
interface IActiveNodeChangeEventArgs extends IBaseEventArgs {
/** Represents the row index of the active node */
row: number;
/** Represents the column index of the active node */
column: number;
/**
* Optional
* Represents the hierarchical level of the active node
*/
level?: number;
/**
* Represents the type of the active node.
* The GridKeydownTargetType is an enum or that specifies the possible target types
*/
tag: GridKeydownTargetType;
}
/**
* Represents event arguments related to sorting and grouping operations
* The event is cancelable
*/
interface ISortingEventArgs extends IBaseEventArgs, CancelableEventArgs {
/**
* Optional
* Represents the sorting expressions applied to the grid.
* It can be a single sorting expression or an array of them
* The expression contains information like file name, whether the letter case should be taken into account, etc.
*/
sortingExpressions?: ISortingExpression | Array<ISortingExpression>;
/**
* Optional
* Represents the grouping expressions applied to the grid.
* It can be a single grouping expression or an array of them
* The expression contains information like the sorting expression and criteria by which the elements will be grouped
*/
groupingExpressions?: IGroupingExpression | Array<IGroupingExpression>;
}
/** @hidden @internal */
interface IColumnsAutoGeneratedEventArgs extends IBaseEventArgs {
columns?: ColumnType[];
}
/**
* Represents event arguments related to filtering operations
* The event is cancelable
*/
interface IFilteringEventArgs extends IBaseEventArgs, CancelableEventArgs {
/**
* Represents the filtering expressions applied to the grid.
* The expression contains information like filtering operands and operator, an expression or condition, etc.
*/
filteringExpressions: IFilteringExpressionsTree;
}
/** The event arguments after a column's visibility is changed. */
interface IColumnVisibilityChangedEventArgs extends IBaseEventArgs {
/** Represents the column the event originated from */
column: any;
/**
* The new hidden state that the column will have, if operation is successful.
* Will be `true` when hiding and `false` when showing.
*/
newValue: boolean;
}
/**
* The event arguments when a column's visibility is changed.
* The event is cancelable
* It contains information about the column and the it's visibility after the operation (will be `true` when hiding and `false` when showing)
*/
interface IColumnVisibilityChangingEventArgs extends IColumnVisibilityChangedEventArgs, CancelableEventArgs {
}
declare class IgxEditRow {
id: any;
index: number;
data: any;
grid: GridType;
transactionState: any;
state: any;
newData: any;
rowFormGroup: FormGroup<{}>;
constructor(id: any, index: number, data: any, grid: GridType);
createRowEditEventArgs(includeNewValue?: boolean, event?: Event): IGridEditEventArgs;
createRowDataEventArgs(event?: Event): IRowDataCancelableEventArgs;
createRowEditDoneEventArgs(cachedRowData: any, event?: Event): IGridEditDoneEventArgs;
get isAddRow(): boolean;
}
declare class IgxAddRow extends IgxEditRow {
recordRef: any;
constructor(id: any, index: number, data: any, recordRef: any, grid: GridType);
createRowEditEventArgs(includeNewValue?: boolean, event?: Event): IGridEditEventArgs;
createRowEditDoneEventArgs(cachedRowData: any, event?: Event): IGridEditDoneEventArgs;
get isAddRow(): boolean;
}
interface IgxAddRowParent {
/**
* @deprecated since version 17.1.0. Use `rowKey` instead
*/
rowID: string;
rowKey: any;
index: number;
asChild: boolean;
isPinned: boolean;
}
declare class IgxCell {
id: any;
rowIndex: number;
column: any;
value: any;
_editValue: any;
rowData: any;
grid: GridType;
primaryKey: any;
state: any;
pendingValue: any;
constructor(id: any, rowIndex: number, column: any, value: any, _editValue: any, rowData: any, grid: GridType);
get editValue(): any;
set editValue(value: any);
castToNumber(value: any): any;
createCellEditEventArgs(includeNewValue?: boolean, event?: Event): IGridEditEventArgs;
createCellEditDoneEventArgs(value: any, event?: Event): IGridEditDoneEventArgs;
}
declare class IgxCellCrudState {
grid: GridType;
cell: IgxCell | null;
row: IgxEditRow | null;
isInCompositionMode: boolean;
createCell(cell: any): IgxCell;
createRow(cell: IgxCell): IgxEditRow;
sameRow(rowID: any): boolean;
sameCell(cell: IgxCell): boolean;
get cellInEditMode(): boolean;
beginCellEdit(event?: Event): void;
cellEdit(event?: Event): IGridEditEventArgs;
updateCell(exit: boolean, event?: Event): IGridEditEventArgs;
cellEditDone(event: any, addRow: boolean): IGridEditDoneEventArgs;
/** Exit cell edit mode */
exitCellEdit(event?: Event): IGridEditDoneEventArgs;
/** Clears cell editing state */
endCellEdit(restoreFocus?: boolean): void;
/** Returns whether the targeted cell is in edit mode */
targetInEdit(rowIndex: number, columnIndex: number): boolean;
}
declare class IgxRowCrudState extends IgxCellCrudState {
closeRowEditingOverlay: Subject<unknown>;
private _rowEditingBlocked;
private _rowEditingStarted;
get primaryKey(): any;
get rowInEditMode(): RowType;
get rowEditing(): boolean;
get nonEditable(): boolean;
get rowEditingBlocked(): boolean;
set rowEditingBlocked(val: boolean);
/** Enters row edit mode */
beginRowEdit(event?: Event): boolean;
rowEdit(event: Event): IGridEditEventArgs;
updateRow(commit: boolean, event?: Event): IGridEditEventArgs;
/**
* @hidden @internal
*/
endRowTransaction(commit: boolean, event?: Event): IGridEditEventArgs | IRowDataCancelableEventArgs;
rowEditDone(cachedRowData: any, event: Event): IGridEditDoneEventArgs;
/** Exit row edit mode */
exitRowEdit(cachedRowData: any, event?: Event): IGridEditDoneEventArgs;
/** Clears row editing state */
endRowEdit(): void;
/** Clears cell and row editing state and closes row editing template if it is open */
endEditMode(): void;
updateRowEditData(row: IgxEditRow, value?: any): void;
protected getParentRowId(): any;
}
declare class IgxRowAddCrudState extends IgxRowCrudState {
addRowParent: IgxAddRowParent;
/**
* @hidden @internal
*/
createAddRow(parentRow: RowType, asChild?: boolean): IgxAddRow;
/**
* @hidden @internal
*/
createAddRowParent(row: RowType, newRowAsChild?: boolean): void;
/**
* @hidden @internal
*/
endRowTransaction(commit: boolean, event?: Event): IGridEditEventArgs | IRowDataCancelableEventArgs;
/**
* @hidden @internal
*/
endAddRow(): void;
/**
* @hidden
* @internal
* TODO: consider changing modifier
*/
_findRecordIndexInView(rec: any): number;
protected getParentRowId(): any;
}
declare class IgxGridCRUDService extends IgxRowAddCrudState {
enterEditMode(cell: any, event?: Event): boolean;
/**
* Enters add row mode by creating temporary dummy so the user can fill in new row cells.
*
* @param parentRow Parent row after which the Add Row UI will be rendered.
* If `null` will show it at the bottom after all rows (or top if there are not rows).
* @param asChild Specifies if the new row should be added as a child to a tree row.
* @param event Base event that triggered the add row mode.
*/
enterAddRowMode(parentRow: RowType, asChild?: boolean, event?: Event): void;
/**
* Finishes the row transactions on the current row and returns whether the grid editing was canceled.
*
* @remarks
* If `commit === true`, passes them from the pending state to the data (or transaction service)
* @example
* ```html
* <button type="button" igxButton (click)="grid.endEdit(true)">Commit Row</button>
* ```
* @param commit
*/
endEdit(commit?: boolean, event?: Event): boolean;
static ɵfac: i0.ɵɵFactoryDeclaration<IgxGridCRUDService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<IgxGridCRUDService>;
}
/**
* Represents a range selection between certain rows and columns of the grid.
* Range selection can be made either through drag selection or through keyboard selection.
*/
interface GridSelectionRange {
/** The index of the starting row of the selection range. */
rowStart: number;
/** The index of the ending row of the selection range. */
rowEnd: number;
/**
* The identifier or index of the starting column of the selection range.
* It can be either a string representing the column's field name or a numeric index.
*/
columnStart: string | number;
/**
* The identifier or index of the ending column of the selection range.
* It can be either a string representing the column's field name or a numeric index.
*/
columnEnd: string | number;
}
/**
* Represents a single selected cell or node in a grid.
*/
interface ISelectionNode {
/**
* The index of the selected row.
*/
row: number;
/**
* The index of the selected column.
*/
column: number;
/**
* (Optional)
* Additional layout information for multi-row selection nodes.
*/
layout?: IMultiRowLayoutNode;
/**
* (Optional)
* Indicates if the selected node is a summary row.
* This property is true if the selected row is a summary row; otherwise, it is false.
*/
isSummaryRow?: boolean;
}
interface IMultiRowLayoutNode {
rowStart: number;
colStart: number;
rowEnd: number;
colEnd: number;
columnVisibleIndex: number;
}
/**
* Represents the state of the keyboard when selecting.
*/
interface ISelectionKeyboardState {
/** The selected node in the grid, if any. Can be null if no node is selected. */
node: null | ISelectionNode;
/** Indicates whether the Shift key is currently pressed during the selection. */
shift: boolean;
/** The range of the selected cells in the grid. Can be null when resetting the selection. */
range: GridSelectionRange;
/** Indicates whether the selection is currently active (being performed). `False` when resetting the selection. */
active: boolean;
}
/**
* Represents the state of the grid selection using pointer interactions (mouse).
* Extends ISelectionKeyboardState to include pointer-specific properties.
*/
interface ISelectionPointerState extends ISelectionKeyboardState {
/** Indicates whether the Ctrl key is currently pressed during the selection. */
ctrl: boolean;
/** Indicates whether the primary pointer button is pressed during the selection (clicked). */
primaryButton: boolean;
}
/**
* Represents the state of the columns in the grid.
*/
interface IColumnSelectionState {
/** Represents the field name of the selected column, if any. Can be null if no column is selected. */
field: null | string;
/** An array of strings representing the ranges of selected columns in the grid. */
range: string[];
}
/**
* Represents the overall state of grid selection, combining both keyboard and pointer interaction states.
* It can be either an ISelectionKeyboardState or an ISelectionPointerState.
*/
type SelectionState = ISelectionKeyboardState | ISelectionPointerState;
/**
* Injection token for accessing the grid transaction object.
* This allows injecting the grid transaction object into components or services.
*/
declare const IgxGridTransaction: InjectionToken<TransactionService<Transaction, State>>;
/**
* This enumeration is used to configure whether the drop position is set before or after
* the target.
*/
declare enum DropPosition {
BeforeDropTarget = 0,
AfterDropTarget = 1
}
/**
* @hidden
* @internal
*/
declare class IgxColumnMovingService {
cancelDrop: boolean;
icon: HTMLElement;
column: ColumnType;
static ɵfac: i0.ɵɵFactoryDeclaration<IgxColumnMovingService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<IgxColumnMovingService>;
}
declare class IgxGridValidationService {
/**
* @hidden
* @internal
*/
grid: GridType;
private _validityStates;
private _valid;
/** Gets whether state is valid.
*/
get valid(): boolean;
/**
* @hidden
* @internal
*/
create(rowId: any, data: any): FormGroup<any>;
/**
* @hidden
* @internal
*/
private addFormControl;
/**
* @hidden
* @internal
Wraps the provided path into an array. This way FormGroup.get will return proper result.
Otherwise, if the path is a string (e.g. 'address.street'), FormGroup.get will treat it as there is a nested structure
and will look for control with a name of 'address' which returns undefined.
*/
private getFormControlPath;
/**
* @hidden
* @internal
*/
getFormGroup(id: any): FormGroup<any>;
/**
* @hidden
* @internal
*/
getFormControl(rowId: any, columnKey: string): _angular_forms.AbstractControl<any, any, any>;
/**
* @hidden
* @internal
*/
add(rowId: any, form: FormGroup): void;
/**
* Checks the validity of the native ngControl
*/
isFieldInvalid(formGroup: FormGroup, fieldName: string): boolean;
/**
* Checks the validity of the native ngControl after edit
*/
isFieldValidAfterEdit(formGroup: FormGroup, fieldName: string): boolean;
/**
* @hidden
* @internal
*/
private getValidity;
/**
* Returns all invalid record states.
*/
getInvalid(): IRecordValidationState[];
/**
* @hidden
* @internal
*/
update(rowId: any, rowData: any): void;
/**
* @hidden
* @internal
* Update validity based on new data.
*/
updateAll(newData: any): void;
/** Marks the associated record or field as touched.
* @param key The id of the record that will be marked as touched.
* @param field Optional. The field from the record that will be marked as touched. If not provided all fields will be touched.
*/
markAsTouched(key: any, field?: string): void;
/**
* @hidden
* @internal
*/
private updateStatus;
/** Clears validation state by key or all states if none is provided.
* @param key Optional. The key of the record for which to clear state.
*/
clear(key?: any): void;
static ɵfac: i0.ɵɵFactoryDeclaration<IgxGridValidationService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<IgxGridValidationService>;
}
/**
* Default pivot keys used for data processing in the pivot pipes.
*/
declare const DEFAULT_PIVOT_KEYS: {
aggregations: string;
records: string;
children: string;
level: string;
rowDimensionSeparator: string;
columnDimensionSeparator: string;
};
/**
* Event emitted when dimension collection for rows, columns of filters is changed.
*/
interface IDimensionsChange {
/** The new list of dimensions. */
dimensions: IPivotDimension[];
/** The dimension list type - Row, Column or Filter. */
dimensionCollectionType: PivotDimensionType;
}
/**
* Event emitted when values list is changed.
*/
interface IValuesChange {
/** The new list of values. */
values: IPivotValue[];
}
/**
* Event emitted when pivot configuration is changed.
*/
interface IPivotConfigurationChangedEventArgs {
/** The new configuration. */
pivotConfiguration: IPivotConfiguration;
}
/**
* Interface describing Pivot data processing for dimensions.
* Should contain a process method and return records hierarchy based on the provided dimensions.
*/
interface IPivotDimensionStrategy {
process(collection: any, dimensions: IPivotDimension[], values: IPivotValue[], cloneStrategy: IDataCloneStrategy, pivotKeys?: IPivotKeys): any[];
}
/**
* Interface describing a PivotAggregation function.
* Accepts an array of extracted data members and a array of the original data records.
*/
type PivotAggregation = (members: any[], data: any[]) => any;
/**
* Interface describing a IPivotAggregator class.
* Used for specifying custom aggregator lists.
*/
interface IPivotAggregator {
/** Aggregation unique key. */
key: string;
/** Aggregation label to show in the UI. */
label: string;
/**
* Aggregation name that will be used from a list of predefined aggregations.
* If not set will use the specified aggregator function.
*/
aggregatorName?: PivotAggregationType;
/**
* A