/**
 * @fileoverview added by tsickle
 * Generated from: lib/dashboard/dashboard.component.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import { ChangeDetectionStrategy, Component, Input, Renderer2, ViewEncapsulation } from '@angular/core';
import { Patch, Platform } from '@bravobit/bb-foundation';
import { BehaviorSubject } from 'rxjs';
var BbDashboard = /** @class */ (function () {
    function BbDashboard(_patch, _platform, _renderer) {
        this._patch = _patch;
        this._platform = _platform;
        this._renderer = _renderer;
        // Inputs.
        this.backgroundColor = '#e7eaed';
        this.maxWidth = '1200px';
        this.padding = '20px';
        // State.
        this.sidebarVisible$ = new BehaviorSubject(true);
    }
    Object.defineProperty(BbDashboard.prototype, "visibility", {
        get: /**
         * @return {?}
         */
        function () {
            return this.sidebarVisible$.asObservable();
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @return {?}
     */
    BbDashboard.prototype.ngOnInit = /**
     * @return {?}
     */
    function () {
        // Set the vertical height for mobile devices.
        this._patch.mobileVerticalHeight();
        // Set the HTML class to prevent scrolling.
        return this.setHtmlClass();
    };
    /**
     * @return {?}
     */
    BbDashboard.prototype.ngOnDestroy = /**
     * @return {?}
     */
    function () {
        // Remove the HTML class.
        this.setHtmlClass(true);
    };
    /**
     * @return {?}
     */
    BbDashboard.prototype.toggleSidebarVisibility = /**
     * @return {?}
     */
    function () {
        // Get the previous value.
        /** @type {?} */
        var previousValue = this.sidebarVisible$.getValue();
        // Invert the value and set the visibility.
        this.setSidebarVisibility(!previousValue);
    };
    /**
     * @param {?} newValue
     * @return {?}
     */
    BbDashboard.prototype.setSidebarVisibility = /**
     * @param {?} newValue
     * @return {?}
     */
    function (newValue) {
        this.sidebarVisible$.next(newValue);
    };
    /**
     * @private
     * @param {?=} shouldRemove
     * @return {?}
     */
    BbDashboard.prototype.setHtmlClass = /**
     * @private
     * @param {?=} shouldRemove
     * @return {?}
     */
    function (shouldRemove) {
        if (shouldRemove === void 0) { shouldRemove = false; }
        // Check if we are on a browser.
        if (!this._platform.isBrowser) {
            return;
        }
        // Define the class name.
        /** @type {?} */
        var className = 'bb-dashboard-html';
        // Add or remove the class.
        return shouldRemove
            ? this._renderer.removeClass(document.documentElement, className)
            : this._renderer.addClass(document.documentElement, className);
    };
    BbDashboard.decorators = [
        { type: Component, args: [{
                    selector: 'bb-dashboard',
                    template: "<!--\r\n    The outlet for where the sidebar\r\n    will be placed (if provided).\r\n-->\r\n<ng-content select=\"bb-dashboard-sidebar\">\r\n</ng-content>\r\n\r\n<!--\r\n    The section containing the header\r\n    and the main content.\r\n-->\r\n<section [style.background-color]=\"backgroundColor\"\r\n         class=\"bb-dashboard-section\">\r\n    <!--\r\n        The outlet for where the header\r\n        will be placed (if provided).\r\n    -->\r\n    <ng-content select=\"bb-dashboard-header\">\r\n    </ng-content>\r\n\r\n    <!--\r\n        The outlet of the content that\r\n        will be provided by the router.\r\n    -->\r\n    <main [style.padding]=\"padding\"\r\n          class=\"bb-dashboard-scroll\">\r\n        <div [style.max-width]=\"maxWidth\"\r\n             class=\"bb-dashboard-container\">\r\n            <ng-content select=\"bb-dashboard-menu\"></ng-content>\r\n\r\n            <ng-content></ng-content>\r\n        </div>\r\n    </main>\r\n</section>\r\n\r\n<!--\r\n    The backdrop that will be visible when\r\n    the sidebar is opened (only on mobile).\r\n-->\r\n<div [class.bb-dashboard-backdrop--visible]=\"!(visibility | async)\"\r\n     (click)=\"toggleSidebarVisibility()\"\r\n     class=\"bb-dashboard-backdrop\">\r\n</div>\r\n",
                    changeDetection: ChangeDetectionStrategy.OnPush,
                    encapsulation: ViewEncapsulation.None,
                    preserveWhitespaces: false,
                    host: {
                        'class': 'bb-dashboard'
                    },
                    styles: [".bb-dashboard{height:100vh;display:-ms-flexbox;display:flex;overflow:hidden;position:relative;height:calc(var(--vh,1vh) * 100)}.bb-dashboard-section{-ms-flex:1;flex:1;height:100vh;display:-ms-flexbox;display:flex;overflow-x:hidden;-ms-flex-direction:column;flex-direction:column;height:calc(var(--vh,1vh) * 100)}.bb-dashboard-scroll{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;overflow-x:hidden;overflow-y:scroll;-webkit-overflow-scrolling:touch}.bb-dashboard-container{width:100%;display:-ms-flexbox;display:flex;margin:0 auto;-ms-flex-direction:column;flex-direction:column}.bb-dashboard-backdrop{top:0;left:0;right:0;bottom:0;opacity:0;z-index:5;position:absolute;will-change:opacity;pointer-events:none;background-color:rgba(0,0,0,.5);transition:opacity .2s cubic-bezier(0,0,.2,1)}.bb-dashboard-backdrop--visible{opacity:1;cursor:pointer;pointer-events:all}@media only screen and (min-width:768px){.bb-dashboard-backdrop{display:none}}.bb-dashboard-html{height:100%;overflow:hidden}"]
                }] }
    ];
    /** @nocollapse */
    BbDashboard.ctorParameters = function () { return [
        { type: Patch },
        { type: Platform },
        { type: Renderer2 }
    ]; };
    BbDashboard.propDecorators = {
        backgroundColor: [{ type: Input }],
        maxWidth: [{ type: Input }],
        padding: [{ type: Input }]
    };
    return BbDashboard;
}());
export { BbDashboard };
if (false) {
    /** @type {?} */
    BbDashboard.prototype.backgroundColor;
    /** @type {?} */
    BbDashboard.prototype.maxWidth;
    /** @type {?} */
    BbDashboard.prototype.padding;
    /**
     * @type {?}
     * @private
     */
    BbDashboard.prototype.sidebarVisible$;
    /**
     * @type {?}
     * @private
     */
    BbDashboard.prototype._patch;
    /**
     * @type {?}
     * @private
     */
    BbDashboard.prototype._platform;
    /**
     * @type {?}
     * @private
     */
    BbDashboard.prototype._renderer;
}
//# sourceMappingURL=data:application/json;base64, 