igniteui-react-core
Version:
Ignite UI React Core.
59 lines (58 loc) • 2.27 kB
JavaScript
import { __extends } from "tslib";
import { IgCollection } from './IgCollection';
import { markType } from './type';
import { SyncableObservableCollection$2 } from './SyncableObservableCollection$2';
import { FormatSpecifier as FormatSpecifier_internal } from './FormatSpecifier';
import { IgrFormatSpecifier as IgrFormatSpecifier } from './igr-format-specifier';
var IgrFormatSpecifierCollection = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgrFormatSpecifierCollection, _super);
function IgrFormatSpecifierCollection(list) {
var _this = _super.call(this) || this;
if (!IgrFormatSpecifier.$type) {
IgrFormatSpecifier.$type = markType(IgrFormatSpecifier, "IgrFormatSpecifier");
}
if (list) {
for (var i = 0; i < list.length; i++) {
_this.add(list[i]);
}
}
return _this;
}
IgrFormatSpecifierCollection.prototype._createInnerColl = function () {
if (!IgrFormatSpecifier.$type) {
IgrFormatSpecifier.$type = markType(IgrFormatSpecifier, "IgrFormatSpecifier");
}
var coll = new SyncableObservableCollection$2(IgrFormatSpecifier.$type, FormatSpecifier_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 IgrFormatSpecifier();
if (ext) {
if (!int.$type && ext._implementation.setNativeElement) {
ext._implementation.setNativeElement(int);
}
else {
ext._implementation = int;
}
}
}
return ext;
};
return coll;
};
return IgrFormatSpecifierCollection;
}(IgCollection));
export { IgrFormatSpecifierCollection };