"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 __transform = typescript_angular_utilities_1.services.transform;
var popoutItem_1 = require("./popoutItem");
var popoutList_service_1 = require("./popoutList.service");
var PopoutListComponent = (function () {
    function PopoutListComponent(transformService, popoutListService) {
        var _this = this;
        this.select = new core_1.EventEmitter();
        this.transformService = transformService;
        this.popoutListService = popoutListService;
        popoutListService.select.subscribe(function (value) { return _this.select.emit(value); });
    }
    Object.defineProperty(PopoutListComponent.prototype, "disabled", {
        set: function (value) {
            this.popoutListService.disabled = value;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(PopoutListComponent.prototype, "customItems", {
        set: function (value) {
            this.popoutListService.customItems = value;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(PopoutListComponent.prototype, "listItems", {
        set: function (value) {
            this.popoutListService.listItems = value;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(PopoutListComponent.prototype, "isEmpty", {
        get: function () {
            return !((this.options && this.options.length)
                || this.popoutListService.customItems && this.popoutListService.customItems.length);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(PopoutListComponent.prototype, "showOptions", {
        get: function () {
            return this.popoutListService.showOptions;
        },
        enumerable: true,
        configurable: true
    });
    PopoutListComponent.prototype.open = function () {
        this.popoutListService.open();
    };
    PopoutListComponent.prototype.close = function () {
        this.popoutListService.close();
    };
    PopoutListComponent.prototype.newTemplate = function () {
        return lodash_1.clone(this.template);
    };
    PopoutListComponent.prototype.getDisplayName = function (item) {
        return this.transformService.getValue(item, this.transform);
    };
    return PopoutListComponent;
}());
__decorate([
    core_1.Input(),
    __metadata("design:type", Array)
], PopoutListComponent.prototype, "options", void 0);
__decorate([
    core_1.Input(),
    __metadata("design:type", core_1.TemplateRef)
], PopoutListComponent.prototype, "template", void 0);
__decorate([
    core_1.Input(),
    __metadata("design:type", Object)
], PopoutListComponent.prototype, "transform", void 0);
__decorate([
    core_1.Output(),
    __metadata("design:type", core_1.EventEmitter)
], PopoutListComponent.prototype, "select", void 0);
__decorate([
    core_1.Input(),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], PopoutListComponent.prototype, "disabled", null);
__decorate([
    core_1.ContentChildren(popoutItem_1.PopoutItemComponent),
    __metadata("design:type", core_1.QueryList),
    __metadata("design:paramtypes", [core_1.QueryList])
], PopoutListComponent.prototype, "customItems", null);
__decorate([
    core_1.ViewChildren(popoutItem_1.PopoutItemComponent),
    __metadata("design:type", core_1.QueryList),
    __metadata("design:paramtypes", [core_1.QueryList])
], PopoutListComponent.prototype, "listItems", null);
PopoutListComponent = __decorate([
    core_1.Component({
        selector: 'rlPopoutList',
        template: require('./popoutList.html'),
    }),
    __metadata("design:paramtypes", [__transform.TransformService, popoutList_service_1.PopoutListService])
], PopoutListComponent);
exports.PopoutListComponent = PopoutListComponent;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicG9wb3V0TGlzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInBvcG91dExpc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztBQUFBLHNDQUE4SDtBQUU5SCxpQ0FBK0I7QUFFL0IsNkVBQXdEO0FBQ3hELElBQU8sV0FBVy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