igniteui-react-grids
Version:
Ignite UI React grid components.
59 lines (58 loc) • 2.29 kB
JavaScript
import { __extends } from "tslib";
import { IgCollection } from "igniteui-react-core";
import { markType } from "igniteui-react-core";
import { SyncableObservableCollection$2 } from "igniteui-react-core";
import { PrimaryKeyValue as PrimaryKeyValue_internal } from './PrimaryKeyValue';
import { IgrPrimaryKeyValue as IgrPrimaryKeyValue } from './igr-primary-key-value';
var IgrGridSelectedKeysCollection = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgrGridSelectedKeysCollection, _super);
function IgrGridSelectedKeysCollection(list) {
var _this = _super.call(this) || this;
if (!IgrPrimaryKeyValue.$type) {
IgrPrimaryKeyValue.$type = markType(IgrPrimaryKeyValue, "IgrPrimaryKeyValue");
}
if (list) {
for (var i = 0; i < list.length; i++) {
_this.add(list[i]);
}
}
return _this;
}
IgrGridSelectedKeysCollection.prototype._createInnerColl = function () {
if (!IgrPrimaryKeyValue.$type) {
IgrPrimaryKeyValue.$type = markType(IgrPrimaryKeyValue, "IgrPrimaryKeyValue");
}
var coll = new SyncableObservableCollection$2(IgrPrimaryKeyValue.$type, PrimaryKeyValue_internal.$type, 0);
coll.compare = function (ext, int) {
var comp = ext;
if (comp._implementation) {
comp = comp._implementation;
}
if (comp.equals) {
return comp.equals(int);
}
return comp === int;
};
coll.createTo = function (ext) {
return ext._implementation;
};
coll.createFrom = function (int) {
var ext = int.externalObject;
if (!ext) {
ext = new IgrPrimaryKeyValue();
if (ext) {
if (!int.$type && ext._implementation.setNativeElement) {
ext._implementation.setNativeElement(int);
}
else {
ext._implementation = int;
}
}
}
return ext;
};
return coll;
};
return IgrGridSelectedKeysCollection;
}(IgCollection));
export { IgrGridSelectedKeysCollection };