igniteui-react-grids
Version:
Ignite UI React grid components.
161 lines (160 loc) • 5.63 kB
JavaScript
/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { ObservableCollection$1 } from "igniteui-react-core";
import { PrimaryKeyValue } from "./PrimaryKeyValue";
import { PropertyChangedEventArgs, delegateCombine, Delegate_$type, delegateRemove, Number_$type, fromEnum, markType } from "igniteui-react-core";
import { NotifyCollectionChangedEventArgs } from "igniteui-react-core";
import { List$1 } from "igniteui-react-core";
import { Dictionary$2 } from "igniteui-react-core";
/**
* @hidden
*/
export let GridSelectedKeysCollection = /*@__PURE__*/ (() => {
class GridSelectedKeysCollection extends ObservableCollection$1 {
constructor() {
super(PrimaryKeyValue.$, 0);
this.ak = new List$1(Delegate_$type, 0);
this.ah = false;
this.af = true;
this.ai = new Dictionary$2(PrimaryKeyValue.$, Number_$type, 0);
this.aj = new Dictionary$2(Number_$type, PrimaryKeyValue.$, 0);
}
get ae() {
return this;
}
an(a) {
this.collectionChanged = delegateCombine(this.collectionChanged, a);
}
am(a) {
this.ak.add(a);
}
ao(a) {
this.ak.remove(a);
}
ap(a) {
this.collectionChanged = delegateRemove(this.collectionChanged, a);
}
get ag() {
return this.af;
}
set ag(a) {
this.af = a;
}
n(a) {
super.n(a);
if (this.ag) {
this.ai.addItem(a, this.count - 1);
this.aj.addItem(this.count - 1, a);
}
}
o(a) {
let b = this.count;
super.o(a);
if (this.ag) {
for (let c of fromEnum(a)) {
this.ai.addItem(c, b);
this.aj.addItem(b, c);
b++;
}
}
}
p() {
let a = new List$1(Delegate_$type, 0);
for (let b of fromEnum(this.ak)) {
a.add(b);
}
for (let c of fromEnum(a)) {
c();
}
super.p();
if (this.ag) {
this.ai.clear();
this.aj.clear();
}
}
u(a) {
if (this.ag) {
if (this.aj.containsKey(a)) {
let b = this.aj.item(a);
this.ai.removeItem(b);
this.aj.removeItem(a);
for (let c = a + 1; c < this.count; c++) {
if (this.aj.containsKey(c)) {
let d = this.aj.item(c);
this.aj.removeItem(c);
this.aj.addItem(c - 1, d);
this.ai.item(d, c - 1);
}
}
}
}
let e = this._inner[a];
if (a == 0) {
this._inner.shift();
}
else {
this._inner.splice(a, 1);
}
this.ad(new PropertyChangedEventArgs("Count"));
this.ad(new PropertyChangedEventArgs("Item[]"));
if (!this.ah) {
this.ac(new NotifyCollectionChangedEventArgs(1, 1, e, a));
}
}
v(index_, numToRemove_) {
super.v(index_, numToRemove_);
if (this.ag) {
for (let a = index_; a < index_ + numToRemove_; a++) {
if (this.aj.containsKey(a)) {
let b = this.aj.item(a);
this.ai.removeItem(b);
this.aj.removeItem(a);
}
}
}
}
x(a, b) {
super.x(a, b);
if (this.ag) {
if (this.aj.containsKey(a)) {
let c = this.aj.item(a);
this.aj.item(a, b);
this.ai.removeItem(c);
this.ai.addItem(b, a);
}
}
}
r(a, b) {
super.r(a, b);
if (this.ag) {
for (let c = a; c < this.count; c++) {
let d = this._inner[c];
if (this.ai.containsKey(d)) {
this.ai.item(d, c);
this.aj.removeItem(c);
this.aj.addItem(c, d);
}
else {
this.ai.addItem(d, c);
this.aj.addItem(c, d);
}
}
}
}
al(a) {
if (this.ag) {
if (this.ai.containsKey(a)) {
return this.ai.item(a);
}
return -1;
}
return this.indexOf(a);
}
}
GridSelectedKeysCollection.$t = /*@__PURE__*/ markType(GridSelectedKeysCollection, 'GridSelectedKeysCollection', /*@__PURE__*/ ObservableCollection$1.$.specialize(PrimaryKeyValue.$));
return GridSelectedKeysCollection;
})();