import { CommonModule } from '@angular/common';
import { Input, ContentChildren, Component, ViewEncapsulation, NgModule } from '@angular/core';
import { coerceBooleanProperty } from '@angular/cdk/coercion';

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 NtMenuComponent = (function () {
    function NtMenuComponent() {
        this._simple = false;
        this._expanded = false;
        this._nested = false;
        this._align = '';
        this.class = '';
        this.orientation = '';
    }
    NtMenuComponent_1 = NtMenuComponent;
    Object.defineProperty(NtMenuComponent.prototype, "simple", {
        get: function () { return this._simple; },
        set: function (value) { this._simple = coerceBooleanProperty(value); },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(NtMenuComponent.prototype, "expanded", {
        get: function () { return this._expanded; },
        set: function (value) { this._expanded = coerceBooleanProperty(value); },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(NtMenuComponent.prototype, "nested", {
        get: function () { return this._nested; },
        set: function (value) { this._nested = coerceBooleanProperty(value); },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(NtMenuComponent.prototype, "align", {
        get: function () { return this._align; },
        set: function (value) { this._align = value; },
        enumerable: true,
        configurable: true
    });
    NtMenuComponent.prototype.ngAfterContentInit = function () {
        var _this = this;
        this.childMenus.toArray()
            .filter(function (menu) { return menu !== _this; })
            .forEach(function (menu) { return menu.nested = true; });
    };
    var NtMenuComponent_1;
    __decorate([
        Input()
    ], NtMenuComponent.prototype, "class", void 0);
    __decorate([
        Input()
    ], NtMenuComponent.prototype, "simple", null);
    __decorate([
        Input()
    ], NtMenuComponent.prototype, "expanded", null);
    __decorate([
        Input()
    ], NtMenuComponent.prototype, "align", null);
    __decorate([
        Input()
    ], NtMenuComponent.prototype, "orientation", void 0);
    __decorate([
        ContentChildren(NtMenuComponent_1)
    ], NtMenuComponent.prototype, "childMenus", void 0);
    NtMenuComponent = NtMenuComponent_1 = __decorate([
        Component({
            selector: 'ul[nt-menu], ol[nt-menu]',
            template: '<ng-content></ng-content>',
            encapsulation: ViewEncapsulation.None,
            host: {
                '[class]': '["menu", align ? "align-" + align : "", orientation, class].join(" ")',
                '[class.simple]': 'simple',
                '[class.expanded]': 'expanded',
                '[class.nested]': 'nested'
            }
        })
    ], NtMenuComponent);
    return NtMenuComponent;
}());

var __decorate$1 = (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 NtMenuModule = (function () {
    function NtMenuModule() {
    }
    NtMenuModule = __decorate$1([
        NgModule({
            imports: [CommonModule],
            exports: [NtMenuComponent],
            declarations: [NtMenuComponent]
        })
    ], NtMenuModule);
    return NtMenuModule;
}());

export { NtMenuComponent, NtMenuModule };
//# sourceMappingURL=menu.js.map
