1 line
12 KiB
Plaintext
1 line
12 KiB
Plaintext
|
{"version":3,"file":"primeng-virtualscroller.mjs","sources":["../../src/app/components/virtualscroller/virtualscroller.ts","../../src/app/components/virtualscroller/primeng-virtualscroller.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport {\n AfterContentInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChild,\n ContentChildren,\n ElementRef,\n EventEmitter,\n Input,\n NgModule,\n Output,\n QueryList,\n TemplateRef,\n ViewChild,\n ViewEncapsulation,\n booleanAttribute,\n numberAttribute\n} from '@angular/core';\nimport { BlockableUI, Footer, Header, PrimeTemplate, ScrollerOptions, SharedModule } from 'primeng/api';\nimport { Scroller, ScrollerModule } from 'primeng/scroller';\nimport { Nullable } from 'primeng/ts-helpers';\nimport { VirtualScrollerLazyLoadEvent } from './virtualscroller.interface';\n/**\n * VirtualScroller is a performant approach to handle huge data efficiently.\n * @group Components\n */\n@Component({\n selector: 'p-virtualScroller',\n template: `\n <div [ngClass]=\"'p-virtualscroller p-component'\" [ngStyle]=\"style\" [class]=\"styleClass\" [attr.data-pc-name]=\"'virtualscroller'\" [attr.data-pc-section]=\"'root'\">\n <div class=\"p-virtualscroller-header\" *ngIf=\"header || headerTemplate\">\n <ng-content select=\"p-header\"></ng-content>\n <ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container>\n </div>\n <div #content class=\"p-virtualscroller-content\" [attr.data-pc-section]=\"'content'\">\n <p-scroller #scroller [items]=\"value\" styleClass=\"p-virtualscroller-list\" [style]=\"{ height: scrollHeight }\" [itemSize]=\"itemSize\" [lazy]=\"lazy\" (onLazyLoad)=\"onLazyItemLoad($event)\" [options]=\"options\">\n <ng-template pTemplate=\"item\" let-item let-scrollerOptions=\"options\">\n <div [ngStyle]=\"{ height: itemSize + 'px' }\" class=\"p-virtualscroller-item\">\n <ng-container *ngTemplateOutlet=\"item ? itemTemplate : loadingItemTemplate; context: { $implicit: item, options: scrollerOptions }\"></ng-container>\n </div>\n </ng-template>\n </p-scroller>\n </div>\n <div class=\"p-virtualscroller-footer\" *ngIf=\"footer || footerTemplate\" [attr.data-pc-section]=\"'footer'\">\n <ng-content select=\"p-footer\"></ng-content>\n <ng-container *ngTemplateOutlet=\"footerTemplate\"></ng-container>\n </div>\n </div>\n `,\n changeDetection: ChangeDetectionStrategy.Default,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'p-element'\n }\n})\nexport class VirtualScroller implements AfterContentInit, BlockableUI {\n /**\n * An array of objects to display.\n * @group Props\n */\n @Input() value: any[] | undefined;\n /**\n * Height of an item in the list.\n * @group Props\n */\n @Input({ transform: numberAttribute }) itemSize: number | undefined;\n /**\n * Inline style of the component.\n * @group Props\n */\n @Input() style: { [klass: string]: any } | null | undefined;\n /**\n * Style class of the component.\n * @group Props\n */\n @Input() styleClass: string | undefined;\n /**\n * Max height of the content area in inline mode.\n * @group Props\n */\n @Input() scrollHeight: any;\n /**\n * Defines if data is loaded and interacted with in lazy manner.\n * @group Props\n */\n @Input({ transform: booleanAttribute }) lazy: boolean | undefined;\n /**\n * Whether to use the scroller feature. The properties of scroller component can be used like an object in it.\n * @group Props\n */\n @Input() options: ScrollerOptions | undefined;\n /**\n * Threshold in milliseconds to delay lazy loading during scrolling.\n * @group Props\n */\n @Input({ transform:
|