/**
 * @fileoverview added by tsickle
 * Generated from: lib/layout/rs-aside/index.component.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
// 组件类
import { Component, EventEmitter, Input, Output } from "@angular/core";
import { Router, NavigationEnd } from "@angular/router";
import { filter } from "rxjs/operators";
import { CommonFunctionService } from "../../service/common-function.service";
var RSAsideComponent = /** @class */ (function () {
    function RSAsideComponent(router, cf) {
        this.router = router;
        this.cf = cf;
        this.toggleMenu = new EventEmitter();
        this.navClick = new EventEmitter();
        this.isCollapsed = false; // 接收输入属性
        // 接收输入属性
        this.customNavClick = false; // 接收输入属性
        // 接收输入属性
        this.navList = [];
        this.relationStart = [];
        this.currentNav = "";
    }
    /**
     * @return {?}
     */
    RSAsideComponent.prototype.ngOnInit = /**
     * @return {?}
     */
    function () {
        var _this = this;
        this.initCurrentNav();
        // 监听路由变化
        this.router.events
            .pipe(filter((/**
         * @param {?} event
         * @return {?}
         */
        function (event) { return event instanceof NavigationEnd; })))
            .subscribe((/**
         * @return {?}
         */
        function () {
            // console.log('this.router.url', this.router.url)
            /** @type {?} */
            var idx = _this.relationStart.findIndex((/**
             * @param {?} item
             * @return {?}
             */
            function (item) {
                return _this.router.url.startsWith(item.url);
            }));
            if (idx !== -1) {
                _this.currentNav = _this.relationStart[idx].target;
            }
            else {
                _this.currentNav = _this.router.url;
            }
        }));
    };
    /**
     * @return {?}
     */
    RSAsideComponent.prototype.initCurrentNav = /**
     * @return {?}
     */
    function () {
        var _this = this;
        /** @type {?} */
        var idx = this.relationStart.findIndex((/**
         * @param {?} item
         * @return {?}
         */
        function (item) {
            return _this.router.url.startsWith(item.url);
        }));
        if (idx !== -1) {
            this.currentNav = this.relationStart[idx].target;
        }
        else {
            this.currentNav = this.router.url;
        }
    };
    /**
     * @param {?} item
     * @return {?}
     */
    RSAsideComponent.prototype.onNavClick = /**
     * @param {?} item
     * @return {?}
     */
    function (item) {
        if (!this.customNavClick) {
            this.currentNav = item.url;
            this.router.navigate([item.url], { state: { title: item.label } });
            /** @type {?} */
            var screenWidth = window.innerWidth;
            if (screenWidth <= 992 && this.isCollapsed) {
                this.toggleMenu.emit(false);
            }
        }
        this.navClick.emit(item);
    };
    RSAsideComponent.decorators = [
        { type: Component, args: [{
                    selector: "rs-aside",
                    template: "<div class=\"rs-aside\" [ngClass]=\"{ isCollapsed: isCollapsed }\">\r\n  <div class=\"nav-list\">\r\n    <div\r\n      class=\"nav-group\"\r\n      [ngClass]=\"group.class\"\r\n      *ngFor=\"let group of navList\"\r\n    >\r\n      <div\r\n        class=\"nav-item\"\r\n        [ngClass]=\"{ isCurrent: currentNav === nav.url }\"\r\n        *ngFor=\"let nav of group.navItems\"\r\n        (click)=\"onNavClick(nav)\"\r\n      >\r\n        <div class=\"nav-item-inner\" *ngIf=\"nav.menuType === 'MENU'\">\r\n          <ejs-tooltip\r\n            [showTipPointer]=\"false\"\r\n            *ngIf=\"isCollapsed; else originIcon\"\r\n            position='RightCenter'\r\n          >\r\n            <ng-template #content>\r\n              <div class=\"tooltip-content\">\r\n                {{ nav.label }}\r\n              </div>\r\n            </ng-template>\r\n            <mat-icon class=\"menu-icon\" [svgIcon]=\"nav.iconCode\"></mat-icon>\r\n          </ejs-tooltip>\r\n          <ng-template #originIcon>\r\n            <mat-icon class=\"menu-icon\" [svgIcon]=\"nav.iconCode\"></mat-icon>\r\n          </ng-template>\r\n          <!-- <mat-icon class=\"menu-icon\" [svgIcon]=\"nav.iconCode\"></mat-icon> -->\r\n          <ejs-tooltip\r\n            [showTipPointer]=\"false\"\r\n            *ngIf=\"nav.displayLabel !== nav.label; else originText\"\r\n            position='RightCenter'\r\n            class=\"nav-tooltip-text\"\r\n          >\r\n            <ng-template #content>\r\n              <div class=\"tooltip-content\">\r\n                {{ nav.label }}\r\n              </div>\r\n            </ng-template>\r\n            <span class=\"nav-text\" [ngClass]=\"{ isCollapsed: isCollapsed }\">{{\r\n              nav.displayLabel\r\n            }}</span>\r\n          </ejs-tooltip>\r\n          <ng-template #originText>\r\n            <span class=\"nav-text\" [ngClass]=\"{ isCollapsed: isCollapsed }\">{{\r\n              nav.label\r\n            }}</span>\r\n          </ng-template>\r\n        </div>\r\n        <div class=\"dividing-line\" *ngIf=\"nav.menuType === 'LABEL'\"></div>\r\n      </div>\r\n    </div>\r\n  </div>\r\n  <div class=\"bottom-iconbox\" [ngClass]=\"{ isCollapsed: isCollapsed }\">\r\n    <ng-content select=\"[bottomIconBox]\"></ng-content>\r\n  </div>\r\n</div>\r\n",
                    styles: [".rs-aside{display:flex;flex-direction:column;height:100%;width:240px;will-change:width;transition:width .3s;padding-right:20px}.rs-aside.isCollapsed{width:64px;padding-right:0}.rs-aside.isCollapsed .nav-list .nav-item .nav-item-inner{margin-right:12px}.rs-aside.isCollapsed .nav-list .nav-item .dividing-line{margin:8px 20px 8px 10px}.rs-aside .nav-list{padding-top:12px;flex:1;overflow:auto;height:0}.rs-aside .nav-list .nav-item{cursor:pointer;padding-left:11px}.rs-aside .nav-list .nav-item .nav-item-inner{height:32px;display:flex;align-items:center;padding:8px 8px 8px 12px}.rs-aside .nav-list .nav-item .nav-item-inner ::ng-deep .menu-icon{width:33px;height:16px;display:flex;align-items:center}.rs-aside .nav-list .nav-item .nav-item-inner ::ng-deep .menu-icon svg{width:16px;height:16px}.rs-aside .nav-list .nav-item .dividing-line{margin:8px 0 8px 10px;height:1px;background-color:rgba(219,225,231,.5)}.rs-aside .nav-list .nav-item:hover .nav-item-inner{border-radius:6px;background:rgba(31,123,255,.04)}.rs-aside .nav-list .nav-item .nav-text{display:inline-block;color:#5f6f81;font-family:Arial;font-size:12px;font-weight:400;line-height:16px;transition:.3s;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;position:relative;top:1px;flex:1}@media (min-width:993px){.rs-aside .nav-list .nav-item .nav-text.isCollapsed{opacity:0;width:0}}.rs-aside .nav-list .nav-item .nav-tooltip-text{flex:1;width:0}.rs-aside .nav-list .nav-item.isCurrent{position:relative}.rs-aside .nav-list .nav-item.isCurrent .nav-text{color:#44566c;font-weight:700}.rs-aside .nav-list .nav-item.isCurrent::before{content:\"\";position:absolute;left:4px;top:8px;width:3px;height:16px;background-color:#1364b3;border-radius:2px}.rs-aside .bottom-iconbox{padding:12px 20px;height:48px;display:flex;gap:12px}.rs-aside .bottom-iconbox ::ng-deep .menu-bottom-icon{width:24px;height:24px;display:flex;justify-content:center;align-items:center;border:1px solid #eaedf0;border-radius:24px;cursor:pointer}.rs-aside .bottom-iconbox ::ng-deep .menu-bottom-icon svg{width:16px;height:16px;color:#6c7c90;stroke:#6c7c90}.rs-aside .bottom-iconbox ::ng-deep .menu-bottom-icon.disabled{cursor:default;opacity:.5}.rs-aside .bottom-iconbox ::ng-deep .menu-bottom-icon:not(.disabled):hover{background-color:#fff}.rs-aside .bottom-iconbox ::ng-deep .menu-bottom-icon:not(.disabled):hover svg{color:#1f7bff;stroke:#1f7bff}@media (min-width:993px){.rs-aside .bottom-iconbox.isCollapsed{flex-direction:column;height:auto}}@media (max-width:992px){.rs-aside{width:0;position:absolute;height:calc(100% - 50px);z-index:10;background-color:var(--rs-container-bg);padding-right:0}.rs-aside .bottom-iconbox{display:none}.rs-aside.isCollapsed{width:240px;padding-right:16px}.rs-aside.isCollapsed .bottom-iconbox{display:flex}}"]
                }] }
    ];
    /** @nocollapse */
    RSAsideComponent.ctorParameters = function () { return [
        { type: Router },
        { type: CommonFunctionService }
    ]; };
    RSAsideComponent.propDecorators = {
        toggleMenu: [{ type: Output }],
        navClick: [{ type: Output }],
        isCollapsed: [{ type: Input }],
        customNavClick: [{ type: Input }],
        navList: [{ type: Input }],
        relationStart: [{ type: Input }]
    };
    return RSAsideComponent;
}());
export { RSAsideComponent };
if (false) {
    /** @type {?} */
    RSAsideComponent.prototype.toggleMenu;
    /** @type {?} */
    RSAsideComponent.prototype.navClick;
    /** @type {?} */
    RSAsideComponent.prototype.isCollapsed;
    /** @type {?} */
    RSAsideComponent.prototype.customNavClick;
    /** @type {?} */
    RSAsideComponent.prototype.navList;
    /** @type {?} */
    RSAsideComponent.prototype.relationStart;
    /** @type {?} */
    RSAsideComponent.prototype.currentNav;
    /** @type {?} */
    RSAsideComponent.prototype.router;
    /** @type {?} */
    RSAsideComponent.prototype.cf;
}
//# sourceMappingURL=data:application/json;base64, 