igniteui-react-core
Version:
Ignite UI React Core.
54 lines (53 loc) • 2.07 kB
JavaScript
import { IgCollection } from './IgCollection';
import { markType } from './type';
import { SyncableObservableCollection$2 } from './SyncableObservableCollection$2';
import { GridLayoutSizeDefinition as GridLayoutSizeDefinition_internal } from './GridLayoutSizeDefinition';
import { IgrGridLayoutSizeDefinition as IgrGridLayoutSizeDefinition } from './igr-grid-layout-size-definition';
export class IgrSizeDefinitionCollection extends IgCollection {
constructor(list) {
super();
if (!IgrGridLayoutSizeDefinition.$type) {
IgrGridLayoutSizeDefinition.$type = markType(IgrGridLayoutSizeDefinition, "IgrGridLayoutSizeDefinition");
}
if (list) {
for (let i = 0; i < list.length; i++) {
this.add(list[i]);
}
}
}
_createInnerColl() {
if (!IgrGridLayoutSizeDefinition.$type) {
IgrGridLayoutSizeDefinition.$type = markType(IgrGridLayoutSizeDefinition, "IgrGridLayoutSizeDefinition");
}
let coll = new SyncableObservableCollection$2(IgrGridLayoutSizeDefinition.$type, GridLayoutSizeDefinition_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 IgrGridLayoutSizeDefinition();
if (ext) {
if (!int.$type && ext._implementation.setNativeElement) {
ext._implementation.setNativeElement(int);
}
else {
ext._implementation = int;
}
}
}
return ext;
};
return coll;
}
}