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.
*/
var IgcGridSelectedCellRangesChangedEventArgs = /** @class */ /*@__PURE__*/ (function () {
    function IgcGridSelectedCellRangesChangedEventArgs() {
        this._currentRanges = null;
        this._addedRanges = null;
        this._removedRanges = null;
        this._updatedRanges = null;
        this._implementation = this.createImplementation();
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    }
    IgcGridSelectedCellRangesChangedEventArgs.prototype.createImplementation = function () {
        return new GridSelectedCellRangesChangedEventArgs_internal();
    };
    Object.defineProperty(IgcGridSelectedCellRangesChangedEventArgs.prototype, "i", {
        /**
         * @hidden
         */
        get: function () {
            return this._implementation;
        },
        enumerable: true,
        configurable: true
    });
    IgcGridSelectedCellRangesChangedEventArgs.prototype.onImplementationCreated = function () {
    };
    IgcGridSelectedCellRangesChangedEventArgs.prototype._provideImplementation = function (i) {
        this._implementation = i;
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    };
    Object.defineProperty(IgcGridSelectedCellRangesChangedEventArgs.prototype, "currentRanges", {
        /**
         * The cell ranges currently in the selection.
        */
        get: function () {
            if (this._currentRanges === null) {
                var coll = new IgcGridSelectedCellRangesCollection();
                var innerColl = this.i.currentRanges;
                if (!innerColl) {
                    innerColl = new GridSelectedCellRangesCollection_internal();
                }
                this._currentRanges = coll._fromInner(innerColl);
                this.i.currentRanges = innerColl;
            }
            return this._currentRanges;
        },
        set: function (v) {
            if (this._currentRanges !== null) {
                this._currentRanges._setSyncTarget(null);
                this._currentRanges = null;
            }
            var coll = new IgcGridSelectedCellRangesCollection();
            this._currentRanges = coll._fromOuter(v);
            var syncColl = new SyncableObservableCollection$1(CellRange.$type);
            var innerColl = this.i.currentRanges;
            if (!innerColl) {
                innerColl = new GridSelectedCellRangesCollection_internal();
            }
            syncColl._inner = innerColl;
            syncColl.clear();
            this._currentRanges._setSyncTarget(syncColl);
            this.i.currentRanges = innerColl;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridSelectedCellRangesChangedEventArgs.prototype, "addedRanges", {
        /**
         * The cell ranges added to the selection.
        */
        get: function () {
            if (this._addedRanges === null) {
                var coll = new IgcGridSelectedCellRangesCollection();
                var innerColl = this.i.addedRanges;
                if (!innerColl) {
                    innerColl = new GridSelectedCellRangesCollection_internal();
                }
                this._addedRanges = coll._fromInner(innerColl);
                this.i.addedRanges = innerColl;
            }
            return this._addedRanges;
        },
        set: function (v) {
            if (this._addedRanges !== null) {
                this._addedRanges._setSyncTarget(null);
                this._addedRanges = null;
            }
            var coll = new IgcGridSelectedCellRangesCollection();
            this._addedRanges = coll._fromOuter(v);
            var syncColl = new SyncableObservableCollection$1(CellRange.$type);
            var innerColl = this.i.addedRanges;
            if (!innerColl) {
                innerColl = new GridSelectedCellRangesCollection_internal();
            }
            syncColl._inner = innerColl;
            syncColl.clear();
            this._addedRanges._setSyncTarget(syncColl);
            this.i.addedRanges = innerColl;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridSelectedCellRangesChangedEventArgs.prototype, "removedRanges", {
        /**
         * The cell ranges removed from the selection.
        */
        get: function () {
            if (this._removedRanges === null) {
                var coll = new IgcGridSelectedCellRangesCollection();
                var innerColl = this.i.removedRanges;
                if (!innerColl) {
                    innerColl = new GridSelectedCellRangesCollection_internal();
                }
                this._removedRanges = coll._fromInner(innerColl);
                this.i.removedRanges = innerColl;
            }
            return this._removedRanges;
        },
        set: function (v) {
            if (this._removedRanges !== null) {
                this._removedRanges._setSyncTarget(null);
                this._removedRanges = null;
            }
            var coll = new IgcGridSelectedCellRangesCollection();
            this._removedRanges = coll._fromOuter(v);
            var syncColl = new SyncableObservableCollection$1(CellRange.$type);
            var innerColl = this.i.removedRanges;
            if (!innerColl) {
                innerColl = new GridSelectedCellRangesCollection_internal();
            }
            syncColl._inner = innerColl;
            syncColl.clear();
            this._removedRanges._setSyncTarget(syncColl);
            this.i.removedRanges = innerColl;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridSelectedCellRangesChangedEventArgs.prototype, "updatedRanges", {
        /**
         * The cell ranges that have been updated by the grid.
        */
        get: function () {
            if (this._updatedRanges === null) {
                var coll = new IgcGridSelectedCellRangesCollection();
                var innerColl = this.i.updatedRanges;
                if (!innerColl) {
                    innerColl = new GridSelectedCellRangesCollection_internal();
                }
                this._updatedRanges = coll._fromInner(innerColl);
                this.i.updatedRanges = innerColl;
            }
            return this._updatedRanges;
        },
        set: function (v) {
            if (this._updatedRanges !== null) {
                this._updatedRanges._setSyncTarget(null);
                this._updatedRanges = null;
            }
            var coll = new IgcGridSelectedCellRangesCollection();
            this._updatedRanges = coll._fromOuter(v);
            var syncColl = new SyncableObservableCollection$1(CellRange.$type);
            var innerColl = this.i.updatedRanges;
            if (!innerColl) {
                innerColl = new GridSelectedCellRangesCollection_internal();
            }
            syncColl._inner = innerColl;
            syncColl.clear();
            this._updatedRanges._setSyncTarget(syncColl);
            this.i.updatedRanges = innerColl;
        },
        enumerable: true,
        configurable: true
    });
    return IgcGridSelectedCellRangesChangedEventArgs;
}());
export { IgcGridSelectedCellRangesChangedEventArgs };
//# sourceMappingURL=igc-grid-selected-cell-ranges-changed-event-args.js.map
