igniteui-react-core
Version:
Ignite UI React Core.
54 lines (53 loc) • 1.92 kB
JavaScript
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';
export class IgrFormatSpecifierCollection extends IgCollection {
constructor(list) {
super();
if (!IgrFormatSpecifier.$type) {
IgrFormatSpecifier.$type = markType(IgrFormatSpecifier, "IgrFormatSpecifier");
}
if (list) {
for (let i = 0; i < list.length; i++) {
this.add(list[i]);
}
}
}
_createInnerColl() {
if (!IgrFormatSpecifier.$type) {
IgrFormatSpecifier.$type = markType(IgrFormatSpecifier, "IgrFormatSpecifier");
}
let coll = new SyncableObservableCollection$2(IgrFormatSpecifier.$type, FormatSpecifier_internal.$type, 0);
coll.compare = (ext, int) => {
let comp = ext;
if (comp._implementation) {
comp = comp._implementation;
}
if (comp.equals) {
return comp.equals(int);
}
return comp === int;
};
coll.createTo = (ext) => {
return ext._implementation;
};
coll.createFrom = (int) => {
let 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;
}
}