import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChild, ContentChildren, forwardRef, Inject, Input, ViewEncapsulation, QueryList, ElementRef, NgZone, } from '@angular/core';
import { RDrawer, RDrawerContainer, RDrawerContent, R_DRAWER_CONTAINER } from './drawer';
import { rDrawerAnimations } from './drawer-animations';
import { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';
import { ScrollDispatcher } from '@angular/cdk/scrolling';
export class RSidenavContent extends RDrawerContent {
    constructor(changeDetectorRef, container, elementRef, scrollDispatcher, ngZone) {
        super(changeDetectorRef, container, elementRef, scrollDispatcher, ngZone);
    }
}
RSidenavContent.decorators = [
    { type: Component, args: [{
                selector: 'r-sidenav-content',
                template: '<ng-content></ng-content>',
                host: {
                    'class': 'r-drawer-content r-sidenav-content',
                    '[style.margin-left.px]': '_container._contentMargins.left',
                    '[style.margin-right.px]': '_container._contentMargins.right',
                },
                changeDetection: ChangeDetectionStrategy.OnPush,
                encapsulation: ViewEncapsulation.None
            },] }
];
RSidenavContent.ctorParameters = () => [
    { type: ChangeDetectorRef },
    { type: RSidenavContainer, decorators: [{ type: Inject, args: [forwardRef(() => RSidenavContainer),] }] },
    { type: ElementRef },
    { type: ScrollDispatcher },
    { type: NgZone }
];
export class RSidenav extends RDrawer {
    constructor() {
        super(...arguments);
        this._fixedInViewport = false;
        this._fixedTopGap = 0;
        this._fixedBottomGap = 0;
    }
    /** Whether the sidenav is fixed in the viewport. */
    get fixedInViewport() { return this._fixedInViewport; }
    set fixedInViewport(value) { this._fixedInViewport = coerceBooleanProperty(value); }
    /**
     * The gap between the top of the sidenav and the top of the viewport when the sidenav is in fixed
     * mode.
     */
    get fixedTopGap() { return this._fixedTopGap; }
    set fixedTopGap(value) { this._fixedTopGap = coerceNumberProperty(value); }
    /**
     * The gap between the bottom of the sidenav and the bottom of the viewport when the sidenav is in
     * fixed mode.
     */
    get fixedBottomGap() { return this._fixedBottomGap; }
    set fixedBottomGap(value) { this._fixedBottomGap = coerceNumberProperty(value); }
}
RSidenav.decorators = [
    { type: Component, args: [{
                selector: 'r-sidenav',
                exportAs: 'rSidenav',
                template: "<div class=\"r-drawer-inner-container\">\r\n  <ng-content></ng-content>\r\n</div>\r\n",
                animations: [rDrawerAnimations.transformDrawer],
                host: {
                    'class': 'r-drawer r-sidenav',
                    'tabIndex': '-1',
                    // must prevent the browser from aligning text based on value
                    '[attr.align]': 'null',
                    '[class.r-drawer-end]': 'position === "end"',
                    '[class.r-drawer-over]': 'mode === "over"',
                    '[class.r-drawer-push]': 'mode === "push"',
                    '[class.r-drawer-side]': 'mode === "side"',
                    '[class.r-drawer-opened]': 'opened',
                    '[class.r-sidenav-fixed]': 'fixedInViewport',
                    '[style.top.px]': 'fixedInViewport ? fixedTopGap : null',
                    '[style.bottom.px]': 'fixedInViewport ? fixedBottomGap : null',
                },
                changeDetection: ChangeDetectionStrategy.OnPush,
                encapsulation: ViewEncapsulation.None
            },] }
];
RSidenav.propDecorators = {
    fixedInViewport: [{ type: Input }],
    fixedTopGap: [{ type: Input }],
    fixedBottomGap: [{ type: Input }]
};
export class RSidenavContainer extends RDrawerContainer {
}
RSidenavContainer.decorators = [
    { type: Component, args: [{
                selector: 'r-sidenav-container',
                exportAs: 'rSidenavContainer',
                template: "<div class=\"r-drawer-backdrop\" (click)=\"_onBackdropClicked()\" *ngIf=\"hasBackdrop\"\r\n     [class.r-drawer-shown]=\"_isShowingBackdrop()\"></div>\r\n\r\n<ng-content select=\"r-sidenav\"></ng-content>\r\n\r\n<ng-content select=\"r-sidenav-content\">\r\n</ng-content>\r\n<r-sidenav-content *ngIf=\"!_content\" cdkScrollable>\r\n  <ng-content></ng-content>\r\n</r-sidenav-content>\r\n",
                host: {
                    'class': 'r-drawer-container r-sidenav-container',
                    '[class.r-drawer-container-explicit-backdrop]': '_backdropOverride',
                },
                changeDetection: ChangeDetectionStrategy.OnPush,
                encapsulation: ViewEncapsulation.None,
                providers: [{
                        provide: R_DRAWER_CONTAINER,
                        useExisting: RSidenavContainer
                    }],
                styles: [".r-drawer-container{position:relative;z-index:1;box-sizing:border-box;-webkit-overflow-scrolling:touch;display:block;overflow:hidden}.r-drawer-container[fullscreen].r-drawer-container-has-open{overflow:hidden}.r-drawer-container.r-drawer-container-explicit-backdrop .r-drawer-side{z-index:3}.ng-animate-disabled .r-drawer-container .r-drawer-backdrop,.ng-animate-disabled .r-drawer-container .r-drawer-content,.r-drawer-container.ng-animate-disabled .r-drawer-backdrop,.r-drawer-container.ng-animate-disabled .r-drawer-content{transition:none}.r-drawer-backdrop{top:0;left:0;right:0;bottom:0;position:absolute;display:block;z-index:3;visibility:hidden}.r-drawer-backdrop.r-drawer-shown{visibility:visible}.r-drawer-transition .r-drawer-backdrop{transition-duration:.4s;transition-timing-function:cubic-bezier(.55,0,.55,.2);transition-property:background-color,visibility}.r-drawer-content{position:relative;z-index:1;display:block;height:100%;overflow:auto}.r-drawer-transition .r-drawer-content{transition-duration:.4s;transition-timing-function:cubic-bezier(.25,.8,.25,1);transition-property:transform,margin-left,margin-right}.r-drawer{position:relative;z-index:4;display:block;position:absolute;top:0;bottom:0;z-index:3;outline:0;box-sizing:border-box;overflow-y:auto;transform:translate3d(-100%,0,0)}.r-drawer.r-drawer-side{z-index:2}.r-drawer.r-drawer-end{right:0}.r-drawer.r-drawer-end,[dir=rtl] .r-drawer{transform:translate3d(100%,0,0)}[dir=rtl] .r-drawer.r-drawer-end{left:0;right:auto;transform:translate3d(-100%,0,0)}.r-drawer-inner-container{width:100%;height:100%;overflow:auto;-webkit-overflow-scrolling:touch}.r-sidenav-fixed{position:fixed}"]
            },] }
];
RSidenavContainer.propDecorators = {
    _allDrawers: [{ type: ContentChildren, args: [RSidenav, {
                    // We need to use `descendants: true`, because Ivy will no longer match
                    // indirect descendants if it's left as false.
                    descendants: true
                },] }],
    _content: [{ type: ContentChild, args: [RSidenavContent,] }]
};
//# sourceMappingURL=sidenav.js.map