source: trip-planner-front/node_modules/primeng/fesm2015/primeng-scrolltop.mjs.map@ 571e0df

Last change on this file since 571e0df was 59329aa, checked in by Ema <ema_spirova@…>, 3 years ago

adding photos

  • Property mode set to 100644
File size: 8.6 KB
Line 
1{"version":3,"file":"primeng-scrolltop.mjs","sources":["../../src/app/components/scrolltop/scrolltop.ts","../../src/app/components/scrolltop/primeng-scrolltop.ts"],"sourcesContent":["import { NgModule, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, OnInit, OnDestroy, ElementRef, ChangeDetectorRef} from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { animate, state, style, transition, trigger, AnimationEvent } from '@angular/animations';\nimport { DomHandler } from 'primeng/dom';\nimport { ZIndexUtils } from 'primeng/utils'\nimport { PrimeNGConfig } from 'primeng/api';\n\n@Component({\n selector: 'p-scrollTop',\n template: `\n <button *ngIf=\"visible\" [@animation]=\"{value: 'open', params: {showTransitionParams: showTransitionOptions, hideTransitionParams: hideTransitionOptions}}\" (@animation.start)=\"onEnter($event)\" (@animation.done)=\"onLeave($event)\"\n [ngClass]=\"containerClass()\" (click)=\"onClick()\" [class]=\"styleClass\" [ngStyle]=\"style\" type=\"button\">\n <span [class]=\"icon\" [ngClass]=\"'p-scrolltop-icon'\"></span>\n </button>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n styleUrls: ['./scrolltop.css'],\n animations: [\n trigger('animation', [\n state('void', style({\n opacity: 0\n })),\n state('open', style({\n opacity: 1\n })),\n transition('void => open', animate('{{showTransitionParams}}')),\n transition('open => void', animate('{{hideTransitionParams}}')),\n ])\n ],\n host: {\n 'class': 'p-element'\n }\n})\nexport class ScrollTop implements OnInit, OnDestroy {\n\n @Input() styleClass: string;\n\n @Input() style: any;\n\n @Input() target: string = \"window\";\n\n @Input() threshold: number = 400;\n\n @Input() icon: string = \"pi pi-chevron-up\";\n\n @Input() behavior: string = \"smooth\";\n\n @Input() showTransitionOptions: string = '.15s';\n\n @Input() hideTransitionOptions: string = '.15s';\n\n scrollListener: any;\n\n visible: boolean = false;\n\n overlay: any;\n\n constructor(public el: ElementRef, private cd: ChangeDetectorRef, public config: PrimeNGConfig) { }\n\n ngOnInit() {\n if (this.target === 'window')\n this.bindDocumentScrollListener();\n else if (this.target === 'parent')\n this.bindParentScrollListener();\n }\n\n onClick() {\n let scrollElement = this.target === 'window' ? window : this.el.nativeElement.parentElement;\n scrollElement.scroll({\n top: 0,\n behavior: this.behavior\n });\n }\n\n onEnter(event: AnimationEvent) {\n\n switch(event.toState) {\n case 'open':\n this.overlay = event.element;\n ZIndexUtils.set('overlay', this.overlay, this.config.zIndex.overlay);\n break;\n case 'void':\n this.overlay = null;\n break;\n }\n }\n\n onLeave(event: AnimationEvent) {\n switch(event.toState) {\n case 'void':\n ZIndexUtils.clear(event.element);\n break;\n }\n }\n\n checkVisibility(scrollY) {\n if (scrollY > this.threshold)\n this.visible = true;\n else\n this.visible = false;\n\n this.cd.markForCheck();\n }\n\n bindParentScrollListener() {\n this.scrollListener = () => {\n\n this.checkVisibility(this.el.nativeElement.parentElement.scrollTop);\n };\n\n this.el.nativeElement.parentElement.addEventListener('scroll', this.scrollListener);\n }\n\n bindDocumentScrollListener() {\n this.scrollListener = () => {\n this.checkVisibility(DomHandler.getWindowScrollTop());\n };\n\n window.addEventListener('scroll', this.scrollListener);\n }\n\n unbindParentScrollListener() {\n if (this.scrollListener) {\n this.el.nativeElement.parentElement.removeEventListener('scroll', this.scrollListener);\n this.scrollListener = null;\n }\n }\n\n unbindDocumentScrollListener() {\n if (this.scrollListener) {\n window.removeEventListener('scroll', this.scrollListener);\n this.scrollListener = null;\n }\n }\n\n containerClass() {\n return {\n 'p-scrolltop p-link p-component': true,\n 'p-scrolltop-sticky': this.target !== 'window'\n };\n }\n\n ngOnDestroy() {\n if (this.target === 'window')\n this.unbindDocumentScrollListener();\n else if (this.target === 'parent')\n this.unbindParentScrollListener();\n\n if (this.overlay) {\n ZIndexUtils.clear(this.overlay);\n this.overlay = null;\n }\n }\n}\n\n@NgModule({\n imports: [CommonModule],\n exports: [ScrollTop],\n declarations: [ScrollTop]\n})\nexport class ScrollTopModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;MAkCa,SAAS;IAwBlB,YAAmB,EAAc,EAAU,EAAqB,EAAS,MAAqB;QAA3E,OAAE,GAAF,EAAE,CAAY;QAAU,OAAE,GAAF,EAAE,CAAmB;QAAS,WAAM,GAAN,MAAM,CAAe;QAlBrF,WAAM,GAAW,QAAQ,CAAC;QAE1B,cAAS,GAAW,GAAG,CAAC;QAExB,SAAI,GAAW,kBAAkB,CAAC;QAElC,aAAQ,GAAW,QAAQ,CAAC;QAE5B,0BAAqB,GAAW,MAAM,CAAC;QAEvC,0BAAqB,GAAW,MAAM,CAAC;QAIhD,YAAO,GAAY,KAAK,CAAC;KAI0E;IAEnG,QAAQ;QACJ,IAAI,IAAI,CAAC,MAAM,KAAK,QAAQ;YACxB,IAAI,CAAC,0BAA0B,EAAE,CAAC;aACjC,IAAI,IAAI,CAAC,MAAM,KAAK,QAAQ;YAC7B,IAAI,CAAC,wBAAwB,EAAE,CAAC;KACvC;IAED,OAAO;QACH,IAAI,aAAa,GAAG,IAAI,CAAC,MAAM,KAAK,QAAQ,GAAG,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,aAAa,CAAC;QAC3F,aAAa,CAAC,MAAM,CAAC;YAClB,GAAG,EAAE,CAAC;YACN,QAAQ,EAAE,IAAI,CAAC,QAAQ;SAC1B,CAAC,CAAC;KACN;IAED,OAAO,CAAC,KAAqB;QAEzB,QAAO,KAAK,CAAC,OAAO;YAChB,KAAK,MAAM;gBACP,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;gBAC7B,WAAW,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM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