[59329aa] | 1 | import { NgModule, Component, Input, Output, ViewChild, EventEmitter, ContentChild, ContentChildren, ChangeDetectionStrategy, ViewEncapsulation } from '@angular/core';
|
---|
| 2 | import { CommonModule } from '@angular/common';
|
---|
| 3 | import { Header, Footer, PrimeTemplate, SharedModule } from 'primeng/api';
|
---|
| 4 | import { ScrollingModule, CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
|
---|
| 5 | import * as i0 from "@angular/core";
|
---|
| 6 | import * as i1 from "@angular/cdk/scrolling";
|
---|
| 7 | import * as i2 from "@angular/common";
|
---|
| 8 | export class VirtualScroller {
|
---|
| 9 | constructor(el) {
|
---|
| 10 | this.el = el;
|
---|
| 11 | this.delay = 250;
|
---|
| 12 | this.trackBy = (index, item) => item;
|
---|
| 13 | this.onLazyLoad = new EventEmitter();
|
---|
| 14 | this._totalRecords = 0;
|
---|
| 15 | this.page = 0;
|
---|
| 16 | this._first = 0;
|
---|
| 17 | }
|
---|
| 18 | get totalRecords() {
|
---|
| 19 | return this._totalRecords;
|
---|
| 20 | }
|
---|
| 21 | set totalRecords(val) {
|
---|
| 22 | this._totalRecords = val;
|
---|
| 23 | console.log("totalRecords is deprecated, provide a value with the length of virtual items instead.");
|
---|
| 24 | }
|
---|
| 25 | get first() {
|
---|
| 26 | return this._first;
|
---|
| 27 | }
|
---|
| 28 | set first(val) {
|
---|
| 29 | this._first = val;
|
---|
| 30 | console.log("first property is deprecated, use scrollToIndex function to scroll a specific item.");
|
---|
| 31 | }
|
---|
| 32 | get cache() {
|
---|
| 33 | return this._cache;
|
---|
| 34 | }
|
---|
| 35 | set cache(val) {
|
---|
| 36 | this._cache = val;
|
---|
| 37 | console.log("cache is deprecated as it is always on.");
|
---|
| 38 | }
|
---|
| 39 | ngAfterContentInit() {
|
---|
| 40 | this.templates.forEach((item) => {
|
---|
| 41 | switch (item.getType()) {
|
---|
| 42 | case 'item':
|
---|
| 43 | this.itemTemplate = item.template;
|
---|
| 44 | break;
|
---|
| 45 | case 'loadingItem':
|
---|
| 46 | this.loadingItemTemplate = item.template;
|
---|
| 47 | break;
|
---|
| 48 | case 'header':
|
---|
| 49 | this.headerTemplate = item.template;
|
---|
| 50 | break;
|
---|
| 51 | case 'footer':
|
---|
| 52 | this.footerTemplate = item.template;
|
---|
| 53 | break;
|
---|
| 54 | default:
|
---|
| 55 | this.itemTemplate = item.template;
|
---|
| 56 | break;
|
---|
| 57 | }
|
---|
| 58 | });
|
---|
| 59 | }
|
---|
| 60 | onScrollIndexChange(index) {
|
---|
| 61 | if (this.lazy) {
|
---|
| 62 | if (this.virtualScrollTimeout) {
|
---|
| 63 | clearTimeout(this.virtualScrollTimeout);
|
---|
| 64 | }
|
---|
| 65 | this.virtualScrollTimeout = setTimeout(() => {
|
---|
| 66 | let page = Math.floor(index / this.rows);
|
---|
| 67 | let virtualScrollOffset = page === 0 ? 0 : (page - 1) * this.rows;
|
---|
| 68 | let virtualScrollChunkSize = page === 0 ? this.rows * 2 : this.rows * 3;
|
---|
| 69 | if (page !== this.virtualPage) {
|
---|
| 70 | this.virtualPage = page;
|
---|
| 71 | this.onLazyLoad.emit({ first: virtualScrollOffset, rows: virtualScrollChunkSize });
|
---|
| 72 | }
|
---|
| 73 | }, this.delay);
|
---|
| 74 | }
|
---|
| 75 | }
|
---|
| 76 | getBlockableElement() {
|
---|
| 77 | return this.el.nativeElement.children[0];
|
---|
| 78 | }
|
---|
| 79 | //@deprecated
|
---|
| 80 | scrollTo(index, mode) {
|
---|
| 81 | this.scrollToIndex(index, mode);
|
---|
| 82 | }
|
---|
| 83 | scrollToIndex(index, mode) {
|
---|
| 84 | if (this.viewport) {
|
---|
| 85 | this.viewport.scrollToIndex(index, mode);
|
---|
| 86 | }
|
---|
| 87 | }
|
---|
| 88 | }
|
---|
| 89 | VirtualScroller.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: VirtualScroller, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
---|
| 90 | VirtualScroller.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.0", type: VirtualScroller, selector: "p-virtualScroller", inputs: { value: "value", itemSize: "itemSize", style: "style", styleClass: "styleClass", scrollHeight: "scrollHeight", lazy: "lazy", rows: "rows", minBufferPx: "minBufferPx", maxBufferPx: "maxBufferPx", delay: "delay", trackBy: "trackBy", totalRecords: "totalRecords", first: "first", cache: "cache" }, outputs: { onLazyLoad: "onLazyLoad" }, host: { classAttribute: "p-element" }, queries: [{ propertyName: "header", first: true, predicate: Header, descendants: true }, { propertyName: "footer", first: true, predicate: Footer, descendants: true }, { propertyName: "templates", predicate: PrimeTemplate }], viewQueries: [{ propertyName: "viewport", first: true, predicate: CdkVirtualScrollViewport, descendants: true }], ngImport: i0, template: `
|
---|
| 91 | <div [ngClass]="'p-virtualscroller p-component'" [ngStyle]="style" [class]="styleClass">
|
---|
| 92 | <div class="p-virtualscroller-header" *ngIf="header || headerTemplate">
|
---|
| 93 | <ng-content select="p-header"></ng-content>
|
---|
| 94 | <ng-container *ngTemplateOutlet="headerTemplate"></ng-container>
|
---|
| 95 | </div>
|
---|
| 96 | <div #content class="p-virtualscroller-content">
|
---|
| 97 | <div class="p-virtualscroller-list">
|
---|
| 98 | <cdk-virtual-scroll-viewport #viewport [ngStyle]="{'height': scrollHeight}" tabindex="0" [itemSize]="itemSize" [minBufferPx]="minBufferPx" [maxBufferPx]="maxBufferPx" (scrolledIndexChange)="onScrollIndexChange($event)">
|
---|
| 99 | <ng-container *cdkVirtualFor="let item of value; trackBy: trackBy; let i = index; let c = count; let f = first; let l = last; let e = even; let o = odd;">
|
---|
| 100 | <div [ngStyle]="{'height': itemSize + 'px'}" class="p-virtualscroller-item">
|
---|
| 101 | <ng-container *ngTemplateOutlet="item ? itemTemplate : loadingItemTemplate; context: {$implicit: item, index: i, count: c, first: f, last: l, even: e, odd: o}"></ng-container>
|
---|
| 102 | </div>
|
---|
| 103 | </ng-container>
|
---|
| 104 | </cdk-virtual-scroll-viewport>
|
---|
| 105 | </div>
|
---|
| 106 | </div>
|
---|
| 107 | <div class="p-virtualscroller-footer" *ngIf="footer || footerTemplate">
|
---|
| 108 | <ng-content select="p-footer"></ng-content>
|
---|
| 109 | <ng-container *ngTemplateOutlet="footerTemplate"></ng-container>
|
---|
| 110 | </div>
|
---|
| 111 | </div>
|
---|
| 112 | `, isInline: true, styles: ["cdk-virtual-scroll-viewport{outline:0 none}\n"], components: [{ type: i1.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }], directives: [{ type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i1.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { type: i1.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None });
|
---|
| 113 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: VirtualScroller, decorators: [{
|
---|
| 114 | type: Component,
|
---|
| 115 | args: [{ selector: 'p-virtualScroller', template: `
|
---|
| 116 | <div [ngClass]="'p-virtualscroller p-component'" [ngStyle]="style" [class]="styleClass">
|
---|
| 117 | <div class="p-virtualscroller-header" *ngIf="header || headerTemplate">
|
---|
| 118 | <ng-content select="p-header"></ng-content>
|
---|
| 119 | <ng-container *ngTemplateOutlet="headerTemplate"></ng-container>
|
---|
| 120 | </div>
|
---|
| 121 | <div #content class="p-virtualscroller-content">
|
---|
| 122 | <div class="p-virtualscroller-list">
|
---|
| 123 | <cdk-virtual-scroll-viewport #viewport [ngStyle]="{'height': scrollHeight}" tabindex="0" [itemSize]="itemSize" [minBufferPx]="minBufferPx" [maxBufferPx]="maxBufferPx" (scrolledIndexChange)="onScrollIndexChange($event)">
|
---|
| 124 | <ng-container *cdkVirtualFor="let item of value; trackBy: trackBy; let i = index; let c = count; let f = first; let l = last; let e = even; let o = odd;">
|
---|
| 125 | <div [ngStyle]="{'height': itemSize + 'px'}" class="p-virtualscroller-item">
|
---|
| 126 | <ng-container *ngTemplateOutlet="item ? itemTemplate : loadingItemTemplate; context: {$implicit: item, index: i, count: c, first: f, last: l, even: e, odd: o}"></ng-container>
|
---|
| 127 | </div>
|
---|
| 128 | </ng-container>
|
---|
| 129 | </cdk-virtual-scroll-viewport>
|
---|
| 130 | </div>
|
---|
| 131 | </div>
|
---|
| 132 | <div class="p-virtualscroller-footer" *ngIf="footer || footerTemplate">
|
---|
| 133 | <ng-content select="p-footer"></ng-content>
|
---|
| 134 | <ng-container *ngTemplateOutlet="footerTemplate"></ng-container>
|
---|
| 135 | </div>
|
---|
| 136 | </div>
|
---|
| 137 | `, changeDetection: ChangeDetectionStrategy.Default, encapsulation: ViewEncapsulation.None, host: {
|
---|
| 138 | 'class': 'p-element'
|
---|
| 139 | }, styles: ["cdk-virtual-scroll-viewport{outline:0 none}\n"] }]
|
---|
| 140 | }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { value: [{
|
---|
| 141 | type: Input
|
---|
| 142 | }], itemSize: [{
|
---|
| 143 | type: Input
|
---|
| 144 | }], style: [{
|
---|
| 145 | type: Input
|
---|
| 146 | }], styleClass: [{
|
---|
| 147 | type: Input
|
---|
| 148 | }], scrollHeight: [{
|
---|
| 149 | type: Input
|
---|
| 150 | }], lazy: [{
|
---|
| 151 | type: Input
|
---|
| 152 | }], rows: [{
|
---|
| 153 | type: Input
|
---|
| 154 | }], minBufferPx: [{
|
---|
| 155 | type: Input
|
---|
| 156 | }], maxBufferPx: [{
|
---|
| 157 | type: Input
|
---|
| 158 | }], delay: [{
|
---|
| 159 | type: Input
|
---|
| 160 | }], trackBy: [{
|
---|
| 161 | type: Input
|
---|
| 162 | }], header: [{
|
---|
| 163 | type: ContentChild,
|
---|
| 164 | args: [Header]
|
---|
| 165 | }], footer: [{
|
---|
| 166 | type: ContentChild,
|
---|
| 167 | args: [Footer]
|
---|
| 168 | }], templates: [{
|
---|
| 169 | type: ContentChildren,
|
---|
| 170 | args: [PrimeTemplate]
|
---|
| 171 | }], viewport: [{
|
---|
| 172 | type: ViewChild,
|
---|
| 173 | args: [CdkVirtualScrollViewport]
|
---|
| 174 | }], onLazyLoad: [{
|
---|
| 175 | type: Output
|
---|
| 176 | }], totalRecords: [{
|
---|
| 177 | type: Input
|
---|
| 178 | }], first: [{
|
---|
| 179 | type: Input
|
---|
| 180 | }], cache: [{
|
---|
| 181 | type: Input
|
---|
| 182 | }] } });
|
---|
| 183 | export class VirtualScrollerModule {
|
---|
| 184 | }
|
---|
| 185 | VirtualScrollerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: VirtualScrollerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
---|
| 186 | VirtualScrollerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: VirtualScrollerModule, declarations: [VirtualScroller], imports: [CommonModule, ScrollingModule], exports: [VirtualScroller, SharedModule, ScrollingModule] });
|
---|
| 187 | VirtualScrollerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: VirtualScrollerModule, imports: [[CommonModule, ScrollingModule], SharedModule, ScrollingModule] });
|
---|
| 188 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: VirtualScrollerModule, decorators: [{
|
---|
| 189 | type: NgModule,
|
---|
| 190 | args: [{
|
---|
| 191 | imports: [CommonModule, ScrollingModule],
|
---|
| 192 | exports: [VirtualScroller, SharedModule, ScrollingModule],
|
---|
| 193 | declarations: [VirtualScroller]
|
---|
| 194 | }]
|
---|
| 195 | }] });
|
---|
| 196 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmlydHVhbHNjcm9sbGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2FwcC9jb21wb25lbnRzL3ZpcnR1YWxzY3JvbGxlci92aXJ0dWFsc2Nyb2xsZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFDLFFBQVEsRUFBQyxTQUFTLEVBQTZCLEtBQUssRUFBQyxNQUFNLEVBQUMsU0FBUyxFQUFDLFlBQVksRUFBQyxZQUFZLEVBQUMsZUFBZSxFQUF1Qix1QkFBdUIsRUFBRSxpQkFBaUIsRUFBQyxNQUFNLGVBQWUsQ0FBQztBQUMvTSxPQUFPLEVBQUMsWUFBWSxFQUFDLE1BQU0saUJBQWlCLENBQUM7QUFDN0MsT0FBTyxFQUFDLE1BQU0sRUFBQyxNQUFNLEVBQUMsYUFBYSxFQUFDLFlBQVksRUFBQyxNQUFNLGFBQWEsQ0FBQztBQUNyRSxPQUFPLEVBQUMsZUFBZSxFQUFDLHdCQUF3QixFQUFDLE1BQU0sd0JBQXdCLENBQUM7Ozs7QUFtQ2hGLE1BQU0sT0FBTyxlQUFlO0lBc0R4QixZQUFtQixFQUFjO1FBQWQsT0FBRSxHQUFGLEVBQUUsQ0FBWTtRQWxDeEIsVUFBSyxHQUFXLEdBQUcsQ0FBQztRQUVwQixZQUFPLEdBQWEsQ0FBQyxLQUFhLEVBQUUsSUFBUyxFQUFFLEVBQUUsQ0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tcbiAgICAgICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgICAgICAgIGNhc2UgJ2Zvb3Rlcic6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZm9vdGVyVGVtcGxhdGUgPSBpdGVtLnRlbXBsYXRlO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5pdGVtVGVtcGxhdGUgPSBpdGVtLnRlbXBsYXRlO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBvblNjcm9sbEluZGV4Q2hhbmdlKGluZGV4OiBudW1iZXIpIHtcbiAgICAgICAgaWYgKHRoaXMubGF6eSkge1xuICAgICAgICAgICAgaWYgKHRoaXMudmlydHVhbFNjcm9sbFRpbWVvdXQpIHtcbiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQodGhpcy52aXJ0dWFsU2Nyb2xsVGltZW91dCk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHRoaXMudmlydHVhbFNjcm9sbFRpbWVvdXQgPSBzZXRUaW1lb3V0KCgpID0+IHtcbiAgICAgICAgICAgICAgICBsZXQgcGFnZSA9IE1hdGguZmxvb3IoaW5kZXggLyB0aGlzLnJvd3MpO1xuICAgICAgICAgICAgICAgIGxldCB2aXJ0dWFsU2Nyb2xsT2Zmc2V0ID0gcGFnZSA9PT0gMCA/IDAgOiAocGFnZSAtIDEpICogdGhpcy5yb3dzO1xuICAgICAgICAgICAgICAgIGxldCB2aXJ0dWFsU2Nyb2xsQ2h1bmtTaXplID0gcGFnZSA9PT0gMCA/IHRoaXMucm93cyAqIDIgOiB0aGlzLnJvd3MgKiAzO1xuXG4gICAgICAgICAgICAgICAgaWYgKHBhZ2UgIT09IHRoaXMudmlydHVhbFBhZ2UpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy52aXJ0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