UNPKG

igniteui-react-grids

Version:

Ignite UI React grid components.

174 lines (173 loc) 6.48 kB
import { IgrGridSelectedCellRangesCollection } from "./igr-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-react-core"; /** * Information about the change to the selected cell ranges in the grid. */ export class IgrGridSelectedCellRangesChangedEventArgs { createImplementation() { return new GridSelectedCellRangesChangedEventArgs_internal(); } get nativeElement() { return this._implementation.nativeElement; } /** * @hidden */ get i() { return this._implementation; } onImplementationCreated() { } constructor() { this.mounted = false; this._currentRanges = null; this._addedRanges = null; this._removedRanges = null; this._updatedRanges = 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 cell ranges currently in the selection. */ get currentRanges() { if (this._currentRanges === null) { let coll = new IgrGridSelectedCellRangesCollection(); 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 IgrGridSelectedCellRangesCollection(); 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 IgrGridSelectedCellRangesCollection(); 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 IgrGridSelectedCellRangesCollection(); 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 IgrGridSelectedCellRangesCollection(); 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 IgrGridSelectedCellRangesCollection(); 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 IgrGridSelectedCellRangesCollection(); 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 IgrGridSelectedCellRangesCollection(); 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; } }