igniteui-webcomponents-grids
Version:
Ignite UI Web Components grid components.
155 lines (154 loc) • 6.29 kB
JavaScript
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();
if (this._initializeAdapters) {
this._initializeAdapters();
}
}
IgcGridSelectedCellsChangedEventArgs.prototype.createImplementation = function () {
return new GridSelectedCellsChangedEventArgs_internal();
};
Object.defineProperty(IgcGridSelectedCellsChangedEventArgs.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
IgcGridSelectedCellsChangedEventArgs.prototype.onImplementationCreated = function () {
};
IgcGridSelectedCellsChangedEventArgs.prototype._provideImplementation = function (i) {
this._implementation = i;
this._implementation.externalObject = this;
this.onImplementationCreated();
if (this._initializeAdapters) {
this._initializeAdapters();
}
};
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: false,
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: false,
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: false,
configurable: true
});
return IgcGridSelectedCellsChangedEventArgs;
}());
export { IgcGridSelectedCellsChangedEventArgs };