UNPKG

angular-admin-lte-teliqo

Version:
1,441 lines (1,425 loc) 430 kB
import { Injectable, Component, Input, ChangeDetectorRef, NgModule, ChangeDetectionStrategy, ViewChild, ElementRef, ContentChild, NgZone, Renderer2, Directive, Output, EventEmitter, ViewChildren, InjectionToken, Optional, SkipSelf, ContentChildren, ViewContainerRef, HostListener } from '@angular/core'; import { NavigationEnd, PRIMARY_OUTLET, Router, RouterModule, NavigationStart } from '@angular/router'; import { BehaviorSubject, Subject } from 'rxjs'; import { CommonModule } from '@angular/common'; import { distinctUntilChanged, pluck } from 'rxjs/operators'; import { __spread } from 'tslib'; import { Title } from '@angular/platform-browser'; import { NgControl, FormsModule } from '@angular/forms'; /** * @fileoverview added by tsickle * @suppress {checkTypes} checked by tsc */ var RoutingService = /** @class */ (function () { /** * @method constructor * @param router [description] */ function RoutingService(router) { this.router = router; this.onChange = new BehaviorSubject(undefined); this.events = new BehaviorSubject(undefined); this.init(); } /** * [createUrl description] * \@method createUrl * @param {?} route [description] * @return {?} [description] */ RoutingService.createUrl = /** * [createUrl description] * \@method createUrl * @param {?} route [description] * @return {?} [description] */ function (route) { var /** @type {?} */ url = route.url.map(function (urlSegment) { return urlSegment.toString(); }).join('/'); return url; }; /** * [isChildrenSelfRoute description] * \@method isChildrenSelfRoute * @param {?} route [description] * @return {?} [description] */ RoutingService.isChildrenSelfRoute = /** * [isChildrenSelfRoute description] * \@method isChildrenSelfRoute * @param {?} route [description] * @return {?} [description] */ function (route) { route.routeConfig.children.forEach(function (child) { if (child.path === '' && (child.component || child.loadChildren)) { return true; } }); return false; }; /** * [createBreadcrumb description] * \@method createBreadcrumb * @param {?} route [description] * @param {?} url [description] * @return {?} [description] */ RoutingService.createBreadcrumb = /** * [createBreadcrumb description] * \@method createBreadcrumb * @param {?} route [description] * @param {?} url [description] * @return {?} [description] */ function (route, url) { var /** @type {?} */ isUrl = true; if (route.children.length !== 0 && route.firstChild.routeConfig.path) { if (url !== '/' && !route.routeConfig.loadChildren && !route.routeConfig.component && !RoutingService.isChildrenSelfRoute(route)) { isUrl = false; } } return { data: route.data, params: route.params, url: isUrl ? url : null }; }; /** * [init description] * \@method init * @return {?} */ RoutingService.prototype.init = /** * [init description] * \@method init * @return {?} */ function () { var _this = this; this.router.events.subscribe(function (routeEvent) { // https://github.com/angular/angular/issues/17473: event not fired anymore on load for routed component. // https://github.com/angular/angular/issues/17473: event not fired anymore on load for routed component. _this.events.next(routeEvent); if (routeEvent instanceof NavigationEnd) { var /** @type {?} */ route = _this.router.routerState.root.snapshot, /** @type {?} */ tmpUrl = '', /** @type {?} */ url = '', /** @type {?} */ rootRoot = true; var /** @type {?} */ paths = []; while (route.children.length) { route = route.firstChild; tmpUrl = "/" + RoutingService.createUrl(route); if (route.outlet !== PRIMARY_OUTLET || (!route.routeConfig.path && !rootRoot)) { continue; } rootRoot = false; if (route.params || route.data) { for (var /** @type {?} */ key in route.params) { if (!key) { continue; } if (route.data['title']) { route.data['title'] = route.data['title'].replace(":" + key, route.params[key]); route.data['title'] = route.data['title'].replace(":" + key, route.params[key]); } if (route.data['breadcrumbs']) { route.data['breadcrumbs'] = route.data['breadcrumbs'].replace(":" + key, route.params[key]); } if (route.data['description']) { route.data['description'] = route.data['description'].replace(":" + key, route.params[key]); } } } if (tmpUrl === '/') { paths.push(RoutingService.createBreadcrumb(route, tmpUrl)); } else { url += tmpUrl; paths.push(RoutingService.createBreadcrumb(route, url)); } } _this.onChange.next(paths); } }); }; RoutingService.decorators = [ { type: Injectable }, ]; /** @nocollapse */ RoutingService.ctorParameters = function () { return [ { type: Router, }, ]; }; return RoutingService; }()); /** * @fileoverview added by tsickle * @suppress {checkTypes} checked by tsc */ var BreadcrumbsComponent = /** @class */ (function () { /** * @method constructor * @param routingService [description] * @param changeDetectorRef [description] */ function BreadcrumbsComponent(routingService, changeDetectorRef) { this.routingService = routingService; this.changeDetectorRef = changeDetectorRef; this.homeIcon = 'fa fa-home'; } /** * @method ngOnInit */ /** * \@method ngOnInit * @return {?} */ BreadcrumbsComponent.prototype.ngOnInit = /** * \@method ngOnInit * @return {?} */ function () { var _this = this; this.subscription = this.routingService.onChange.subscribe(function (value) { _this.breadcrumbs = value; }); }; /** * @method ngOnDestroy */ /** * \@method ngOnDestroy * @return {?} */ BreadcrumbsComponent.prototype.ngOnDestroy = /** * \@method ngOnDestroy * @return {?} */ function () { this.subscription.unsubscribe(); }; BreadcrumbsComponent.decorators = [ { type: Component, args: [{ selector: 'mk-breadcrumbs', template: "<ol class=\"breadcrumb\">\n <li *ngFor=\"let breadcrumb of breadcrumbs; let first = first; let last = last\" [class.active]=\"last || !breadcrumb.url\">\n <a *ngIf=\"breadcrumb.url\" [routerLink]=\"breadcrumb.url\">\n <i *ngIf=\"first\" ngClass=\"{{homeIcon}}\"></i>\n <ng-template [ngIf]=\"breadcrumb.data.breadcrumbs\">{{breadcrumb.data.breadcrumbs}}</ng-template>\n <ng-template [ngIf]=\"!breadcrumb.data.breadcrumbs\">{{breadcrumb.data.title}}</ng-template>\n </a>\n <ng-template [ngIf]=\"!breadcrumb.url\">\n <i *ngIf=\"first\" ngClass=\"{{homeIcon}}\"></i>\n <ng-template [ngIf]=\"breadcrumb.data.breadcrumbs\">{{breadcrumb.data.breadcrumbs}}</ng-template>\n <ng-template [ngIf]=\"!breadcrumb.data.breadcrumbs\">{{breadcrumb.data.title}}</ng-template>\n </ng-template>\n </li>\n</ol>\n", styles: [".breadcrumb{float:right;background:0 0;margin-top:0;margin-bottom:0;font-size:12px;padding:7px 5px;position:absolute;top:15px;right:10px;border-radius:2px}.breadcrumb>li>a{color:#444;text-decoration:none;display:inline-block}.breadcrumb>li>a>.fa,.breadcrumb>li>a>.glyphicon,.breadcrumb>li>a>.ion{margin-right:5px}"] },] }, ]; /** @nocollapse */ BreadcrumbsComponent.ctorParameters = function () { return [ { type: RoutingService, }, { type: ChangeDetectorRef, }, ]; }; BreadcrumbsComponent.propDecorators = { "homeIcon": [{ type: Input },], }; return BreadcrumbsComponent; }()); /** * @fileoverview added by tsickle * @suppress {checkTypes} checked by tsc */ var BreadcrumbsModule = /** @class */ (function () { function BreadcrumbsModule() { } BreadcrumbsModule.decorators = [ { type: NgModule, args: [{ imports: [CommonModule, RouterModule], exports: [BreadcrumbsComponent], declarations: [BreadcrumbsComponent] },] }, ]; return BreadcrumbsModule; }()); /** * @fileoverview added by tsickle * @suppress {checkTypes} checked by tsc */ var LayoutStore = /** @class */ (function () { /** * @method constructor * @param layoutConfig [description] */ function LayoutStore(layoutConfig) { this.initialLayoutState = { isSidebarLeftCollapsed: false, isSidebarLeftExpandOnOver: false, isSidebarLeftMouseOver: false, isSidebarLeftMini: true, sidebarRightSkin: 'dark', isSidebarRightCollapsed: true, isSidebarRightOverContent: true, layout: 'normal', sidebarLeftMenu: [], sidebarLeftMenuActiveUrl: '', skin: 'blue' }; if (layoutConfig) { this.initialLayoutState = Object.assign(this.initialLayoutState, layoutConfig); } this._layoutState = new BehaviorSubject(this.initialLayoutState); this.layoutState = this._layoutState.asObservable(); } Object.defineProperty(LayoutStore.prototype, "windowInnerHeight", { /** * [windowInnerHeight description] * @method windowInnerHeight * @return [description] */ get: /** * [windowInnerHeight description] * \@method windowInnerHeight * @return {?} [description] */ function () { return /** @type {?} */ (this.layoutState.pipe(pluck('windowInnerHeight'), distinctUntilChanged())); }, enumerable: true, configurable: true }); Object.defineProperty(LayoutStore.prototype, "windowInnerWidth", { /** * [windowInnerWidth description] * @method windowInnerWidth * @return [description] */ get: /** * [windowInnerWidth description] * \@method windowInnerWidth * @return {?} [description] */ function () { return /** @type {?} */ (this.layoutState.pipe(pluck('windowInnerWidth'), distinctUntilChanged())); }, enumerable: true, configurable: true }); Object.defineProperty(LayoutStore.prototype, "isSidebarLeftCollapsed", { /** * [isSidebarLeftCollapsed description] * @return [description] */ get: /** * [isSidebarLeftCollapsed description] * @return {?} [description] */ function () { return /** @type {?} */ (this.layoutState.pipe(pluck('isSidebarLeftCollapsed'), distinctUntilChanged())); }, enumerable: true, configurable: true }); Object.defineProperty(LayoutStore.prototype, "isSidebarLeftExpandOnOver", { /** * [isSidebarLeftExpandOnOver description] * @method isSidebarLeftExpandOnOver * @return [description] */ get: /** * [isSidebarLeftExpandOnOver description] * \@method isSidebarLeftExpandOnOver * @return {?} [description] */ function () { return /** @type {?} */ (this.layoutState.pipe(pluck('isSidebarLeftExpandOnOver'), distinctUntilChanged())); }, enumerable: true, configurable: true }); Object.defineProperty(LayoutStore.prototype, "isSidebarLeftMouseOver", { /** * [isSidebarLeftMouseOver description] * @method isSidebarLeftMouseOver * @return [description] */ get: /** * [isSidebarLeftMouseOver description] * \@method isSidebarLeftMouseOver * @return {?} [description] */ function () { return /** @type {?} */ (this.layoutState.pipe(pluck('isSidebarLeftMouseOver'), distinctUntilChanged())); }, enumerable: true, configurable: true }); Object.defineProperty(LayoutStore.prototype, "isSidebarLeftMini", { /** * [isSidebarLeftMini description] * @method isSidebarLeftMini * @return [description] */ get: /** * [isSidebarLeftMini description] * \@method isSidebarLeftMini * @return {?} [description] */ function () { return /** @type {?} */ (this.layoutState.pipe(pluck('isSidebarLeftMini'), distinctUntilChanged())); }, enumerable: true, configurable: true }); Object.defineProperty(LayoutStore.prototype, "sidebarRightSkin", { /** * [sidebarRightSkin description] * @method sidebarRightSkin * @return [description] */ get: /** * [sidebarRightSkin description] * \@method sidebarRightSkin * @return {?} [description] */ function () { return /** @type {?} */ (this.layoutState.pipe(pluck('sidebarRightSkin'), distinctUntilChanged())); }, enumerable: true, configurable: true }); Object.defineProperty(LayoutStore.prototype, "isSidebarRightCollapsed", { /** * [isSidebarRightCollapsed description] * @return [description] */ get: /** * [isSidebarRightCollapsed description] * @return {?} [description] */ function () { return /** @type {?} */ (this.layoutState.pipe(pluck('isSidebarRightCollapsed'), distinctUntilChanged())); }, enumerable: true, configurable: true }); Object.defineProperty(LayoutStore.prototype, "isSidebarRightOverContent", { /** * [isSidebarRightOverContent description] * @method isSidebarRightOverContent * @return [description] */ get: /** * [isSidebarRightOverContent description] * \@method isSidebarRightOverContent * @return {?} [description] */ function () { return /** @type {?} */ (this.layoutState.pipe(pluck('isSidebarRightOverContent'), distinctUntilChanged())); }, enumerable: true, configurable: true }); Object.defineProperty(LayoutStore.prototype, "sidebarLeftMenu", { /** * [sidebarLeftMenu description] * @method sidebarLeftMenu * @return [description] */ get: /** * [sidebarLeftMenu description] * \@method sidebarLeftMenu * @return {?} [description] */ function () { return /** @type {?} */ (this.layoutState.pipe(pluck('sidebarLeftMenu'), distinctUntilChanged())); }, enumerable: true, configurable: true }); Object.defineProperty(LayoutStore.prototype, "sidebarLeftMenuActiveUrl", { /** * [sidebarLeftMenuActiveUrl description] * @method sidebarLeftMenuActiveUrl * @return [description] */ get: /** * [sidebarLeftMenuActiveUrl description] * \@method sidebarLeftMenuActiveUrl * @return {?} [description] */ function () { return /** @type {?} */ (this.layoutState.pipe(pluck('sidebarLeftMenuActiveUrl'), distinctUntilChanged())); }, enumerable: true, configurable: true }); Object.defineProperty(LayoutStore.prototype, "sidebarLeftElementHeight", { /** * [sidebarLeftElementHeight description] * @method sidebarLeftElementHeight * @return [description] */ get: /** * [sidebarLeftElementHeight description] * \@method sidebarLeftElementHeight * @return {?} [description] */ function () { return /** @type {?} */ (this.layoutState.pipe(pluck('sidebarLeftElementHeight'), distinctUntilChanged())); }, enumerable: true, configurable: true }); Object.defineProperty(LayoutStore.prototype, "layout", { /** * [layoutType description] * @method layoutType * @return [description] */ get: /** * [layoutType description] * \@method layoutType * @return {?} [description] */ function () { return /** @type {?} */ (this.layoutState.pipe(pluck('layout'), distinctUntilChanged())); }, enumerable: true, configurable: true }); Object.defineProperty(LayoutStore.prototype, "skin", { /** * [skin description] * @method skin * @return [description] */ get: /** * [skin description] * \@method skin * @return {?} [description] */ function () { return /** @type {?} */ (this.layoutState.pipe(pluck('skin'), distinctUntilChanged())); }, enumerable: true, configurable: true }); Object.defineProperty(LayoutStore.prototype, "wrapperClasses", { /** * [wrapperClasses description] * @method wrapperClasses * @return [description] */ get: /** * [wrapperClasses description] * \@method wrapperClasses * @return {?} [description] */ function () { return /** @type {?} */ (this.layoutState.pipe(pluck('wrapperClasses'), distinctUntilChanged())); }, enumerable: true, configurable: true }); /** * [sidebarLeftCollapsed description] * \@method sidebarLeftCollapsed * @param {?=} value [description] * @return {?} */ LayoutStore.prototype.sidebarLeftCollapsed = /** * [sidebarLeftCollapsed description] * \@method sidebarLeftCollapsed * @param {?=} value [description] * @return {?} */ function (value) { this._layoutState.next(Object.assign(this._layoutState.value, { isSidebarLeftCollapsed: value })); }; /** * [sidebarLeftExpandOnOver description] * \@method sidebarLeftExpandOnOver * @param {?=} value [description] * @return {?} */ LayoutStore.prototype.sidebarLeftExpandOnOver = /** * [sidebarLeftExpandOnOver description] * \@method sidebarLeftExpandOnOver * @param {?=} value [description] * @return {?} */ function (value) { this._layoutState.next(Object.assign(this._layoutState.value, { isSidebarLeftExpandOnOver: value })); }; /** * [setSidebarLeftElementHeight description] * \@method setSidebarLeftElementHeight * @param {?} value [description] * @return {?} */ LayoutStore.prototype.setSidebarLeftElementHeight = /** * [setSidebarLeftElementHeight description] * \@method setSidebarLeftElementHeight * @param {?} value [description] * @return {?} */ function (value) { this._layoutState.next(Object.assign(this._layoutState.value, { sidebarLeftElementHeight: value })); }; /** * [setSidebarRightSkin description] * \@method setSidebarRightSkin * @param {?=} value [description] * @return {?} */ LayoutStore.prototype.setSidebarRightSkin = /** * [setSidebarRightSkin description] * \@method setSidebarRightSkin * @param {?=} value [description] * @return {?} */ function (value) { this._layoutState.next(Object.assign(this._layoutState.value, { sidebarRightSkin: value })); }; /** * [sidebarLeftMouseOver description] * \@method sidebarLeftMouseOver * @param {?=} value [description] * @return {?} */ LayoutStore.prototype.sidebarLeftMouseOver = /** * [sidebarLeftMouseOver description] * \@method sidebarLeftMouseOver * @param {?=} value [description] * @return {?} */ function (value) { this._layoutState.next(Object.assign(this._layoutState.value, { isSidebarLeftMouseOver: value })); }; /** * [sidebarLeftMini description] * \@method sidebarLeftMini * @param {?=} value [description] * @return {?} */ LayoutStore.prototype.sidebarLeftMini = /** * [sidebarLeftMini description] * \@method sidebarLeftMini * @param {?=} value [description] * @return {?} */ function (value) { this._layoutState.next(Object.assign(this._layoutState.value, { isSidebarLeftMini: value })); }; /** * [sidebarRightCollapsed description] * \@method sidebarRightCollapsed * @param {?=} value [description] * @return {?} */ LayoutStore.prototype.sidebarRightCollapsed = /** * [sidebarRightCollapsed description] * \@method sidebarRightCollapsed * @param {?=} value [description] * @return {?} */ function (value) { this._layoutState.next(Object.assign(this._layoutState.value, { isSidebarRightCollapsed: value })); }; /** * [sidebarRightOverContent description] * \@method sidebarRightOverContent * @param {?=} value [description] * @return {?} */ LayoutStore.prototype.sidebarRightOverContent = /** * [sidebarRightOverContent description] * \@method sidebarRightOverContent * @param {?=} value [description] * @return {?} */ function (value) { this._layoutState.next(Object.assign(this._layoutState.value, { isSidebarRightOverContent: value })); }; /** * [setSidebarLeftMenu description] * \@method setSidebarLeftMenu * @param {?} value [description] * @return {?} */ LayoutStore.prototype.setSidebarLeftMenu = /** * [setSidebarLeftMenu description] * \@method setSidebarLeftMenu * @param {?} value [description] * @return {?} */ function (value) { this._layoutState.next(Object.assign(this._layoutState.value, { sidebarLeftMenu: value })); }; /** * [setSidebarLeftMenuActiveUrl description] * \@method setSidebarLeftMenuActiveUrl * @param {?} value [description] * @return {?} */ LayoutStore.prototype.setSidebarLeftMenuActiveUrl = /** * [setSidebarLeftMenuActiveUrl description] * \@method setSidebarLeftMenuActiveUrl * @param {?} value [description] * @return {?} */ function (value) { this._layoutState.next(Object.assign(this._layoutState.value, { sidebarLeftMenuActiveUrl: value })); }; /** * [setLayout description] * \@method setLayout * @param {?} value [description] * @return {?} */ LayoutStore.prototype.setLayout = /** * [setLayout description] * \@method setLayout * @param {?} value [description] * @return {?} */ function (value) { this._layoutState.next(Object.assign(this._layoutState.value, { layout: value })); }; /** * [setSkin description] * \@method setSkin * @param {?} value [description] * @return {?} */ LayoutStore.prototype.setSkin = /** * [setSkin description] * \@method setSkin * @param {?} value [description] * @return {?} */ function (value) { this._layoutState.next(Object.assign(this._layoutState.value, { skin: value })); }; /** * [setWrapperClasses description] * \@method setWrapperClasses * @param {?} value [description] * @return {?} */ LayoutStore.prototype.setWrapperClasses = /** * [setWrapperClasses description] * \@method setWrapperClasses * @param {?} value [description] * @return {?} */ function (value) { this._layoutState.next(Object.assign(this._layoutState.value, { wrapperClasses: value })); }; /** * [setWindowInnerHeight description] * \@method setWindowInnerHeight * @param {?} value [description] * @return {?} */ LayoutStore.prototype.setWindowInnerHeight = /** * [setWindowInnerHeight description] * \@method setWindowInnerHeight * @param {?} value [description] * @return {?} */ function (value) { this._layoutState.next(Object.assign(this._layoutState.value, { windowInnerHeight: value })); }; /** * [setWindowInnerWidth description] * \@method setWindowInnerWidth * @param {?} value [description] * @return {?} */ LayoutStore.prototype.setWindowInnerWidth = /** * [setWindowInnerWidth description] * \@method setWindowInnerWidth * @param {?} value [description] * @return {?} */ function (value) { this._layoutState.next(Object.assign(this._layoutState.value, { windowInnerWidth: value })); }; return LayoutStore; }()); /** * @fileoverview added by tsickle * @suppress {checkTypes} checked by tsc */ var SidebarRightService = /** @class */ (function () { function SidebarRightService() { } Object.defineProperty(SidebarRightService.prototype, "scrollHeight", { /** * [scrollHeight description] * @method scrollHeight * @return [description] */ get: /** * [scrollHeight description] * \@method scrollHeight * @return {?} [description] */ function () { return this.elementRef ? this.elementRef.nativeElement.scrollHeight : null; }, enumerable: true, configurable: true }); SidebarRightService.decorators = [ { type: Injectable }, ]; return SidebarRightService; }()); /** * @fileoverview added by tsickle * @suppress {checkTypes} checked by tsc */ var HeaderService = /** @class */ (function () { function HeaderService() { } Object.defineProperty(HeaderService.prototype, "offsetHeight", { get: /** * [offsetHeight description] * \@method offsetHeight * @return {?} [description] */ function () { return this.elementRef.nativeElement.offsetHeight; }, enumerable: true, configurable: true }); HeaderService.decorators = [ { type: Injectable }, ]; return HeaderService; }()); /** * @fileoverview added by tsickle * @suppress {checkTypes} checked by tsc */ var FooterService = /** @class */ (function () { function FooterService() { } Object.defineProperty(FooterService.prototype, "offsetHeight", { get: /** * [offsetHeight description] * \@method offsetHeight * @return {?} [description] */ function () { return this.elementRef.nativeElement.offsetHeight; }, enumerable: true, configurable: true }); FooterService.decorators = [ { type: Injectable }, ]; return FooterService; }()); /** * @fileoverview added by tsickle * @suppress {checkTypes} checked by tsc */ /** * [throttle description] * \@method throttle * @param {?} callback [description] * @param {?} delay [description] * @return {?} [description] */ function throttle(callback, delay) { var _this = this; var /** @type {?} */ timeout = null; return function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } if (!timeout) { timeout = setTimeout(function () { callback.call.apply(callback, __spread([_this], args)); timeout = null; }, delay); } }; } /** * [removeSubscriptions description] * \@method removeSubscriptions * @param {?} subscriptions * @return {?} */ function removeSubscriptions(subscriptions) { if (subscriptions) { subscriptions.forEach(function (subscription) { subscription.unsubscribe(); }); } return []; } /** * [removeListeners description] * \@method removeListeners * @param {?} listeners * @return {?} */ function removeListeners(listeners) { if (listeners) { listeners.forEach(function (listener) { listener(); }); } return []; } /** * @fileoverview added by tsickle * @suppress {checkTypes} checked by tsc */ var ContentComponent = /** @class */ (function () { /** * @method constructor * @param layoutStore * @param routingService * @param titleService * @param elementRef * @param changeDetectorRef * @param sidebarRightService * @param headerService * @param footerService * @param router */ function ContentComponent(layoutStore, routingService, titleService, elementRef, changeDetectorRef, sidebarRightService, headerService, footerService, router) { this.layoutStore = layoutStore; this.routingService = routingService; this.titleService = titleService; this.elementRef = elementRef; this.changeDetectorRef = changeDetectorRef; this.sidebarRightService = sidebarRightService; this.headerService = headerService; this.footerService = footerService; this.router = router; this.subscriptions = []; } /** * @method ngOnInit */ /** * \@method ngOnInit * @return {?} */ ContentComponent.prototype.ngOnInit = /** * \@method ngOnInit * @return {?} */ function () { var _this = this; this.titleTag = this.titleService.getTitle(); this.subscriptions.push(this.routingService.onChange.subscribe(function (value) { if (value && value[value.length - 1]) { _this.titleService.setTitle(_this.getTitle(value[value.length - 1].data['title'])); _this.header = value[value.length - 1].data['title']; _this.description = value[value.length - 1].data['description']; } _this.changeDetectorRef.markForCheck(); })); this.subscriptions.push(this.router.events.subscribe(function (routeEvent) { if (routeEvent instanceof NavigationStart) { _this.navigationEnd = false; } if (routeEvent instanceof NavigationEnd) { _this.navigationEnd = true; _this.setContentMinHeight(); } })); this.subscriptions.push(this.layoutStore.sidebarLeftElementHeight.subscribe(function (value) { _this.sidebarLeftHeight = value; _this.setContentMinHeight(); })); this.subscriptions.push(this.layoutStore.layout.subscribe(function (value) { _this.layout = value; _this.setContentMinHeight(); })); this.subscriptions.push(this.layoutStore.windowInnerHeight.subscribe(function (value) { _this.windowInnerHeight = value; _this.setContentMinHeight(); })); this.heightStyle = this.windowInnerHeight; }; /** * @method ngOnDestroy */ /** * \@method ngOnDestroy * @return {?} */ ContentComponent.prototype.ngOnDestroy = /** * \@method ngOnDestroy * @return {?} */ function () { this.subscriptions = removeSubscriptions(this.subscriptions); }; Object.defineProperty(ContentComponent.prototype, "scrollHeight", { get: /** * [scrollHeight description] * \@method scrollHeight * @return {?} [description] */ function () { return this.contentInnerElement.nativeElement.scrollHeight; }, enumerable: true, configurable: true }); /** * [getTitle description] * \@method getTitle * @param {?} title [description] * @return {?} [description] */ ContentComponent.prototype.getTitle = /** * [getTitle description] * \@method getTitle * @param {?} title [description] * @return {?} [description] */ function (title) { return title ? title + " - " + this.titleTag : this.titleTag; }; /** * [setMinHeight description] * \@method setMinHeight * @return {?} */ ContentComponent.prototype.setContentMinHeight = /** * [setMinHeight description] * \@method setMinHeight * @return {?} */ function () { if (this.navigationEnd) { var /** @type {?} */ heightStyle = void 0; var /** @type {?} */ headerFooterOffsetHeight = this.headerService.offsetHeight + this.footerService.offsetHeight; if (this.layout === 'fixed') { heightStyle = this.windowInnerHeight - this.footerService.offsetHeight; } else { var /** @type {?} */ sidebarRight = this.sidebarRightService.scrollHeight ? this.sidebarRightService.scrollHeight - this.headerService.offsetHeight : 0; heightStyle = Math.max(this.windowInnerHeight - headerFooterOffsetHeight, this.sidebarLeftHeight - this.headerService.offsetHeight, sidebarRight); } if (heightStyle && heightStyle !== this.heightStyle) { if (this.scrollHeight > heightStyle) { heightStyle = null; } this.heightStyle = heightStyle; this.changeDetectorRef.detectChanges(); } } }; ContentComponent.decorators = [ { type: Component, args: [{ selector: 'mk-layout-content', template: "<div class=\"content-wrapper\" [style.min-height.px]=\"heightStyle\">\n <div #contentInnerElement class=\"content-inner\">\n <ng-content select=\"[mk-layout-content-before-header]\"></ng-content>\n <section *ngIf=\"header || description\" class=\"content-header\">\n <h1>\n {{header}}\n <small *ngIf=\"description\">{{description}}</small>\n </h1>\n <mk-breadcrumbs></mk-breadcrumbs>\n </section>\n <ng-content select=\"[mk-layout-content-after-header]\"></ng-content>\n <section class=\"content\">\n <ng-content></ng-content>\n </section>\n </div>\n</div>\n", styles: [":host{display:block}.content-wrapper{position:relative}"], changeDetection: ChangeDetectionStrategy.OnPush },] }, ]; /** @nocollapse */ ContentComponent.ctorParameters = function () { return [ { type: LayoutStore, }, { type: RoutingService, }, { type: Title, }, { type: ElementRef, }, { type: ChangeDetectorRef, }, { type: SidebarRightService, }, { type: HeaderService, }, { type: FooterService, }, { type: Router, }, ]; }; ContentComponent.propDecorators = { "contentInnerElement": [{ type: ViewChild, args: ['contentInnerElement',] },], }; return ContentComponent; }()); /** * @fileoverview added by tsickle * @suppress {checkTypes} checked by tsc */ var ContentModule = /** @class */ (function () { function ContentModule() { } ContentModule.decorators = [ { type: NgModule, args: [{ imports: [CommonModule, RouterModule, BreadcrumbsModule], exports: [ContentComponent], declarations: [ContentComponent] },] }, ]; return ContentModule; }()); /** * @fileoverview added by tsickle * @suppress {checkTypes} checked by tsc */ /** * Footer Left */ var FooterLeftComponent = /** @class */ (function () { function FooterLeftComponent() { } FooterLeftComponent.decorators = [ { type: Component, args: [{ selector: 'mk-layout-footer-left', template: '<ng-template #templateRef><ng-content></ng-content></ng-template>' },] }, ]; /** @nocollapse */ FooterLeftComponent.propDecorators = { "templateRef": [{ type: ViewChild, args: ['templateRef',] },], }; return FooterLeftComponent; }()); /** * Footer Right */ var FooterRightComponent = /** @class */ (function () { function FooterRightComponent() { } FooterRightComponent.decorators = [ { type: Component, args: [{ selector: 'mk-layout-footer-right', template: '<ng-template #templateRef><ng-content></ng-content></ng-template>' },] }, ]; /** @nocollapse */ FooterRightComponent.propDecorators = { "templateRef": [{ type: ViewChild, args: ['templateRef',] },], }; return FooterRightComponent; }()); var FooterComponent = /** @class */ (function () { function FooterComponent(elementRef, footerService) { this.elementRef = elementRef; this.footerService = footerService; } /** * @return {?} */ FooterComponent.prototype.ngOnInit = /** * @return {?} */ function () { this.footerService.elementRef = this.elementRef; }; FooterComponent.decorators = [ { type: Component, args: [{ selector: 'mk-layout-footer', template: "<footer class=\"main-footer\">\n <div class=\"pull-right hidden-xs\">\n <ng-template [ngTemplateOutlet]=\"footerRightComponent?.templateRef\"></ng-template>\n </div>\n <ng-template [ngTemplateOutlet]=\"footerLeftComponent?.templateRef\"></ng-template>\n</footer>\n", styles: [":host{display:block}"] },] }, ]; /** @nocollapse */ FooterComponent.ctorParameters = function () { return [ { type: ElementRef, }, { type: FooterService, }, ]; }; FooterComponent.propDecorators = { "footerLeftComponent": [{ type: ContentChild, args: [FooterLeftComponent,] },], "footerRightComponent": [{ type: ContentChild, args: [FooterRightComponent,] },], }; return FooterComponent; }()); /** * @fileoverview added by tsickle * @suppress {checkTypes} checked by tsc */ var FooterModule = /** @class */ (function () { function FooterModule() { } FooterModule.decorators = [ { type: NgModule, args: [{ imports: [CommonModule], exports: [FooterComponent, FooterLeftComponent, FooterRightComponent], declarations: [FooterComponent, FooterLeftComponent, FooterRightComponent] },] }, ]; return FooterModule; }()); /** * @fileoverview added by tsickle * @suppress {checkTypes} checked by tsc */ /** * Header Logo */ var HeaderLogoComponent = /** @class */ (function () { function HeaderLogoComponent() { } HeaderLogoComponent.decorators = [ { type: Component, args: [{ selector: 'mk-layout-header-logo', template: '<ng-template #templateRef><ng-content></ng-content></ng-template>' },] }, ]; /** @nocollapse */ HeaderLogoComponent.propDecorators = { "templateRef": [{ type: ViewChild, args: ['templateRef',] },], }; return HeaderLogoComponent; }()); /** * Header Logo Mini */ var HeaderLogoMiniComponent = /** @class */ (function () { function HeaderLogoMiniComponent() { } HeaderLogoMiniComponent.decorators = [ { type: Component, args: [{ selector: 'mk-layout-header-logo-mini', template: '<ng-template #templateRef><ng-content></ng-content></ng-template>' },] }, ]; /** @nocollapse */ HeaderLogoMiniComponent.propDecorators = { "templateRef": [{ type: ViewChild, args: ['templateRef',] },], }; return HeaderLogoMiniComponent; }()); /** * Header */ var HeaderComponent = /** @class */ (function () { /** * @method constructor * @param layoutStore [description] * @param ngZone [description] * @param renderer2 [description] * @param elementRef [description] * @param headerService [description] */ function HeaderComponent(layoutStore, ngZone, renderer2, elementRef, headerService) { this.layoutStore = layoutStore; this.ngZone = ngZone; this.renderer2 = renderer2; this.elementRef = elementRef; this.headerService = headerService; this.listeners = []; this.subscriptions = []; this.isSidebarLeftToggle = true; this.isSidebarRightToggle = true; } /** * @method ngAfterViewInit */ /** * \@method ngAfterViewInit * @return {?} */ HeaderComponent.prototype.ngAfterViewInit = /** * \@method ngAfterViewInit * @return {?} */ function () { var _this = this; this.headerService.elementRef = this.headerElement; if (this.sidebarLeftToggleElement) { this.subscriptions.push(this.layoutStore.isSidebarLeftCollapsed.subscribe(function (value) { _this.isSidebarLeftCollapsed = value; })); this.ngZone.runOutsideAngular(function () { _this.listeners.push(_this.renderer2.listen(_this.sidebarLeftToggleElement.nativeElement, 'click', function (event) { event.preventDefault(); _this.layoutStore.sidebarLeftCollapsed(!_this.isSidebarLeftCollapsed); })); }); } if (this.sidebarRightToggleElement) { this.subscriptions.push(this.layoutStore.isSidebarRightCollapsed.subscribe(function (value) { _this.isSidebarRightCollapsed = value; })); this.ngZone.runOutsideAngular(function () { _this.listeners.push(_this.renderer2.listen(_this.sidebarRightToggleElement.nativeElement, 'click', function (event) { event.preventDefault(); _this.layoutStore.sidebarRightCollapsed(!_this.isSidebarRightCollapsed); })); }); } }; /** * @method ngOnDestroy */ /** * \@method ngOnDestroy * @return {?} */ HeaderComponent.prototype.ngOnDestroy = /** * \@method ngOnDestroy * @return {?} */ function () { this.listeners = removeListeners(this.listeners); this.subscriptions = removeSubscriptions(this.subscriptions); }; HeaderComponent.decorators = [ { type: Component, args: [{ selector: 'mk-layout-header', template: "<header #headerElement class=\"main-header\">\n <a href=\"/\" class=\"logo\">\n <span class=\"logo-mini\"><ng-template [ngTemplateOutlet]=\"headerLogoMiniComponent?.templateRef\"></ng-template></span>\n <span class=\"logo-lg\"><ng-template [ngTemplateOutlet]=\"headerLogoComponent?.templateRef\"></ng-template></span>\n </a>\n <nav class=\"navbar navbar-static-top\">\n <a *ngIf=\"isSidebarLeftToggle\" #sidebarLeftToggleElement href=\"#\" class=\"sidebar-toggle\">\n <span class=\"sr-only\">Toggle navigation</span>\n <span class=\"icon-bar\"></span>\n <span class=\"icon-bar\"></span>\n <span class=\"icon-bar\"></span>\n </a>\n <div *ngIf=\"isSidebarRightToggle\" class=\"sidebar-right-toggle\">\n <a #sidebarRightToggleElement href=\"#\"><i class=\"fa fa-gears\"></i></a>\n </div>\n <ng-content></ng-content>\n </nav>\n</header>\n", styles: [":host{display:block}.sidebar-right-toggle{float:right}.sidebar-right-toggle a{padding:15px;display:block;line-height:20px;cursor:pointer}"] },] }, ]; /** @nocollapse */ HeaderComponent.ctorParameters = function () { return [ { type: LayoutStore, }, { type: NgZone, }, { type: Renderer2, }, { type: ElementRef, }, { type: HeaderService, }, ]; }; HeaderComponent.propDecorators = { "isSidebarLeftToggle": [{ type: Input },], "isSidebarRightToggle": [{ type: Input },], "headerLogoComponent": [{ type: ContentChild, args: [HeaderLogoComponent,] },], "headerLogoMiniComponent": [{ type: ContentChild, args: [HeaderLogoMiniComponent,] },], "headerElement": [{ type: ViewChild, args: ['headerElement',] },], "sidebarLeftToggleElement": [{ type: ViewChild, args: ['sidebarLeftToggleElement',] },], "sidebarRightToggleElement": [{ type: ViewChild, args: ['sidebarRightToggleElement',] },], }; return HeaderComponent; }()); /** * @fileoverview added by tsickle * @suppress {checkTypes} checked by tsc */ var HeaderModule = /** @class */ (function () { function HeaderModule() { } HeaderModule.decorators = [ { type: NgModule, args: [{ imports: [CommonModule], exports: [HeaderComponent, HeaderLogoComponent, HeaderLogoMiniComponent], declarations: [HeaderComponent, HeaderLogoComponent, HeaderLogoMiniComponent] },] }, ]; return HeaderModule; }()); /** * @fileoverview added by tsickle * @suppress {checkTypes} checked by tsc */ var CollapseAnimationDirective = /** @class */ (function () { /** * @method constructor * @param elementRef [description] * @param ngZone [description] * @param renderer2 [description] */ function CollapseAnimationDirective(elementRef, ngZone, renderer2) { this.elementRef = elementRef; this.ngZone = ngZone; this.renderer2 = renderer2; this.firstStart = true; this.collapseAnimationDuration = 350; this.startEventEmitter = new EventEmitter(); this.doneEventEmitter = new EventEmitter(); } Object.defineProperty(CollapseAnimationDirective.prototype, "_isCollapsed", { set: /** * @param {?} value * @return {?} */ function (value) { this.lastIsCollapsed = this.isCollapsed; this.isCollapsed = value; if (!this.firstStart) { this.emit('start'); if (value) { this.collapse(); } else if (value === false) { this.unCollapse(); } } }, enumerable: true, configurable: true }); /** * @method ngOnInit */ /** * \@method ngOnInit * @return {?} */ CollapseAnimationDirective.prototype.ngOnInit = /** * \@method ngOnInit * @return {?} */ function () { if (this.collapseAnimationDuration && this.collapseAnimationDuration !== 350) { this.renderer2.setStyle(this.elementRef.nativeElement, 'transition-duration', this.collapseAnimationDuration + "ms"); } if (this.collapseAnimationTiming) { this.renderer2.setStyle(this.elementRef.nativeElement, 'transition-timing-function', this.collapseAnimationTiming); } }; /** * @method ngAfterContentInit */ /** * \@method ngAfterContentInit * @return {?} */ CollapseAnimationDirective.prototype.ngAfterContentInit = /** * \@method ngAfterContentInit * @return {?} */ function () { this.emit('start'); if (this.isCollapsed) { this.renderer2.setStyle(this.elementRef.nativeElement, 'display', 'none'); this.renderer2.addClass(this.elementRef.nativeElement, 'collapsing'); } this.emit('done'); this.firstStart = false; this.subscriptions(); }; /** * [ngOnDestroy description] * @method ngOnDestroy * @return [description] */ /** * [ngOnDestroy description] * \@method ngOnDestroy * @return {?} [description] */ CollapseAnimationDirective.prototype.ngOnDestroy = /** * [ngOnDestroy description] * \@method ngOnDestroy * @return {?} [description] */ function () { if (this.listener) { this.listener(); } }; /** * [subscriptions description] * \@method subscriptions * @return {?} */ CollapseAnimationDirective.prototype.subscriptions = /** * [subscriptions description] * \@method subscriptions * @return {?} */ function () { var _this = this; this.ngZone.runOutsideAngular(function () { _this.listener = _this.renderer2.listen(_this.elementRef.nativeElement, 'transitionend', function () { if (!_this.isCollapsed) { _this.renderer2.removeClass(_this.elementRef.nativeElement, 'un-collapse'); _this.renderer2.removeClass(_this.elementRef.nativeElement, 'collapsing'); } else { _this.renderer2.setStyle(_this.elementRef.nativeElement, 'display', 'none'); }