UNPKG

igniteui-react-grids

Version:

Ignite UI React grid components.

141 lines (140 loc) 4.99 kB
import { IgrGridSelectedKeysCollection } from "./igr-grid-selected-keys-collection"; import { GridSelectedKeysChangedEventArgs as GridSelectedKeysChangedEventArgs_internal } from "./GridSelectedKeysChangedEventArgs"; import { GridSelectedKeysCollection as GridSelectedKeysCollection_internal } from "./GridSelectedKeysCollection"; import { PrimaryKeyValue } from "./PrimaryKeyValue"; import { SyncableObservableCollection$1 } from "igniteui-react-core"; /** * Information about the change to the selected keys in the grid. */ export class IgrGridSelectedKeysChangedEventArgs { createImplementation() { return new GridSelectedKeysChangedEventArgs_internal(); } get nativeElement() { return this._implementation.nativeElement; } /** * @hidden */ get i() { return this._implementation; } onImplementationCreated() { } constructor() { this.mounted = false; this._currentKeys = null; this._addedKeys = null; this._removedKeys = 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(); } } /** * All keys in the selection. */ get currentKeys() { if (this._currentKeys === null) { let coll = new IgrGridSelectedKeysCollection(); let innerColl = this.i.currentKeys; if (!innerColl) { innerColl = new GridSelectedKeysCollection_internal(); } this._currentKeys = coll._fromInner(innerColl); this.i.currentKeys = innerColl; } return this._currentKeys; } set currentKeys(v) { if (this._currentKeys !== null) { this._currentKeys._setSyncTarget(null); this._currentKeys = null; } let coll = new IgrGridSelectedKeysCollection(); this._currentKeys = coll._fromOuter(v); let syncColl = new SyncableObservableCollection$1(PrimaryKeyValue.$type); let innerColl = this.i.currentKeys; if (!innerColl) { innerColl = new GridSelectedKeysCollection_internal(); } syncColl._inner = innerColl; syncColl.clear(); this._currentKeys._setSyncTarget(syncColl); this.i.currentKeys = innerColl; } /** * The keys added to the selection. */ get addedKeys() { if (this._addedKeys === null) { let coll = new IgrGridSelectedKeysCollection(); let innerColl = this.i.addedKeys; if (!innerColl) { innerColl = new GridSelectedKeysCollection_internal(); } this._addedKeys = coll._fromInner(innerColl); this.i.addedKeys = innerColl; } return this._addedKeys; } set addedKeys(v) { if (this._addedKeys !== null) { this._addedKeys._setSyncTarget(null); this._addedKeys = null; } let coll = new IgrGridSelectedKeysCollection(); this._addedKeys = coll._fromOuter(v); let syncColl = new SyncableObservableCollection$1(PrimaryKeyValue.$type); let innerColl = this.i.addedKeys; if (!innerColl) { innerColl = new GridSelectedKeysCollection_internal(); } syncColl._inner = innerColl; syncColl.clear(); this._addedKeys._setSyncTarget(syncColl); this.i.addedKeys = innerColl; } /** * The keys removed from the selection. */ get removedKeys() { if (this._removedKeys === null) { let coll = new IgrGridSelectedKeysCollection(); let innerColl = this.i.removedKeys; if (!innerColl) { innerColl = new GridSelectedKeysCollection_internal(); } this._removedKeys = coll._fromInner(innerColl); this.i.removedKeys = innerColl; } return this._removedKeys; } set removedKeys(v) { if (this._removedKeys !== null) { this._removedKeys._setSyncTarget(null); this._removedKeys = null; } let coll = new IgrGridSelectedKeysCollection(); this._removedKeys = coll._fromOuter(v); let syncColl = new SyncableObservableCollection$1(PrimaryKeyValue.$type); let innerColl = this.i.removedKeys; if (!innerColl) { innerColl = new GridSelectedKeysCollection_internal(); } syncColl._inner = innerColl; syncColl.clear(); this._removedKeys._setSyncTarget(syncColl); this.i.removedKeys = innerColl; } }