UNPKG

@addapptables/perfect-scrollbar

Version:
131 lines (124 loc) 5.18 kB
(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('perfect-scrollbar'), require('@angular/router'), require('rxjs/operators')) : typeof define === 'function' && define.amd ? define('@addapptables/perfect-scrollbar', ['exports', '@angular/core', 'perfect-scrollbar', '@angular/router', 'rxjs/operators'], factory) : (global = global || self, factory((global.addapptables = global.addapptables || {}, global.addapptables['perfect-scrollbar'] = {}), global.ng.core, global['perfect-scrollbar'], global.ng.router, global.rxjs.operators)); }(this, function (exports, core, PerfectScrollbar, router, operators) { 'use strict'; PerfectScrollbar = PerfectScrollbar && PerfectScrollbar.hasOwnProperty('default') ? PerfectScrollbar['default'] : PerfectScrollbar; /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ var PerfectScrollbarDirective = /** @class */ (function () { function PerfectScrollbarDirective(_elementRef, _router) { this._elementRef = _elementRef; this._router = _router; this.allSub = new Array(); this.options = {}; } Object.defineProperty(PerfectScrollbarDirective.prototype, "perfectScrollOptions", { set: /** * @param {?} value * @return {?} */ function (value) { this.options = value; }, enumerable: true, configurable: true }); /** * @return {?} */ PerfectScrollbarDirective.prototype.onResize = /** * @return {?} */ function () { this.ps && this.ps.update(); }; /** * @return {?} */ PerfectScrollbarDirective.prototype.ngAfterViewInit = /** * @return {?} */ function () { var _this = this; this.initPerfectScroll(); /** @type {?} */ var navigationEnd$ = this._router.events .pipe(operators.filter((/** * @param {?} event * @return {?} */ function (event) { return event instanceof router.NavigationEnd || event instanceof router.NavigationError || event instanceof router.NavigationCancel; })), operators.delay(100)) .subscribe((/** * @return {?} */ function () { _this.ps && _this.ps.update(); })); this.allSub.push(navigationEnd$); }; /** * @return {?} */ PerfectScrollbarDirective.prototype.initPerfectScroll = /** * @return {?} */ function () { this.ps = new PerfectScrollbar(this._elementRef.nativeElement, {}); }; /** * @return {?} */ PerfectScrollbarDirective.prototype.ngOnDestroy = /** * @return {?} */ function () { this.ps && this.ps.destroy(); this.allSub.forEach((/** * @param {?} x * @return {?} */ function (x) { return x.unsubscribe(); })); }; PerfectScrollbarDirective.decorators = [ { type: core.Directive, args: [{ selector: '[addapptablesPerfectScrollbar]' },] } ]; /** @nocollapse */ PerfectScrollbarDirective.ctorParameters = function () { return [ { type: core.ElementRef }, { type: router.Router } ]; }; PerfectScrollbarDirective.propDecorators = { perfectScrollOptions: [{ type: core.Input }], onResize: [{ type: core.HostListener, args: ['window:resize',] }] }; return PerfectScrollbarDirective; }()); /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ var AddapptablePerfectScrollbarModule = /** @class */ (function () { function AddapptablePerfectScrollbarModule() { } AddapptablePerfectScrollbarModule.decorators = [ { type: core.NgModule, args: [{ declarations: [ PerfectScrollbarDirective ], exports: [ PerfectScrollbarDirective ] },] } ]; return AddapptablePerfectScrollbarModule; }()); exports.AddapptablePerfectScrollbarModule = AddapptablePerfectScrollbarModule; exports.PerfectScrollbarDirective = PerfectScrollbarDirective; Object.defineProperty(exports, '__esModule', { value: true }); })); //# sourceMappingURL=addapptables-perfect-scrollbar.umd.js.map