1 line
15 KiB
Plaintext
1 line
15 KiB
Plaintext
|
{"version":3,"file":"primeng-scrolltop.mjs","sources":["../../src/app/components/scrolltop/scrolltop.ts","../../src/app/components/scrolltop/primeng-scrolltop.ts"],"sourcesContent":["import { AnimationEvent, animate, state, style, transition, trigger } from '@angular/animations';\nimport { CommonModule, DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChildren, ElementRef, Inject, Input, NgModule, OnDestroy, OnInit, PLATFORM_ID, QueryList, Renderer2, TemplateRef, ViewEncapsulation, numberAttribute } from '@angular/core';\nimport { PrimeNGConfig, PrimeTemplate, SharedModule } from 'primeng/api';\nimport { DomHandler } from 'primeng/dom';\nimport { ChevronUpIcon } from 'primeng/icons/chevronup';\nimport { ZIndexUtils } from 'primeng/utils';\n/**\n * ScrollTop gets displayed after a certain scroll position and used to navigates to the top of the page quickly.\n * @group Components\n */\n@Component({\n selector: 'p-scrollTop',\n template: `\n <button\n *ngIf=\"visible\"\n [@animation]=\"{ value: 'open', params: { showTransitionParams: showTransitionOptions, hideTransitionParams: hideTransitionOptions } }\"\n (@animation.start)=\"onEnter($event)\"\n (@animation.done)=\"onLeave($event)\"\n [attr.aria-label]=\"buttonAriaLabel\"\n [ngClass]=\"containerClass()\"\n (click)=\"onClick()\"\n [class]=\"styleClass\"\n [ngStyle]=\"style\"\n type=\"button\"\n >\n <ng-container *ngIf=\"!iconTemplate\">\n <span *ngIf=\"icon\" [class]=\"icon\" [ngClass]=\"'p-scrolltop-icon'\"></span>\n <ChevronUpIcon *ngIf=\"!icon\" [styleClass]=\"'p-scrolltop-icon'\" [ngStyle]=\"{ 'font-size': '1rem', scale: '1.5' }\" />\n </ng-container>\n <ng-template [ngIf]=\"!icon\" *ngTemplateOutlet=\"iconTemplate; context: { styleClass: 'p-scrolltop-icon' }\"></ng-template>\n </button>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n styleUrls: ['./scrolltop.css'],\n animations: [\n trigger('animation', [\n state(\n 'void',\n style({\n opacity: 0\n })\n ),\n state(\n 'open',\n style({\n opacity: 1\n })\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 * Class of the element.\n * @group Props\n */\n @Input() styleClass: string | undefined;\n /**\n * Inline style of the element.\n * @group Props\n */\n @Input() style: { [klass: string]: any } | null | undefined;\n /**\n * Target of the ScrollTop.\n * @group Props\n */\n @Input() target: 'window' | 'parent' | undefined = 'window';\n /**\n * Defines the threshold value of the vertical scroll position of the target to toggle the visibility.\n * @group Props\n */\n @Input({ transform: numberAttribute }) threshold: number = 400;\n /**\n * Name of the icon or JSX.Element for icon.\n * @group Props\n */\n @Input() icon: string | undefined;\n /**\n * Defines the scrolling behavior, \"smooth\" adds an animation and \"auto\" scrolls with a jump.\n * @group Props\n */\n @Input() behavior: 'auto' | 'smooth' | undefined = 'smooth';\n /**\n * A string value used to determine the display transition options.\n * @group Props\n */\n @Input() showTransitionOptions: string = '.15s';\n /**\n * A string value used to determine the hiding transition options.\n * @group Props\n */\n @Input() hideTransitionOptions: string = '.15s';\n /**\n *
|