UNPKG

igniteui-react-grids

Version:

Ignite UI React grid components.

141 lines (140 loc) 5.03 kB
import { IgrGridSelectedCellsCollection } from "./igr-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-react-core"; /** * Information about the change to the selected cells in the grid. */ export class IgrGridSelectedCellsChangedEventArgs { createImplementation() { return new GridSelectedCellsChangedEventArgs_internal(); } get nativeElement() { return this._implementation.nativeElement; } /** * @hidden */ get i() { return this._implementation; } onImplementationCreated() { } constructor() { this.mounted = false; this._currentCells = null; this._addedCells = null; this._removedCells = null; this._implementation = this.createImplementation(); this._implementation.externalObject = this; this.onImplementationCreated(); if (this._initializeAdapters) { this._initializeAdapters(); } } _provideImplementation(i) { this._implementation = i; this._implementation.externalObject = this; this.onImplementationCreated(); if (this._initializeAdapters) { this._initializeAdapters(); } } /** * The current cells in the selection. */ get currentCells() { if (this._currentCells === null) { let coll = new IgrGridSelectedCellsCollection(); let innerColl = this.i.currentCells; if (!innerColl) { innerColl = new GridSelectedCellsCollection_internal(); } this._currentCells = coll._fromInner(innerColl); this.i.currentCells = innerColl; } return this._currentCells; } set currentCells(v) { if (this._currentCells !== null) { this._currentCells._setSyncTarget(null); this._currentCells = null; } let coll = new IgrGridSelectedCellsCollection(); this._currentCells = coll._fromOuter(v); let syncColl = new SyncableObservableCollection$1(CellKey.$type); let innerColl = this.i.currentCells; if (!innerColl) { innerColl = new GridSelectedCellsCollection_internal(); } syncColl._inner = innerColl; syncColl.clear(); this._currentCells._setSyncTarget(syncColl); this.i.currentCells = innerColl; } /** * The cells added to the selection. */ get addedCells() { if (this._addedCells === null) { let coll = new IgrGridSelectedCellsCollection(); let innerColl = this.i.addedCells; if (!innerColl) { innerColl = new GridSelectedCellsCollection_internal(); } this._addedCells = coll._fromInner(innerColl); this.i.addedCells = innerColl; } return this._addedCells; } set addedCells(v) { if (this._addedCells !== null) { this._addedCells._setSyncTarget(null); this._addedCells = null; } let coll = new IgrGridSelectedCellsCollection(); this._addedCells = coll._fromOuter(v); let syncColl = new SyncableObservableCollection$1(CellKey.$type); let innerColl = this.i.addedCells; if (!innerColl) { innerColl = new GridSelectedCellsCollection_internal(); } syncColl._inner = innerColl; syncColl.clear(); this._addedCells._setSyncTarget(syncColl); this.i.addedCells = innerColl; } /** * The cells removed from the selection. */ get removedCells() { if (this._removedCells === null) { let coll = new IgrGridSelectedCellsCollection(); let innerColl = this.i.removedCells; if (!innerColl) { innerColl = new GridSelectedCellsCollection_internal(); } this._removedCells = coll._fromInner(innerColl); this.i.removedCells = innerColl; } return this._removedCells; } set removedCells(v) { if (this._removedCells !== null) { this._removedCells._setSyncTarget(null); this._removedCells = null; } let coll = new IgrGridSelectedCellsCollection(); this._removedCells = coll._fromOuter(v); let syncColl = new SyncableObservableCollection$1(CellKey.$type); let innerColl = this.i.removedCells; if (!innerColl) { innerColl = new GridSelectedCellsCollection_internal(); } syncColl._inner = innerColl; syncColl.clear(); this._removedCells._setSyncTarget(syncColl); this.i.removedCells = innerColl; } }