diff --git a/projects/igniteui-angular/src/lib/services/overlay/overlay.ts b/projects/igniteui-angular/src/lib/services/overlay/overlay.ts
index 4fa58e6c4f2..2a4ac31b4c3 100644
--- a/projects/igniteui-angular/src/lib/services/overlay/overlay.ts
+++ b/projects/igniteui-angular/src/lib/services/overlay/overlay.ts
@@ -116,7 +116,7 @@ export class IgxOverlayService implements OnDestroy {
*/
// tslint:disable-next-line:unified-signatures
show(component: ElementRef | Type<{}>, settings?: OverlaySettings): string;
- show(compOrId: string | ElementRef | Type<{}> , settings?: OverlaySettings): string {
+ show(compOrId: string | ElementRef | Type<{}>, settings?: OverlaySettings): string {
let info: OverlayInfo;
let id: string;
if (typeof compOrId === 'string') {
@@ -155,7 +155,8 @@ export class IgxOverlayService implements OnDestroy {
// opening. Otherwise, if there is close animation player playing animation now we should not setup
// overlay this is already done
if (!info.closeAnimationPlayer || (info.closeAnimationPlayer && !info.closeAnimationPlayer.hasStarted())) {
- info.initialSize = info.elementRef.nativeElement.getBoundingClientRect();
+ const elementRect = info.elementRef.nativeElement.getBoundingClientRect();
+ info.initialSize = { width: elementRect.width, height: elementRect.height };
info.hook = this.placeElementHook(info.elementRef.nativeElement);
this.moveElementToOverlay(info);
diff --git a/projects/igniteui-angular/src/lib/services/overlay/position/IPositionStrategy.ts b/projects/igniteui-angular/src/lib/services/overlay/position/IPositionStrategy.ts
index 3153051d1f6..49807d9a695 100644
--- a/projects/igniteui-angular/src/lib/services/overlay/position/IPositionStrategy.ts
+++ b/projects/igniteui-angular/src/lib/services/overlay/position/IPositionStrategy.ts
@@ -1,10 +1,13 @@
-import { PositionSettings } from './../utilities';
+import { PositionSettings, Size } from './../utilities';
/**
* [Documentation](https://www.infragistics.com/products/ignite-ui-angular/angular/components/overlay_position.html)
* Position strategies determine where to display the component in the provided IgxOverlayService.
*/
export interface IPositionStrategy {
+ /**
+ * PositionSettings to use when position the component in the overlay
+ */
settings: PositionSettings;
/**
@@ -17,5 +20,5 @@ export interface IPositionStrategy {
* settings.positionStrategy.position(content, size, document, true);
* ```
*/
- position(contentElement: HTMLElement, size?: {}, document?: Document, initialCall?: boolean): void;
+ position(contentElement: HTMLElement, size?: Size, document?: Document, initialCall?: boolean): void;
}
diff --git a/projects/igniteui-angular/src/lib/services/overlay/position/auto-position-strategy.ts b/projects/igniteui-angular/src/lib/services/overlay/position/auto-position-strategy.ts
index 52988b323d1..1e1b68875d5 100644
--- a/projects/igniteui-angular/src/lib/services/overlay/position/auto-position-strategy.ts
+++ b/projects/igniteui-angular/src/lib/services/overlay/position/auto-position-strategy.ts
@@ -1,4 +1,4 @@
-import { PositionSettings, VerticalAlignment, HorizontalAlignment, Point } from './../utilities';
+import { PositionSettings, VerticalAlignment, HorizontalAlignment, Size } from './../utilities';
import { IPositionStrategy } from './IPositionStrategy';
import { ConnectedPositioningStrategy } from './connected-positioning-strategy';
@@ -9,6 +9,7 @@ enum Axis {
export class AutoPositionStrategy extends ConnectedPositioningStrategy implements IPositionStrategy {
public offsetPadding = 16;
private _initialSettings;
+
getViewPort(document) { // Material Design implementation
const clientRect = document.documentElement.getBoundingClientRect();
const scrollPosition = {
@@ -29,9 +30,9 @@ export class AutoPositionStrategy extends ConnectedPositioningStrategy implement
}
-
// The position method should return a
container that will host the component
- position(contentElement: HTMLElement, size: { width: number, height: number }, document?: Document, initialCall?: boolean): void {
+ /** @inheritdoc */
+ position(contentElement: HTMLElement, size?: Size, document?: Document, initialCall?: boolean): void {
if (!initialCall) {
super.position(contentElement, size);
return;
diff --git a/projects/igniteui-angular/src/lib/services/overlay/position/connected-positioning-strategy.ts b/projects/igniteui-angular/src/lib/services/overlay/position/connected-positioning-strategy.ts
index 5b9f2e4cbc7..cc5761ea3e6 100644
--- a/projects/igniteui-angular/src/lib/services/overlay/position/connected-positioning-strategy.ts
+++ b/projects/igniteui-angular/src/lib/services/overlay/position/connected-positioning-strategy.ts
@@ -1,5 +1,5 @@
import { IPositionStrategy } from './IPositionStrategy';
-import { PositionSettings, Point, HorizontalAlignment, VerticalAlignment, getPointFromPositionsSettings } from './../utilities';
+import { PositionSettings, Point, HorizontalAlignment, VerticalAlignment, getPointFromPositionsSettings, Size } from './../utilities';
import { scaleInVerTop, scaleOutVerTop } from '../../../animations/main';
export class ConnectedPositioningStrategy implements IPositionStrategy {
@@ -14,13 +14,16 @@ export class ConnectedPositioningStrategy implements IPositionStrategy {
closeAnimation: scaleOutVerTop
};
+ /** @inheritdoc */
public settings: PositionSettings;
+
constructor(settings?: PositionSettings) {
this.settings = Object.assign({}, this._defaultSettings, settings);
}
// we no longer use the element inside the position() as its dimensions are cached in rect
- position(contentElement: HTMLElement, size: { width: number, height: number}, document?: Document, initialCall?: boolean): void {
+ /** @inheritdoc */
+ position(contentElement: HTMLElement, size?: Size, document?: Document, initialCall?: boolean): void {
const startPoint = getPointFromPositionsSettings(this.settings, contentElement.parentElement);
contentElement.style.top = startPoint.y + this.settings.verticalDirection * size.height + 'px';
diff --git a/projects/igniteui-angular/src/lib/services/overlay/position/global-position-strategy.ts b/projects/igniteui-angular/src/lib/services/overlay/position/global-position-strategy.ts
index fb442d24d75..dc17a6ff189 100644
--- a/projects/igniteui-angular/src/lib/services/overlay/position/global-position-strategy.ts
+++ b/projects/igniteui-angular/src/lib/services/overlay/position/global-position-strategy.ts
@@ -1,5 +1,5 @@
import { IPositionStrategy } from './IPositionStrategy';
-import { PositionSettings, Point, HorizontalAlignment, VerticalAlignment } from './../utilities';
+import { PositionSettings, Point, HorizontalAlignment, VerticalAlignment, Size } from './../utilities';
import { fadeIn, fadeOut } from '../../../animations/main';
export class GlobalPositionStrategy implements IPositionStrategy {
@@ -12,12 +12,15 @@ export class GlobalPositionStrategy implements IPositionStrategy {
closeAnimation: fadeOut
};
+ /** @inheritdoc */
public settings: PositionSettings;
+
constructor(settings?: PositionSettings) {
this.settings = Object.assign({}, this._defaultSettings, settings);
}
- position(contentElement: HTMLElement, size?: { width: number, height: number}, document?: Document, initialCall?: boolean): void {
+ /** @inheritdoc */
+ position(contentElement: HTMLElement, size?: Size, document?: Document, initialCall?: boolean): void {
switch (this.settings.horizontalDirection) {
case HorizontalAlignment.Left:
contentElement.parentElement.style.justifyContent = 'flex-start';
diff --git a/projects/igniteui-angular/src/lib/services/overlay/scroll/IScrollStrategy.ts b/projects/igniteui-angular/src/lib/services/overlay/scroll/IScrollStrategy.ts
index 38c3dce51b1..2e3dadbc438 100644
--- a/projects/igniteui-angular/src/lib/services/overlay/scroll/IScrollStrategy.ts
+++ b/projects/igniteui-angular/src/lib/services/overlay/scroll/IScrollStrategy.ts
@@ -3,9 +3,7 @@ import { IgxOverlayService } from '../overlay';
* [Documentation](https://www.infragistics.com/products/ignite-ui-angular/angular/components/overlay_scroll.html).
* Scroll strategies determines how the scrolling will be handled in the provided IgxOverlayService.
*/
-export class IScrollStrategy {
- constructor(scrollContainer?: HTMLElement) { }
-
+export interface IScrollStrategy {
/**
* Initializes the strategy. Should be called once
* @param document reference to Document object.
@@ -15,7 +13,7 @@ export class IScrollStrategy {
* settings.scrollStrategy.initialize(document, overlay, id);
* ```
*/
- initialize(document: Document, overlayService: IgxOverlayService, id: string) { }
+ initialize(document: Document, overlayService: IgxOverlayService, id: string);
/**
* Attaches the strategy
@@ -23,7 +21,7 @@ export class IScrollStrategy {
* settings.scrollStrategy.attach();
* ```
*/
- attach(): void { }
+ attach(): void;
/**
* Detaches the strategy
@@ -31,5 +29,5 @@ export class IScrollStrategy {
* settings.scrollStrategy.detach();
* ```
*/
- detach(): void { }
+ detach(): void;
}
diff --git a/projects/igniteui-angular/src/lib/services/overlay/scroll/NoOpScrollStrategy.ts b/projects/igniteui-angular/src/lib/services/overlay/scroll/NoOpScrollStrategy.ts
index 15caf9e12ba..0454332c82c 100644
--- a/projects/igniteui-angular/src/lib/services/overlay/scroll/NoOpScrollStrategy.ts
+++ b/projects/igniteui-angular/src/lib/services/overlay/scroll/NoOpScrollStrategy.ts
@@ -1,9 +1,16 @@
-import { IScrollStrategy } from './IScrollStrategy';
import { IgxOverlayService } from '../overlay';
+import { ScrollStrategy } from './scroll-strategy';
-export class NoOpScrollStrategy implements IScrollStrategy {
- constructor(scrollContainer?: HTMLElement) { }
- initialize(document: Document, overlayService: IgxOverlayService, id: string) {}
+export class NoOpScrollStrategy extends ScrollStrategy {
+ constructor(scrollContainer?: HTMLElement) {
+ super(scrollContainer);
+ }
+ /** @inheritdoc */
+ public initialize(document: Document, overlayService: IgxOverlayService, id: string) { }
+
+ /** @inheritdoc */
attach(): void { }
+
+ /** @inheritdoc */
detach(): void { }
}
diff --git a/projects/igniteui-angular/src/lib/services/overlay/scroll/absolute-scroll-strategy.ts b/projects/igniteui-angular/src/lib/services/overlay/scroll/absolute-scroll-strategy.ts
index 6d8bcb021bb..35af570050d 100644
--- a/projects/igniteui-angular/src/lib/services/overlay/scroll/absolute-scroll-strategy.ts
+++ b/projects/igniteui-angular/src/lib/services/overlay/scroll/absolute-scroll-strategy.ts
@@ -1,7 +1,7 @@
-import { IScrollStrategy } from './IScrollStrategy';
import { IgxOverlayService } from '../overlay';
+import { ScrollStrategy } from './scroll-strategy';
-export class AbsoluteScrollStrategy implements IScrollStrategy {
+export class AbsoluteScrollStrategy extends ScrollStrategy {
private _initialized = false;
private _document: Document;
private _overlayService: IgxOverlayService;
@@ -9,10 +9,12 @@ export class AbsoluteScrollStrategy implements IScrollStrategy {
private _scrollContainer: HTMLElement;
constructor(scrollContainer?: HTMLElement) {
+ super(scrollContainer);
this._scrollContainer = scrollContainer;
}
- initialize(document: Document, overlayService: IgxOverlayService, id: string) {
+ /** @inheritdoc */
+ public initialize(document: Document, overlayService: IgxOverlayService, id: string) {
if (this._initialized) {
return;
}
@@ -22,7 +24,8 @@ export class AbsoluteScrollStrategy implements IScrollStrategy {
this._initialized = true;
}
- attach(): void {
+ /** @inheritdoc */
+ public attach(): void {
if (this._scrollContainer) {
this._scrollContainer.addEventListener('scroll', this.onScroll, true);
} else {
@@ -30,7 +33,8 @@ export class AbsoluteScrollStrategy implements IScrollStrategy {
}
}
- detach(): void {
+ /** @inheritdoc */
+ public detach(): void {
if (this._scrollContainer) {
this._scrollContainer.removeEventListener('scroll', this.onScroll, true);
} else {
diff --git a/projects/igniteui-angular/src/lib/services/overlay/scroll/block-scroll-strategy.ts b/projects/igniteui-angular/src/lib/services/overlay/scroll/block-scroll-strategy.ts
index c7e9cba8bde..7ab9fdf8095 100644
--- a/projects/igniteui-angular/src/lib/services/overlay/scroll/block-scroll-strategy.ts
+++ b/projects/igniteui-angular/src/lib/services/overlay/scroll/block-scroll-strategy.ts
@@ -1,16 +1,19 @@
-import { IScrollStrategy } from './IScrollStrategy';
import { IgxOverlayService } from '../overlay';
+import { ScrollStrategy } from './scroll-strategy';
-export class BlockScrollStrategy implements IScrollStrategy {
+export class BlockScrollStrategy extends ScrollStrategy {
private _initialized = false;
private _document: Document;
private _initialScrollTop: number;
private _initialScrollLeft: number;
private _sourceElement: Element;
- constructor(scrollContainer?: HTMLElement) { }
+ constructor(scrollContainer?: HTMLElement) {
+ super(scrollContainer);
+ }
- initialize(document: Document, overlayService: IgxOverlayService, id: string) {
+ /** @inheritdoc */
+ public initialize(document: Document, overlayService: IgxOverlayService, id: string) {
if (this._initialized) {
return;
}
@@ -19,11 +22,13 @@ export class BlockScrollStrategy implements IScrollStrategy {
this._initialized = true;
}
+ /** @inheritdoc */
public attach(): void {
this._document.addEventListener('scroll', this.onScroll, true);
this._document.addEventListener('wheel', this.onWheel, true);
}
+ /** @inheritdoc */
public detach(): void {
this._document.removeEventListener('scroll', this.onScroll, true);
this._document.removeEventListener('wheel', this.onWheel, true);
diff --git a/projects/igniteui-angular/src/lib/services/overlay/scroll/close-scroll-strategy.ts b/projects/igniteui-angular/src/lib/services/overlay/scroll/close-scroll-strategy.ts
index 51b40935261..9937f610de2 100644
--- a/projects/igniteui-angular/src/lib/services/overlay/scroll/close-scroll-strategy.ts
+++ b/projects/igniteui-angular/src/lib/services/overlay/scroll/close-scroll-strategy.ts
@@ -1,7 +1,7 @@
-import { IScrollStrategy } from './IScrollStrategy';
import { IgxOverlayService } from '../overlay';
+import { ScrollStrategy } from './scroll-strategy';
-export class CloseScrollStrategy implements IScrollStrategy {
+export class CloseScrollStrategy extends ScrollStrategy {
private _document: Document;
private _overlayService: IgxOverlayService;
private _id: string;
@@ -15,13 +15,15 @@ export class CloseScrollStrategy implements IScrollStrategy {
private _scrollContainer: HTMLElement;
constructor(scrollContainer?: HTMLElement) {
+ super(scrollContainer);
this._scrollContainer = scrollContainer;
this._threshold = 10;
this.cumulativeScrollTop = 0;
this.cumulativeScrollLeft = 0;
}
- initialize(document: Document, overlayService: IgxOverlayService, id: string) {
+ /** @inheritdoc */
+ public initialize(document: Document, overlayService: IgxOverlayService, id: string) {
if (this._initialized) {
return;
}
@@ -31,7 +33,8 @@ export class CloseScrollStrategy implements IScrollStrategy {
this._initialized = true;
}
- attach(): void {
+ /** @inheritdoc */
+ public attach(): void {
if (this._scrollContainer) {
this._scrollContainer.addEventListener('scroll', this.onScroll);
this._sourceElement = this._scrollContainer;
@@ -54,7 +57,8 @@ export class CloseScrollStrategy implements IScrollStrategy {
this.initialScrollLeft = this._sourceElement.scrollLeft;
}
- detach(): void {
+ /** @inheritdoc */
+ public detach(): void {
// TODO: check why event listener removes only on first call and remains on each next!!!
if (this._scrollContainer) {
this._scrollContainer.removeEventListener('scroll', this.onScroll);
diff --git a/projects/igniteui-angular/src/lib/services/overlay/scroll/index.ts b/projects/igniteui-angular/src/lib/services/overlay/scroll/index.ts
index adf97a40b29..6b18c13af60 100644
--- a/projects/igniteui-angular/src/lib/services/overlay/scroll/index.ts
+++ b/projects/igniteui-angular/src/lib/services/overlay/scroll/index.ts
@@ -1,7 +1,9 @@
+
// Export scroll strategies
+export * from './scroll-strategy';
+export * from './IScrollStrategy';
export * from './absolute-scroll-strategy';
export * from './block-scroll-strategy';
export * from './close-scroll-strategy';
-export * from './IScrollStrategy';
export * from './NoOpScrollStrategy';
diff --git a/projects/igniteui-angular/src/lib/services/overlay/scroll/scroll-strategy.ts b/projects/igniteui-angular/src/lib/services/overlay/scroll/scroll-strategy.ts
new file mode 100644
index 00000000000..35e59371174
--- /dev/null
+++ b/projects/igniteui-angular/src/lib/services/overlay/scroll/scroll-strategy.ts
@@ -0,0 +1,14 @@
+import { IScrollStrategy } from './IScrollStrategy';
+import { IgxOverlayService } from '../overlay';
+
+export abstract class ScrollStrategy implements IScrollStrategy {
+ constructor(scrollContainer?: HTMLElement) { }
+ /** @inheritdoc */
+ abstract initialize(document: Document, overlayService: IgxOverlayService, id: string);
+
+ /** @inheritdoc */
+ abstract attach(): void;
+
+ /** @inheritdoc */
+ abstract detach(): void;
+}
diff --git a/projects/igniteui-angular/src/lib/services/overlay/utilities.ts b/projects/igniteui-angular/src/lib/services/overlay/utilities.ts
index 797546f0857..3d6ad8d5b60 100644
--- a/projects/igniteui-angular/src/lib/services/overlay/utilities.ts
+++ b/projects/igniteui-angular/src/lib/services/overlay/utilities.ts
@@ -24,20 +24,32 @@ export class Point {
}
export interface PositionSettings {
+ /** Attaching target for the component to show */
target?: Point | HTMLElement;
+ /** Direction in which the component should show */
horizontalDirection?: HorizontalAlignment;
+ /** Direction in which the component should show */
verticalDirection?: VerticalAlignment;
+ /** Target's starting point */
horizontalStartPoint?: HorizontalAlignment;
+ /** Target's starting point */
verticalStartPoint?: VerticalAlignment;
+ /** Animation applied while overlay opens */
openAnimation?: AnimationReferenceMetadata;
+ /** Animation applied while overlay closes */
closeAnimation?: AnimationReferenceMetadata;
}
export interface OverlaySettings {
+ /** Position strategy to use with this settings */
positionStrategy?: IPositionStrategy;
+ /** Scroll strategy to use with this settings */
scrollStrategy?: IScrollStrategy;
+ /** Set if the overlay should be in modal mode */
modal?: boolean;
+ /** Set if the overlay should closed on outside click */
closeOnOutsideClick?: boolean;
+ /** Set the outlet container to attach the overlay to */
outlet?: IgxOverlayOutletDirective | ElementRef;
}
@@ -60,6 +72,14 @@ export interface OverlayAnimationEventArgs {
animationType: 'open' | 'close';
}
+export interface Size {
+ /** Gets or sets the horizontal component of Size */
+ width: number;
+
+ /** Gets or sets the vertical component of Size */
+ height: number;
+}
+
/** @hidden */
export function getPointFromPositionsSettings(settings: PositionSettings, overlayWrapper: HTMLElement): Point {
let result: Point = new Point(0, 0);
@@ -90,7 +110,7 @@ export interface OverlayInfo {
elementRef?: ElementRef;
componentRef?: ComponentRef<{}>;
settings?: OverlaySettings;
- initialSize?: { width?: number, height?: number, x?: number, y?: number };
+ initialSize?: Size;
hook?: HTMLElement;
openAnimationPlayer?: AnimationPlayer;
closeAnimationPlayer?: AnimationPlayer;
diff --git a/projects/igniteui-angular/src/lib/services/transaction/base-transaction.ts b/projects/igniteui-angular/src/lib/services/transaction/base-transaction.ts
index 6aa4c5e19cf..92f2cdbed79 100644
--- a/projects/igniteui-angular/src/lib/services/transaction/base-transaction.ts
+++ b/projects/igniteui-angular/src/lib/services/transaction/base-transaction.ts
@@ -7,18 +7,36 @@ export class IgxBaseTransactionService
i
protected _isPending = false;
protected _pendingTransactions: T[] = [];
protected _pendingStates: Map = new Map();
+
+ /**
+ * @inheritdoc
+ */
public get canRedo(): boolean {
return false;
}
+
+ /**
+ * @inheritdoc
+ */
public get canUndo(): boolean {
return false;
}
+
+ /**
+ * @inheritdoc
+ */
public get enabled(): boolean {
return this._isPending;
}
+ /**
+ * @inheritdoc
+ */
public onStateUpdate = new EventEmitter();
+ /**
+ * @inheritdoc
+ */
public add(transaction: T, recordRef?: any): void {
if (this._isPending) {
this.updateState(this._pendingStates, transaction, recordRef);
@@ -26,12 +44,24 @@ export class IgxBaseTransactionService i
}
}
+ /**
+ * @inheritdoc
+ */
getTransactionLog(id?: any): T[] { return []; }
+ /**
+ * @inheritdoc
+ */
undo(): void { }
+ /**
+ * @inheritdoc
+ */
redo(): void { }
+ /**
+ * @inheritdoc
+ */
getAggregatedChanges(mergeChanges: boolean): T[] {
const result: T[] = [];
this._pendingStates.forEach((state: S, key: any) => {
@@ -41,10 +71,16 @@ export class IgxBaseTransactionService i
return result;
}
+ /**
+ * @inheritdoc
+ */
public getState(id: any): S {
return this._pendingStates.get(id);
}
+ /**
+ * @inheritdoc
+ */
public getAggregatedValue(id: any, mergeChanges: boolean): any {
const state = this._pendingStates.get(id);
if (!state) {
@@ -56,17 +92,29 @@ export class IgxBaseTransactionService i
return state.value;
}
- commit(data: any): void { }
+ /**
+ * @inheritdoc
+ */
+ commit(data: any[]): void { }
+ /**
+ * @inheritdoc
+ */
clear(): void {
this._pendingStates.clear();
this._pendingTransactions = [];
}
+ /**
+ * @inheritdoc
+ */
public startPending(): void {
this._isPending = true;
}
+ /**
+ * @inheritdoc
+ */
public endPending(commit: boolean): void {
this._isPending = false;
this._pendingStates.clear();
diff --git a/projects/igniteui-angular/src/lib/services/transaction/igx-transaction.ts b/projects/igniteui-angular/src/lib/services/transaction/igx-transaction.ts
index c8f6e433956..82851be8b4e 100644
--- a/projects/igniteui-angular/src/lib/services/transaction/igx-transaction.ts
+++ b/projects/igniteui-angular/src/lib/services/transaction/igx-transaction.ts
@@ -10,16 +10,28 @@ export class IgxTransactionService exten
protected _undoStack: { transaction: T, recordRef: any }[][] = [];
protected _states: Map = new Map();
+ /**
+ * @inheritdoc
+ */
get canUndo(): boolean {
return this._undoStack.length > 0;
}
+ /**
+ * @inheritdoc
+ */
get canRedo(): boolean {
return this._redoStack.length > 0;
}
+ /**
+ * @inheritdoc
+ */
public onStateUpdate = new EventEmitter();
+ /**
+ * @inheritdoc
+ */
public add(transaction: T, recordRef?: any): void {
const states = this._isPending ? this._pendingStates : this._states;
this.verifyAddedTransaction(states, transaction, recordRef);
@@ -39,6 +51,9 @@ export class IgxTransactionService exten
}
}
+ /**
+ * @inheritdoc
+ */
public getTransactionLog(id?: any): T[] {
if (id) {
return this._transactions.filter(t => t.id === id);
@@ -46,6 +61,9 @@ export class IgxTransactionService exten
return [...this._transactions];
}
+ /**
+ * @inheritdoc
+ */
public getAggregatedChanges(mergeChanges: boolean): T[] {
const result: T[] = [];
this._states.forEach((state: S, key: any) => {
@@ -55,14 +73,23 @@ export class IgxTransactionService exten
return result;
}
+ /**
+ * @inheritdoc
+ */
public getState(id: any): S {
return this._states.get(id);
}
+ /**
+ * @inheritdoc
+ */
public get enabled(): boolean {
return true;
}
+ /**
+ * @inheritdoc
+ */
public getAggregatedValue(id: any, mergeChanges: boolean): any {
const state = this._states.get(id);
const pendingState = super.getState(id);
@@ -82,6 +109,9 @@ export class IgxTransactionService exten
return aggregatedValue;
}
+ /**
+ * @inheritdoc
+ */
public endPending(commit: boolean): void {
this._isPending = false;
if (commit) {
@@ -99,6 +129,9 @@ export class IgxTransactionService exten
super.endPending(commit);
}
+ /**
+ * @inheritdoc
+ */
public commit(data: any[]): void {
this._states.forEach((s: S) => {
const index = data.findIndex(i => JSON.stringify(i) === JSON.stringify(s.recordRef));
@@ -121,6 +154,9 @@ export class IgxTransactionService exten
this.clear();
}
+ /**
+ * @inheritdoc
+ */
public clear(): void {
this._transactions = [];
this._states.clear();
@@ -129,6 +165,9 @@ export class IgxTransactionService exten
this.onStateUpdate.emit();
}
+ /**
+ * @inheritdoc
+ */
public undo(): void {
if (this._undoStack.length <= 0) {
return;
@@ -148,6 +187,9 @@ export class IgxTransactionService exten
this.onStateUpdate.emit();
}
+ /**
+ * @inheritdoc
+ */
public redo(): void {
if (this._redoStack.length > 0) {
let actions: { transaction: T, recordRef: any, useInUndo?: boolean }[];
diff --git a/projects/igniteui-angular/src/lib/services/transaction/transaction.ts b/projects/igniteui-angular/src/lib/services/transaction/transaction.ts
index 5bc55a04357..471766578b8 100644
--- a/projects/igniteui-angular/src/lib/services/transaction/transaction.ts
+++ b/projects/igniteui-angular/src/lib/services/transaction/transaction.ts
@@ -61,7 +61,7 @@ export interface TransactionService {
* @param id Optional record id to get transactions for
* @returns All transaction in the service or for the specified record
*/
- getTransactionLog(id?: any): Transaction[];
+ getTransactionLog(id?: any): T[];
/**
* Remove the last transaction if any