"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var core_1 = require("@angular/core");
var lodash_1 = require("lodash");
var typescript_angular_utilities_1 = require("typescript-angular-utilities");
var __object = typescript_angular_utilities_1.services.object;
var __transform = typescript_angular_utilities_1.services.transform;
var defaultMaxValue = 1000000;
var CommaListComponent = (function () {
    function CommaListComponent(object, transformService) {
        this.list = [];
        this.remainingItems = 0;
        this.object = object;
        this.transformService = transformService;
    }
    CommaListComponent.prototype.ngOnInit = function () {
        this.max = this.max || defaultMaxValue;
    };
    CommaListComponent.prototype.getFirstItems = function () {
        var _this = this;
        this.remainingItems = this.list.length - this.max;
        var top = lodash_1.take(this.list, this.max);
        return lodash_1.map(top, function (item) { return _this.transformService.getValue(item, _this.transform); });
    };
    return CommaListComponent;
}());
__decorate([
    core_1.Input(),
    __metadata("design:type", Array)
], CommaListComponent.prototype, "list", void 0);
__decorate([
    core_1.Input(),
    __metadata("design:type", Object)
], CommaListComponent.prototype, "transform", void 0);
__decorate([
    core_1.Input(),
    __metadata("design:type", Number)
], CommaListComponent.prototype, "max", void 0);
CommaListComponent = __decorate([
    core_1.Component({
        selector: 'rlCommaList',
        template: require('./commaList.html'),
    }),
    __metadata("design:paramtypes", [__object.ObjectUtility, __transform.TransformService])
], CommaListComponent);
exports.CommaListComponent = CommaListComponent;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjo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