import { __decorate, __extends } from "tslib";
import { mixinDisabled } from '@bravobit/bb-foundation';
import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core';
var BbDashboardMenuItemBase = /** @class */ (function () {
    function BbDashboardMenuItemBase() {
    }
    return BbDashboardMenuItemBase;
}());
var BbDashboardMenuItemMixinBase = mixinDisabled(BbDashboardMenuItemBase);
var BbDashboardMenuItem = /** @class */ (function (_super) {
    __extends(BbDashboardMenuItem, _super);
    function BbDashboardMenuItem() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    BbDashboardMenuItem.prototype.stopDisabledEvents = function (event) {
        // If the menu item is not disabled let all events pass.
        if (!this.disabled) {
            return;
        }
        // If the menu item is disabled stop the event from
        // bubbling up.
        event.preventDefault();
        event.stopImmediatePropagation();
    };
    BbDashboardMenuItem = __decorate([
        Component({
            selector: '[bb-dashboard-menu-item]',
            template: "<ng-content select=\"[bbPrefix]\"></ng-content>\n<span class=\"bb-dashboard-menu-item-content\">\n    <ng-content></ng-content>\n</span>\n<ng-content select=\"[bbSuffix]\"></ng-content>\n",
            changeDetection: ChangeDetectionStrategy.OnPush,
            encapsulation: ViewEncapsulation.None,
            preserveWhitespaces: false,
            inputs: ['disabled'],
            host: {
                'class': 'bb-dashboard-menu-item',
                '[class.disabled]': 'disabled',
                '(click)': 'stopDisabledEvents($event)'
            },
            styles: [".bb-dashboard-menu-item{margin:0;padding:0;border:none;display:-webkit-box;display:-ms-flexbox;display:flex;max-width:100%;font-size:16px;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-box-align:center;-ms-flex-align:center;align-items:center;white-space:nowrap;background-color:transparent;text-decoration:none!important;border-bottom:2px solid transparent}.bb-dashboard-menu-item,.bb-dashboard-menu-item:visited{color:#6b5c5c}.bb-dashboard-menu-item:not(:first-child){margin-left:10px}.bb-dashboard-menu-item:not(:last-child){margin-right:10px}.bb-dashboard-menu-item:hover:not(.disabled):not(.active){border-color:rgba(117,119,148,.2)}.bb-dashboard-menu-item.active,.bb-dashboard-menu-item.active:visited .bb-dashboard-menu-item.active:hover{color:#5b53ff;border-color:#5b53ff}.bb-dashboard-menu-item.disabled,.bb-dashboard-menu-item.disabled:active,.bb-dashboard-menu-item.disabled:focus,.bb-dashboard-menu-item.disabled:hover{opacity:.4;cursor:default;box-shadow:none}.bb-dashboard-menu-item>.bb-prefix{margin-right:5px}.bb-dashboard-menu-item>.bb-suffix{margin-left:5px}.bb-dashboard-menu-item-content{height:38px;display:block;font-weight:500;line-height:38px}"]
        })
    ], BbDashboardMenuItem);
    return BbDashboardMenuItem;
}(BbDashboardMenuItemMixinBase));
export { BbDashboardMenuItem };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGFzaGJvYXJkLW1lbnUtaXRlbS5jb21wb25lbnQuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9AYnJhdm9iaXQvYmItZm91bmRhdGlvbi9kYXNoYm9hcmQvIiwic291cmNlcyI6WyJsaWIvZGFzaGJvYXJkLW1lbnUtaXRlbS9kYXNoYm9hcmQtbWVudS1pdGVtLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsT0FBTyxFQUFvQyxhQUFhLEVBQUMsTUFBTSx5QkFBeUIsQ0FBQztBQUN6RixPQUFPLEVBQUMsdUJBQXVCLEVBQUUsU0FBUyxFQUFFLGlCQUFpQixFQUFDLE1BQU0sZUFBZSxDQUFDO0FBRXBGO0lBQUE7SUFDQSxDQUFDO0lBQUQsOEJBQUM7QUFBRCxDQUFDLEFBREQsSUFDQztBQUVELElBQU0sNEJBQTRCLEdBRTVCLGFBQWEsQ0FBQyx1QkFBdUIsQ0FBQyxDQUFDO0FBZ0I3QztJQUF5Qyx1Q0FBNEI7SUFBckU7O0lBY0EsQ0FBQztJQVpHLGdEQUFrQixHQUFsQixVQUFtQixLQUFZO1FBQzNCLHdEQUF3RDtRQUN4RCxJQUFJLENBQUMsSUFBSSxDQUFDLFF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