import { IgcGridSelectedCellsCollection } from "./igc-grid-selected-cells-collection";
import { GridSelectedCellsChangedEventArgs as GridSelectedCellsChangedEventArgs_internal } from "./GridSelectedCellsChangedEventArgs";
import { GridSelectedCellsCollection as GridSelectedCellsCollection_internal } from "./GridSelectedCellsCollection";
import { CellKey } from "./CellKey";
import { SyncableObservableCollection$1 } from "igniteui-webcomponents-core";
/**
 * Information about the change to the selected cells in the grid.
*/
var IgcGridSelectedCellsChangedEventArgs = /** @class */ /*@__PURE__*/ (function () {
    function IgcGridSelectedCellsChangedEventArgs() {
        this._currentCells = null;
        this._addedCells = null;
        this._removedCells = null;
        this._implementation = this.createImplementation();
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    }
    IgcGridSelectedCellsChangedEventArgs.prototype.createImplementation = function () {
        return new GridSelectedCellsChangedEventArgs_internal();
    };
    Object.defineProperty(IgcGridSelectedCellsChangedEventArgs.prototype, "i", {
        /**
         * @hidden
         */
        get: function () {
            return this._implementation;
        },
        enumerable: true,
        configurable: true
    });
    IgcGridSelectedCellsChangedEventArgs.prototype.onImplementationCreated = function () {
    };
    IgcGridSelectedCellsChangedEventArgs.prototype._provideImplementation = function (i) {
        this._implementation = i;
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    };
    Object.defineProperty(IgcGridSelectedCellsChangedEventArgs.prototype, "currentCells", {
        /**
         * The current cells in the selection.
        */
        get: function () {
            if (this._currentCells === null) {
                var coll = new IgcGridSelectedCellsCollection();
                var innerColl = this.i.currentCells;
                if (!innerColl) {
                    innerColl = new GridSelectedCellsCollection_internal();
                }
                this._currentCells = coll._fromInner(innerColl);
                this.i.currentCells = innerColl;
            }
            return this._currentCells;
        },
        set: function (v) {
            if (this._currentCells !== null) {
                this._currentCells._setSyncTarget(null);
                this._currentCells = null;
            }
            var coll = new IgcGridSelectedCellsCollection();
            this._currentCells = coll._fromOuter(v);
            var syncColl = new SyncableObservableCollection$1(CellKey.$type);
            var innerColl = this.i.currentCells;
            if (!innerColl) {
                innerColl = new GridSelectedCellsCollection_internal();
            }
            syncColl._inner = innerColl;
            syncColl.clear();
            this._currentCells._setSyncTarget(syncColl);
            this.i.currentCells = innerColl;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridSelectedCellsChangedEventArgs.prototype, "addedCells", {
        /**
         * The cells added to the selection.
        */
        get: function () {
            if (this._addedCells === null) {
                var coll = new IgcGridSelectedCellsCollection();
                var innerColl = this.i.addedCells;
                if (!innerColl) {
                    innerColl = new GridSelectedCellsCollection_internal();
                }
                this._addedCells = coll._fromInner(innerColl);
                this.i.addedCells = innerColl;
            }
            return this._addedCells;
        },
        set: function (v) {
            if (this._addedCells !== null) {
                this._addedCells._setSyncTarget(null);
                this._addedCells = null;
            }
            var coll = new IgcGridSelectedCellsCollection();
            this._addedCells = coll._fromOuter(v);
            var syncColl = new SyncableObservableCollection$1(CellKey.$type);
            var innerColl = this.i.addedCells;
            if (!innerColl) {
                innerColl = new GridSelectedCellsCollection_internal();
            }
            syncColl._inner = innerColl;
            syncColl.clear();
            this._addedCells._setSyncTarget(syncColl);
            this.i.addedCells = innerColl;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridSelectedCellsChangedEventArgs.prototype, "removedCells", {
        /**
         * The cells removed from the selection.
        */
        get: function () {
            if (this._removedCells === null) {
                var coll = new IgcGridSelectedCellsCollection();
                var innerColl = this.i.removedCells;
                if (!innerColl) {
                    innerColl = new GridSelectedCellsCollection_internal();
                }
                this._removedCells = coll._fromInner(innerColl);
                this.i.removedCells = innerColl;
            }
            return this._removedCells;
        },
        set: function (v) {
            if (this._removedCells !== null) {
                this._removedCells._setSyncTarget(null);
                this._removedCells = null;
            }
            var coll = new IgcGridSelectedCellsCollection();
            this._removedCells = coll._fromOuter(v);
            var syncColl = new SyncableObservableCollection$1(CellKey.$type);
            var innerColl = this.i.removedCells;
            if (!innerColl) {
                innerColl = new GridSelectedCellsCollection_internal();
            }
            syncColl._inner = innerColl;
            syncColl.clear();
            this._removedCells._setSyncTarget(syncColl);
            this.i.removedCells = innerColl;
        },
        enumerable: true,
        configurable: true
    });
    return IgcGridSelectedCellsChangedEventArgs;
}());
export { IgcGridSelectedCellsChangedEventArgs };
//# sourceMappingURL=igc-grid-selected-cells-changed-event-args.js.map
