import { IgcGridSelectedCellRangesCollection } from "./igc-grid-selected-cell-ranges-collection";
import { GridSelectedCellRangesChangedEventArgs as GridSelectedCellRangesChangedEventArgs_internal } from "./GridSelectedCellRangesChangedEventArgs";
import { GridSelectedCellRangesCollection as GridSelectedCellRangesCollection_internal } from "./GridSelectedCellRangesCollection";
import { CellRange } from "./CellRange";
import { SyncableObservableCollection$1 } from "igniteui-webcomponents-core";
/**
 * Information about the change to the selected cell ranges in the grid.
*/
export class IgcGridSelectedCellRangesChangedEventArgs {
    constructor() {
        this._currentRanges = null;
        this._addedRanges = null;
        this._removedRanges = null;
        this._updatedRanges = null;
        this._implementation = this.createImplementation();
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    }
    createImplementation() {
        return new GridSelectedCellRangesChangedEventArgs_internal();
    }
    /**
     * @hidden
     */
    get i() {
        return this._implementation;
    }
    onImplementationCreated() {
    }
    _provideImplementation(i) {
        this._implementation = i;
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    }
    /**
     * The cell ranges currently in the selection.
    */
    get currentRanges() {
        if (this._currentRanges === null) {
            let coll = new IgcGridSelectedCellRangesCollection();
            let innerColl = this.i.currentRanges;
            if (!innerColl) {
                innerColl = new GridSelectedCellRangesCollection_internal();
            }
            this._currentRanges = coll._fromInner(innerColl);
            this.i.currentRanges = innerColl;
        }
        return this._currentRanges;
    }
    set currentRanges(v) {
        if (this._currentRanges !== null) {
            this._currentRanges._setSyncTarget(null);
            this._currentRanges = null;
        }
        let coll = new IgcGridSelectedCellRangesCollection();
        this._currentRanges = coll._fromOuter(v);
        let syncColl = new SyncableObservableCollection$1(CellRange.$type);
        let innerColl = this.i.currentRanges;
        if (!innerColl) {
            innerColl = new GridSelectedCellRangesCollection_internal();
        }
        syncColl._inner = innerColl;
        syncColl.clear();
        this._currentRanges._setSyncTarget(syncColl);
        this.i.currentRanges = innerColl;
    }
    /**
     * The cell ranges added to the selection.
    */
    get addedRanges() {
        if (this._addedRanges === null) {
            let coll = new IgcGridSelectedCellRangesCollection();
            let innerColl = this.i.addedRanges;
            if (!innerColl) {
                innerColl = new GridSelectedCellRangesCollection_internal();
            }
            this._addedRanges = coll._fromInner(innerColl);
            this.i.addedRanges = innerColl;
        }
        return this._addedRanges;
    }
    set addedRanges(v) {
        if (this._addedRanges !== null) {
            this._addedRanges._setSyncTarget(null);
            this._addedRanges = null;
        }
        let coll = new IgcGridSelectedCellRangesCollection();
        this._addedRanges = coll._fromOuter(v);
        let syncColl = new SyncableObservableCollection$1(CellRange.$type);
        let innerColl = this.i.addedRanges;
        if (!innerColl) {
            innerColl = new GridSelectedCellRangesCollection_internal();
        }
        syncColl._inner = innerColl;
        syncColl.clear();
        this._addedRanges._setSyncTarget(syncColl);
        this.i.addedRanges = innerColl;
    }
    /**
     * The cell ranges removed from the selection.
    */
    get removedRanges() {
        if (this._removedRanges === null) {
            let coll = new IgcGridSelectedCellRangesCollection();
            let innerColl = this.i.removedRanges;
            if (!innerColl) {
                innerColl = new GridSelectedCellRangesCollection_internal();
            }
            this._removedRanges = coll._fromInner(innerColl);
            this.i.removedRanges = innerColl;
        }
        return this._removedRanges;
    }
    set removedRanges(v) {
        if (this._removedRanges !== null) {
            this._removedRanges._setSyncTarget(null);
            this._removedRanges = null;
        }
        let coll = new IgcGridSelectedCellRangesCollection();
        this._removedRanges = coll._fromOuter(v);
        let syncColl = new SyncableObservableCollection$1(CellRange.$type);
        let innerColl = this.i.removedRanges;
        if (!innerColl) {
            innerColl = new GridSelectedCellRangesCollection_internal();
        }
        syncColl._inner = innerColl;
        syncColl.clear();
        this._removedRanges._setSyncTarget(syncColl);
        this.i.removedRanges = innerColl;
    }
    /**
     * The cell ranges that have been updated by the grid.
    */
    get updatedRanges() {
        if (this._updatedRanges === null) {
            let coll = new IgcGridSelectedCellRangesCollection();
            let innerColl = this.i.updatedRanges;
            if (!innerColl) {
                innerColl = new GridSelectedCellRangesCollection_internal();
            }
            this._updatedRanges = coll._fromInner(innerColl);
            this.i.updatedRanges = innerColl;
        }
        return this._updatedRanges;
    }
    set updatedRanges(v) {
        if (this._updatedRanges !== null) {
            this._updatedRanges._setSyncTarget(null);
            this._updatedRanges = null;
        }
        let coll = new IgcGridSelectedCellRangesCollection();
        this._updatedRanges = coll._fromOuter(v);
        let syncColl = new SyncableObservableCollection$1(CellRange.$type);
        let innerColl = this.i.updatedRanges;
        if (!innerColl) {
            innerColl = new GridSelectedCellRangesCollection_internal();
        }
        syncColl._inner = innerColl;
        syncColl.clear();
        this._updatedRanges._setSyncTarget(syncColl);
        this.i.updatedRanges = innerColl;
    }
}
//# sourceMappingURL=igc-grid-selected-cell-ranges-changed-event-args.js.map
