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_1;
let NtMenuComponent = NtMenuComponent_1 = class NtMenuComponent {
    constructor() {
        this._simple = false;
        this._expanded = false;
        this._nested = false;
        this._align = '';
        this.class = '';
        this.orientation = '';
    }
    set simple(value) { this._simple = coerceBooleanProperty(value); }
    get simple() { return this._simple; }
    set expanded(value) { this._expanded = coerceBooleanProperty(value); }
    get expanded() { return this._expanded; }
    set nested(value) { this._nested = coerceBooleanProperty(value); }
    get nested() { return this._nested; }
    set align(value) { this._align = value; }
    get align() { return this._align; }
    ngAfterContentInit() {
        this.childMenus.toArray()
            .filter(menu => menu !== this)
            .forEach(menu => menu.nested = true);
    }
};
__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);

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

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