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,CACRC,GAAQ,cAAe,CACnBC,GAAW,eAAgB,CACvBC,GAAM,gCAAiC,CACnCC,EAAM,CAAEC,QAAS,EAAGC,UAAW,YAAY,CAAE,EAC7CC,GAAQ,OAAQC,GAAQ,wCAAyCJ,EAAM,CAAEC,QAAS,EAAGC,UAAW,UAAU,CAAE,CAAC,CAAC,CAAC,EAChH,CAAEG,SAAU,EAAI,CAAE,CAAC,CACzB,CAAC,CACL,CAAC,CACL,EAAAC,gBAAA,IAIEvM,GAAMD,GAA6ByM,GAAA,CApBzCC,GAAY,EAAEC,GAAA,qBA8HAtD,EACeC,EACPC,EACQC,EACVC,EACOC,EACNC,CAAS,IAhHlB3J,EAA6B,SAAA4M,CAAA,IAAAC,CAAA,CAAAC,EAAA,IAAAC,CAAA","names":["NgScrollbarExt","AsyncDetection","then","m","VirtualScrollerComponent","ScrollViewport","NgTemplateOutlet","j","r","$implicit","Ne","Ue","after","Ae","e","ɵɵelementContainer","ke","ɵɵtemplate","PagedVirtualScrollerComponent_Defer_1_Conditional_0_Conditional_0_For_5_ng_container_0_Template","t","i","o","ɵɵproperty","ctx_r2","itemTpl","ɵɵpureFunction1","_c1","item_r4","qe","Qe","PagedVirtualScrollerComponent_Defer_1_Conditional_0_Conditional_0_Conditional_6_ng_container_0_Template","emptyTpl","Be","B","ɵɵelementStart","ɵɵlistener","ɵɵrestoreView","_r1","vsScrollbar_r2","ɵɵreference","ɵɵnextContext","ɵɵresetView","updateScrollbar","$event","fetchMore","ɵɵrepeaterCreate","PagedVirtualScrollerComponent_Defer_1_Conditional_0_Conditional_0_For_5_Template","ɵɵcomponentInstance","trackByFn","PagedVirtualScrollerComponent_Defer_1_Conditional_0_Conditional_0_Conditional_6_Template","ɵɵelementEnd","v","horizontal","ɵɵadvance","ɵɵclassProp","isRendered","isEmpty","enterAnim","enableUnequalChildrenSizes","items","itemHeight","itemWidth","ɵɵrepeater","scroll_r5","viewPortItems","ɵɵconditional","$e","He","PagedVirtualScrollerComponent_Defer_1_Conditional_0_Conditional_1_For_5_ng_container_0_Template","item_r7","We","je","ɵɵelement","Ge","_r6","refreshVsMeasurements","updateContainer","PagedVirtualScrollerComponent_Defer_1_Conditional_0_Conditional_1_For_5_Template","PagedVirtualScrollerComponent_Defer_1_Conditional_0_Conditional_1_ng_container_6_Template","PagedVirtualScrollerComponent_Defer_1_Conditional_0_Conditional_1_Conditional_7_Template","n","parentScroll","scroll_r8","juiceLink_r9","scrollWithMainScrollbar","Ze","PagedVirtualScrollerComponent_Defer_1_Conditional_0_Conditional_0_Template","PagedVirtualScrollerComponent_Defer_1_Conditional_0_Conditional_1_Template","wrapInScrollbar","Ye","PagedVirtualScrollerComponent_Defer_1_Conditional_0_Template","enableVirtualScroll","Xe","Je","PagedVirtualScrollerComponent_DeferPlaceholder_2_Conditional_0_For_4_ng_container_0_Template","item_r10","Ke","et","PagedVirtualScrollerComponent_DeferPlaceholder_2_Conditional_0_For_4_Template","ɵɵrepeaterTrackByIndex","PagedVirtualScrollerComponent_DeferPlaceholder_2_Conditional_0_ng_container_5_Template","tt","PagedVirtualScrollerComponent_DeferPlaceholder_2_Conditional_0_Template","platform","isBrowser","scaleUpOnRender","it","ɵɵi18n","ɵɵpureFunction0","_c2","_c3","seoFriendly","offsetCursor","page","pageInfo","endCursor","rt","PagedVirtualScrollerComponent_ng_template_5_Conditional_0_Template","renderSeoLink","PageScrollerInfo","constructor","_currentPageNumber","_pageSize","_totalItems","currentPageNumber","pageSize","totalItems","totalPages","startIndex","endIndex","Math","ceil","isEOF","isBOF","h","PagedVirtualScrollerComponent","_a","itemsQuery","_itemsQuery","_remaining","query$","next","BehaviorSubject","visibleItems","_visibleItems","getVisibleItems","getRenderSeoLink","SEO_FRIENDLY_PAGE_SIZE","totalCount","hasNextPage","cd","scrollBarService","elementRef","fromServerService","activatedRoute","renderer","maxPending","seoFriendlyMaxDepth","renderOnInVisible","renderOnTimeOut","pageChanged","EventEmitter","signal","isLoading","needFetchMore","data","pendingItems","_pageChangePending","taskDone","afterRender$","Subject","afterCursor","pendingTasks","inject","ExperimentalPendingTasks","add","ngOnInit","mainScrollbar","viewport","nativeElement","pipe","delay","untilDestroyed","subscribe","vs","viewPortInfo","onVsUpdate","queryParams","params","offset","parseInt","isNaN","ngAfterViewInit","fromEvent","window","res","scrollBar","scrollTo","top","duration","attachDataSource","ngAfterViewChecked","onVsUpdateSubscription","ngOnDestroy","vsUpdate","tap","length","emit","filter","debounceTime","currentPageInfo","slice","detectChanges","scrollToIndex","isFromServer","itemSubscription","unsubscribe","variables","limit","spacerHeight","items$","valueChanges","loading","map","Object","keys","edges","pageNumber","currentPageSize","Error","edge","node","catchError","err","console","log","EMPTY","splice","set","concat","index","item","_id","scrollLength","setStyle","spacer","ev","max","first","selector","itemsPerRow","itemsPerCol","getContainedItems","viewportSelector","querySelector","itemsCt","children","firstChild","offsetHeight","w","offsetWidth","HTMLElement","viewportStyles","getComputedStyle","itemStyles","horizontalMargin","visibleItemsPerRow","floor","vertcalMargin","rowHeight","visibleItemsPerCol","previousPage","p","nextPage","min","dir","markForCheck","toState","invalidateAllCachedMeasurements","sb","initialized","update","ɵfac","ɵɵdirectiveInject","ChangeDetectorRef","ScrollBarService","ElementRef","FromServerService","Platform","ActivatedRoute","Renderer2","ɵcmp","ae","type","selectors","viewQuery","rf","ctx","V","ze","NgScrollbar","E","R","inputs","outputs","standalone","features","ge","decls","vars","consts","$localize","PagedVirtualScrollerComponent_Defer_1_Template","PagedVirtualScrollerComponent_DeferPlaceholder_2_Template","ɵɵdefer","PagedVirtualScrollerComponent_Defer_3_DepsFn","ɵɵdeferEnableTimerScheduling","pe","PagedVirtualScrollerComponent_ng_template_5_Template","ɵɵtemplateRefExtractor","dependencies","NgClass","RouterLink","styles","encapsulation","animation","trigger","transition","query","style","opacity","transform","stagger","animate","optional","changeDetection","__decorate","UntilDestroy","__metadata","L","a","De","b"],"ignoreList":[],"sources":["src/app/shared/components/paged-virtual-scroller/paged-virtual-scroller.component.ts","src/app/shared/components/paged-virtual-scroller/paged-virtual-scroller.component.html"],"sourcesContent":["import { ActivatedRoute, RouterLink } from '@angular/router';\r\nimport {\r\n Component,\r\n OnInit,\r\n ViewEncapsulation,\r\n ViewChild,\r\n ChangeDetectionStrategy,\r\n ChangeDetectorRef,\r\n Input,\r\n AfterViewInit,\r\n ElementRef,\r\n TemplateRef,\r\n Output,\r\n EventEmitter,\r\n AfterViewChecked,\r\n OnDestroy,\r\n Renderer2,\r\n signal,\r\n inject,\r\n ExperimentalPendingTasks,\r\n effect\r\n} from '@angular/core';\r\nimport { trigger, transition, style, animate, query, stagger } from '@angular/animations';\r\nimport { Observable, BehaviorSubject, Subscription, Subject, of, fromEvent, timeout, EMPTY } from 'rxjs';\r\nimport { filter, map, tap, debounceTime, delay, timeoutWith, catchError} from 'rxjs/operators';\r\nimport { NgScrollbar, NgScrollbarExt, AsyncDetection, ScrollViewport } from 'ngx-scrollbar';\r\nimport { ScrollBarService } from '@shared/scroll/scrollbar.service';\r\nimport { Platform } from '@angular/cdk/platform';\r\nimport { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';\r\nimport { QueryRef } from 'apollo-angular';\r\nimport { VirtualScrollerComponent, IPageInfo } from '@shared/components/ngx-virtual-scroller';\r\nimport { IPage } from '@collections/common/interfaces/page.interface';\r\nimport { FromServerService } from '@shared/services/from-server/from-server.service';\r\nimport { NgTemplateOutlet, NgClass, AsyncPipe } from '@angular/common';\r\nimport { VirtualScrollerComponent as VirtualScrollerComponent_1 } from '../ngx-virtual-scroller/index';\r\n\r\nexport class PageScrollerInfo {\r\n currentPageNumber = 0;\r\n pageSize = 0;\r\n totalItems = 0;\r\n totalPages = 0;\r\n startIndex = 0;\r\n endIndex = 0;\r\n\r\n constructor(_currentPageNumber: number, _pageSize: number, _totalItems: number) {\r\n this.currentPageNumber = _currentPageNumber;\r\n this.pageSize = _pageSize;\r\n this.totalItems = _totalItems;\r\n this.totalPages = Math.ceil(_totalItems / _pageSize);\r\n }\r\n\r\n get isEOF(): boolean {\r\n return this.currentPageNumber === this.totalPages;\r\n }\r\n\r\n get isBOF(): boolean {\r\n return this.currentPageNumber === 1;\r\n }\r\n}\r\n/**\r\n * dunque, sarebbe opportuno creare un virtual scroller per questa pagina, per la vista a blocchi, ma, al momento,\r\n * il virtual scroll di Material, che vorrei adottare al posto dell'ngx-virtual-scroll,\r\n * non supporta ancora il multi-column.\r\n * La feauture è nella road map, ma non c'è una data di rilascio.\r\n * https://github.com/angular/components/issues/10114\r\n * Per il momento lascio così. Vediamo gli sviluppi.\r\n */\r\n@UntilDestroy()\r\n@Component({\r\n selector: 'paged-virtual-scroller',\r\n templateUrl: './paged-virtual-scroller.component.html',\r\n styleUrls: ['./paged-virtual-scroller.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n animations: [\r\n trigger('listStagger', [\r\n transition('* => scaleUp', [\r\n query('.scrollable-content > .ct > *', [\r\n style({ opacity: 0, transform: 'scale(0.7)' }),\r\n stagger('70ms', animate('0.7s cubic-bezier(.8, -0.6, 0.2, 1.5)', style({ opacity: 1, transform: 'scale(1)' })))\r\n ], { optional: true })\r\n ])\r\n ])\r\n ],\r\n standalone: true,\r\n imports: [NgScrollbarExt, AsyncDetection, VirtualScrollerComponent_1, ScrollViewport, NgTemplateOutlet, NgClass, RouterLink, AsyncPipe]\r\n})\r\nexport class PagedVirtualScrollerComponent implements OnInit, AfterViewInit, AfterViewChecked, OnDestroy {\r\n\r\n @ViewChild(VirtualScrollerComponent, { static: false }) vs: VirtualScrollerComponent;\r\n @ViewChild('spacer', { static: false }) spacer: ElementRef;\r\n @ViewChild(NgScrollbar, { static: false }) scrollBar: NgScrollbar;\r\n mainScrollBar: NgScrollbar;\r\n\r\n @Input()\r\n get itemsQuery(): QueryRef {\r\n return this._itemsQuery;\r\n }\r\n set itemsQuery(v: QueryRef) {\r\n this._itemsQuery = v;\r\n this._remaining = [];\r\n if (!this.query$) {\r\n this.query$ = new BehaviorSubject>(v);\r\n } else {\r\n this.query$.next(v);\r\n }\r\n\r\n }\r\n private _itemsQuery: QueryRef;\r\n\r\n get visibleItems(): number {\r\n if (!this._visibleItems) {\r\n this._visibleItems = this.getVisibleItems();\r\n }\r\n return this._visibleItems;\r\n }\r\n set visibleItems(v: number) {\r\n this._visibleItems = v;\r\n }\r\n private _visibleItems: number;\r\n\r\n // non c'è ancora la possibilità di acccedere alle opzioni all'interno della queryRef\r\n // per cui, al momento, è necessario fornire il parametro a parte.\r\n // https://github.com/kamilkisiela/apollo-angular/issues/1324\r\n @Input() pageSize = 10;\r\n @Input() maxPending = 10;\r\n @Input() itemTpl: TemplateRef;\r\n @Input() scrollWithMainScrollbar = false;\r\n @Input() horizontal = false;\r\n @Input() scaleUpOnRender = false;\r\n @Input() enableVirtualScroll = true;\r\n @Input() wrapInScrollbar = false;\r\n @Input() seoFriendly: 'random-cursor' | 'offset-cursor';\r\n @Input() seoFriendlyMaxDepth: number = 20;\r\n @Input() itemWidth: number;\r\n @Input() itemHeight: number;\r\n @Input() parentScroll: HTMLElement;\r\n @Input() renderOnInVisible = false;\r\n @Input() renderOnTimeOut = -1;\r\n @Input() enableUnequalChildrenSizes = false;\r\n @Input() emptyTpl: TemplateRef;\r\n\r\n @Output() pageChanged: EventEmitter = new EventEmitter();\r\n\r\n seoFriendlyHasNextPage: boolean;\r\n items = signal(null);\r\n items$: Observable;\r\n itemSubscription: Subscription;\r\n\r\n isRendered = false;\r\n\r\n afterRender$: Subject;\r\n enterAnim: string;\r\n page: IPage;\r\n currentPageInfo: PageScrollerInfo;\r\n spacerHeight: number;\r\n\r\n isEmpty: boolean = false;\r\n\r\n private isLoading = signal(false);\r\n private needFetchMore = false;\r\n protected data: any[] = [];\r\n private pendingItems = [];\r\n private currentPageSize: number;\r\n private query$: BehaviorSubject>;\r\n private onVsUpdateSubscription: Subscription | null;\r\n private _remaining = [];\r\n private afterCursor: string;\r\n\r\n private readonly SEO_FRIENDLY_PAGE_SIZE = 20;\r\n\r\n offsetCursor: number;\r\n\r\n renderSeoLink = signal(false);\r\n\r\n getRenderSeoLink(): boolean {\r\n const { offsetCursor, SEO_FRIENDLY_PAGE_SIZE, page } = this;\r\n if (this.seoFriendly === 'offset-cursor') {\r\n return (page && (offsetCursor < page?.totalCount))/* &&\r\n (offsetCursor / this.SEO_FRIENDLY_PAGE_SIZE) < this.seoFriendlyMaxDepth; \r\n rimosso il limite a 20 pagine per la SEO*/\r\n } else {\r\n return page?.pageInfo.hasNextPage;\r\n }\r\n\r\n }\r\n\r\n private _pageChangePending = false;\r\n\r\n pendingTasks;\r\n taskDone = () => {};\r\n\r\n constructor(\r\n public cd: ChangeDetectorRef,\r\n private scrollBarService: ScrollBarService,\r\n public elementRef: ElementRef,\r\n private fromServerService: FromServerService,\r\n public platform: Platform,\r\n private activatedRoute: ActivatedRoute,\r\n private renderer: Renderer2\r\n ) {\r\n this.afterRender$ = new Subject();\r\n this.afterCursor = '';\r\n if(!this.platform.isBrowser) {\r\n this.pendingTasks = inject(ExperimentalPendingTasks);\r\n this.taskDone = this.pendingTasks.add();\r\n }\r\n }\r\n\r\n ngOnInit(): void {\r\n if (this.platform.isBrowser) {\r\n if (this.scrollWithMainScrollbar) {\r\n this.parentScroll = this.scrollBarService.mainScrollbar?.viewport.nativeElement;\r\n }\r\n\r\n this.afterRender$\r\n .pipe(\r\n delay(10),\r\n untilDestroyed(this)\r\n )\r\n .subscribe(() => this.fetchMore(this.vs.viewPortInfo)); // esegue il fetchMore, se necessario, dopo il render.\r\n\r\n if (this.enableVirtualScroll) {\r\n // first render\r\n this.onVsUpdate();\r\n }\r\n } \r\n\r\n if (this.seoFriendly) {\r\n this.activatedRoute.queryParams\r\n .subscribe(params => {\r\n this.afterCursor = params['after'];\r\n const offset = parseInt(this.afterCursor, 10);\r\n this.offsetCursor = !isNaN(offset) ? offset + this.SEO_FRIENDLY_PAGE_SIZE : this.SEO_FRIENDLY_PAGE_SIZE;\r\n });\r\n }\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n if (this.platform.isBrowser && this.enableVirtualScroll) {\r\n fromEvent(window, 'resize')\r\n .pipe(\r\n untilDestroyed(this)\r\n )\r\n .subscribe(() => this.visibleItems = 0);\r\n }\r\n\r\n this.query$\r\n .pipe(\r\n untilDestroyed(this)\r\n )\r\n .subscribe((res) => {\r\n this.scrollBar?.scrollTo({ top: 0, duration: 0 });\r\n this.attachDataSource();\r\n });\r\n }\r\n\r\n ngAfterViewChecked(): void {\r\n if (this.platform.isBrowser && this.enableVirtualScroll && !this.onVsUpdateSubscription) {\r\n this.onVsUpdate();\r\n }\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.data = [];\r\n this.onVsUpdateSubscription = null;\r\n }\r\n\r\n private onVsUpdate(): void {\r\n if (!this.vs) {\r\n return;\r\n }\r\n\r\n this.onVsUpdateSubscription = this.vs.vsUpdate\r\n .pipe(\r\n tap((data: any[]) => {\r\n if (data.length === 0) {\r\n this.pageChanged.emit(new PageScrollerInfo(0, 0, 0));\r\n }\r\n }),\r\n filter((data: any[]) => data.length > 0),\r\n this.scaleUpOnRender ? debounceTime(100) : debounceTime(0), // Da sistemare. Così non è l'ideale. Bisogna riprogettare con signal.\r\n untilDestroyed(this)\r\n ).subscribe(data => {\r\n const startIndex = this.vs.viewPortInfo.startIndex;\r\n const endIndex = this.vs.viewPortInfo.endIndex;\r\n if (this.currentPageInfo) {\r\n this.currentPageInfo.startIndex = startIndex;\r\n this.currentPageInfo.endIndex = endIndex;\r\n this.currentPageInfo.totalItems = this.page.totalCount;\r\n this.pageChanged.emit(this.currentPageInfo);\r\n }\r\n if (this._pageChangePending) {\r\n this.vs.viewPortItems = this.data.slice(startIndex, endIndex + 2);\r\n this._pageChangePending = false;\r\n this.cd.detectChanges();\r\n this.scrollToIndex(this.vs.viewPortInfo.endIndex + 1, 'forward');\r\n }\r\n if (!this.isRendered) {\r\n this.isRendered = true;\r\n // esegue animazione solo se la pagina non viene caricata direttamente dal server\r\n if (!this.fromServerService.isFromServer && this.scaleUpOnRender) {\r\n this.enterAnim = 'scaleUp';\r\n } else {\r\n this.afterRender$.next(true);\r\n }\r\n this.cd.detectChanges();\r\n }\r\n });\r\n }\r\n\r\n private attachDataSource(): void {\r\n if (this.itemSubscription) {\r\n this.itemSubscription.unsubscribe();\r\n }\r\n this.isRendered = false;\r\n this.enterAnim = '';\r\n\r\n if (!this.platform.isBrowser && this.seoFriendly && this.afterCursor) {\r\n this.itemsQuery.variables.limit = this.SEO_FRIENDLY_PAGE_SIZE;\r\n this.itemsQuery.variables.after = this.afterCursor;\r\n }\r\n\r\n this.spacerHeight = 0;\r\n\r\n this.items$ = this.itemsQuery\r\n .valueChanges\r\n .pipe(\r\n filter((res) => !res.loading || res.data),\r\n map(res => res.data ? res.data[Object.keys(res.data)[0]] : null),\r\n tap((page: IPage) => {\r\n if(page) {\r\n this.page = page;\r\n if (page.edges.length < (this.pageSize + 1)) { //first page\r\n // this._remaining = [];\r\n this.spacerHeight = 0;\r\n }\r\n const pageNumber = this.currentPageInfo?.currentPageNumber > 0 ? this.currentPageInfo.currentPageNumber : 1;\r\n this.currentPageInfo = new PageScrollerInfo(pageNumber, this.pageSize, this.page.totalCount);\r\n this.currentPageSize = page.edges.length;\r\n this.renderSeoLink()\r\n this.pageChanged.emit(this.currentPageInfo);\r\n } else {\r\n throw(new Error('No data found'));\r\n }\r\n }),\r\n map((page) => page?.edges.map(edge => edge.node)),\r\n catchError((err) => {\r\n if(!this.platform.isBrowser) {\r\n this.taskDone();\r\n }\r\n console.log(err)\r\n return EMPTY;\r\n })\r\n );\r\n\r\n this.itemSubscription = this.items$\r\n .pipe(\r\n untilDestroyed(this)\r\n )\r\n .subscribe(items => {\r\n this.isEmpty = items.length === 0;\r\n this.data = items;\r\n this.pendingItems.splice(0, this.currentPageSize);\r\n // this._remaining?.splice(0, this.currentPageSize);\r\n if (this.pendingItems.length < this.maxPending) {\r\n this.isLoading.set(false);\r\n } else {\r\n this.isLoading.set(true);\r\n }\r\n this.items.set(items.concat(this._remaining));\r\n this.renderSeoLink.set(this.getRenderSeoLink());\r\n if(!this.platform.isBrowser) {\r\n this.taskDone();\r\n }\r\n });\r\n }\r\n\r\n trackByFn(index, item): string {\r\n if (!item?._id)\r\n return index; \r\n return item._id;\r\n }\r\n\r\n updateContainer(scrollLength: any): void {\r\n if (this.scrollWithMainScrollbar) {\r\n this.renderer.setStyle(this.spacer.nativeElement, 'height', `${scrollLength}px`);\r\n }\r\n }\r\n\r\n fetchMore(ev: IPageInfo): void {\r\n if (this.pageSize === 1 || !this.isRendered || this.pendingItems.length > this.maxPending) {\r\n return;\r\n }\r\n\r\n if (ev.endIndex >= this.data.length + this.pendingItems.length - 1 && this.page?.pageInfo.hasNextPage || this.needFetchMore) {\r\n let pageSize = this.pageSize;\r\n // const remaining = this.page.totalCount - this.data.length - this.pendingItems.length;\r\n\r\n // if (remaining > 0) {\r\n // pageSize = pageSize > remaining ? remaining : pageSize;\r\n // this.pendingItems = this.pendingItems.concat(Array.from({ length: pageSize }));\r\n // if (this._remaining.length === 0) {\r\n // this._remaining = Array.from({ length: this.page.totalCount - this.data.length});\r\n // this.items.set(this.data.concat(this._remaining));\r\n // }\r\n\r\n // }\r\n\r\n if (this.isLoading()) {\r\n this.needFetchMore = true;\r\n return;\r\n }\r\n this.needFetchMore = false;\r\n if(!this.page.pageInfo.hasNextPage) {\r\n return;\r\n }\r\n this.isLoading.set(true);\r\n \r\n this.currentPageSize = Math.max(this.pageSize, this.pendingItems.length);\r\n this.itemsQuery.fetchMore({\r\n variables: {\r\n first: this.currentPageSize,\r\n after: this.page.pageInfo.endCursor\r\n }\r\n });\r\n }\r\n }\r\n\r\n getVisibleItems(): number {\r\n const selector = '.scrollable-content';\r\n const {itemsPerRow, itemsPerCol} = this.getContainedItems(selector);\r\n\r\n return itemsPerRow ? itemsPerRow * itemsPerCol : 0;\r\n }\r\n\r\n private getContainedItems(viewportSelector: string): { itemsPerRow: number, itemsPerCol: number, rowHeight: number } {\r\n const viewport = this.elementRef.nativeElement.querySelector(viewportSelector);\r\n const itemsCt = this.scrollWithMainScrollbar ? viewport.children : viewport.firstChild?.children;\r\n if (itemsCt?.length > 0) {\r\n const h = viewport.offsetHeight;\r\n const w = viewport.offsetWidth;\r\n const item = itemsCt[0];\r\n if (item) {\r\n if (item instanceof HTMLElement) {\r\n const viewportStyles = getComputedStyle(viewport);\r\n const itemStyles = getComputedStyle(item);\r\n\r\n const horizontalMargin = parseInt(viewportStyles['margin-left'], 10) || 0 +\r\n parseInt(viewportStyles['margin-right'], 10) || 0 + parseInt(viewportStyles['column-gap'], 10) || 0;\r\n const visibleItemsPerRow = Math.floor((w + horizontalMargin) / (item.offsetWidth + horizontalMargin));\r\n const vertcalMargin = parseInt(itemStyles['margin-bottom'], 10) || 0 + parseInt(itemStyles['margin-top'], 10) || 0 + parseInt(viewportStyles['row-gap'], 10) || 0;\r\n const rowHeight = item.offsetHeight + vertcalMargin;\r\n const visibleItemsPerCol = h > 0 ? Math.floor((h + vertcalMargin) / rowHeight): 0;\r\n\r\n return { itemsPerRow: visibleItemsPerRow, itemsPerCol: visibleItemsPerCol, rowHeight: rowHeight };\r\n } else {\r\n throw new Error('PVS: Uncompatible item found!');\r\n }\r\n }\r\n }\r\n\r\n return { itemsPerRow: 0, itemsPerCol: 0, rowHeight: 0 };\r\n }\r\n\r\n previousPage(): void {\r\n const p = this.currentPageInfo;\r\n this.scrollToIndex((p.currentPageNumber - 2) * this.visibleItems, 'back');\r\n }\r\n\r\n nextPage(): void {\r\n const p = this.currentPageInfo;\r\n if (this.pageSize === 1 && this.vs.viewPortInfo.endIndex === (this.data.length + this.pendingItems.length - 1)) {\r\n this._pageChangePending = true;\r\n\r\n this.itemsQuery.fetchMore({\r\n variables: {\r\n first: 1,\r\n after: this.page.pageInfo.endCursor\r\n }\r\n });\r\n } else {\r\n const index = Math.min((p.currentPageNumber * this.visibleItems), (this.page.totalCount - 1));\r\n this.scrollToIndex(index, 'forward');\r\n }\r\n\r\n }\r\n\r\n scrollToIndex(index: number, dir: 'back' | 'forward'): void {\r\n this.vs?.scrollToIndex(index, true, 0, 500, () => {\r\n this.currentPageInfo.currentPageNumber += dir === 'forward' ? +1 : -1;\r\n this.pageChanged.emit(this.currentPageInfo);\r\n this.cd.markForCheck();\r\n });\r\n }\r\n refreshVsMeasurements(ev): void {\r\n if (ev.toState === 'scaleUp') {\r\n this.vs.invalidateAllCachedMeasurements();\r\n this.afterRender$.next(true);\r\n }\r\n }\r\n\r\n updateScrollbar(sb: NgScrollbarExt): void {\r\n if(sb.viewport.initialized()) {\r\n sb.update();\r\n }\r\n }\r\n}\r\n","
\r\n @defer() {\r\n @if (enableVirtualScroll) {\r\n \r\n @if (wrapInScrollbar) {\r\n \r\n \r\n @for (item of scroll.viewPortItems; track trackByFn($index, item)) {\r\n \r\n \r\n }\r\n @if (isEmpty && emptyTpl) {\r\n \r\n }\r\n \r\n \r\n } @else {\r\n \r\n
\r\n @for (item of scroll.viewPortItems; track trackByFn($index, item)) {\r\n \r\n \r\n }\r\n \r\n
\r\n \r\n @if (scrollWithMainScrollbar) {\r\n
\r\n }\r\n }\r\n \r\n }\r\n } @placeholder(minimum 500ms) {\r\n @if(!platform.isBrowser || !scaleUpOnRender) {\r\n
\r\n
\r\n @for (item of items(); track $index) {\r\n \r\n }\r\n \r\n
\r\n
\r\n }\r\n \r\n }\r\n \r\n \r\n @if (seoFriendly && renderSeoLink()) {\r\n Next\r\n }\r\n \r\n
\r\n\r\n"]}