UNPKG

igniteui-angular-core

Version:

Ignite UI Angular Core logic used in multiple UI components.

59 lines (58 loc) 2.33 kB
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 { IgxFormatSpecifier as IgxFormatSpecifier } from './igx-format-specifier'; var IgxFormatSpecifierCollection = /** @class */ /*@__PURE__*/ (function (_super) { __extends(IgxFormatSpecifierCollection, _super); function IgxFormatSpecifierCollection(list) { var _this = _super.call(this) || this; if (!IgxFormatSpecifier.$type) { IgxFormatSpecifier.$type = markType(IgxFormatSpecifier, "IgxFormatSpecifier"); } if (list) { for (var i = 0; i < list.length; i++) { _this.add(list[i]); } } return _this; } IgxFormatSpecifierCollection.prototype._createInnerColl = function () { if (!IgxFormatSpecifier.$type) { IgxFormatSpecifier.$type = markType(IgxFormatSpecifier, "IgxFormatSpecifier"); } var coll = new SyncableObservableCollection$2(IgxFormatSpecifier.$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 IgxFormatSpecifier(); if (ext) { if (!int.$type && ext._implementation.setNativeElement) { ext._implementation.setNativeElement(int); } else { ext._implementation = int; } } } return ext; }; return coll; }; return IgxFormatSpecifierCollection; }(IgCollection)); export { IgxFormatSpecifierCollection };