Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ng-table-virtual-scroll

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng-table-virtual-scroll - npm Package Compare versions

Comparing version 1.3.6 to 1.3.7

90

bundles/ng-table-virtual-scroll.umd.js

@@ -233,6 +233,12 @@ (function (global, factory) {

}
function __spreadArray(to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
function __spreadArray(to, from, pack) {
if (pack || arguments.length === 2)
for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar)
ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || from);
}

@@ -303,14 +309,17 @@ function __await(v) {

}
function __classPrivateFieldGet(receiver, privateMap) {
if (!privateMap.has(receiver)) {
throw new TypeError("attempted to get private field on non-instance");
}
return privateMap.get(receiver);
function __classPrivateFieldGet(receiver, state, kind, f) {
if (kind === "a" && !f)
throw new TypeError("Private accessor was defined without a getter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
throw new TypeError("Cannot read private member from an object whose class did not declare it");
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
}
function __classPrivateFieldSet(receiver, privateMap, value) {
if (!privateMap.has(receiver)) {
throw new TypeError("attempted to set private field on non-instance");
}
privateMap.set(receiver, value);
return value;
function __classPrivateFieldSet(receiver, state, value, kind, f) {
if (kind === "m")
throw new TypeError("Private method is not writable");
if (kind === "a" && !f)
throw new TypeError("Private accessor was defined without a setter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
throw new TypeError("Cannot write private member to an object whose class did not declare it");
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
}

@@ -408,3 +417,2 @@

FixedSizeTableVirtualScrollStrategy.prototype.onContentRendered = function () {
// no-op
};

@@ -438,15 +446,36 @@ FixedSizeTableVirtualScrollStrategy.prototype.onRenderedOffsetChanged = function () {

}
var renderedOffset = this.viewport.getOffsetToRenderedContentStart();
var start = renderedOffset / this.rowHeight;
var itemsDisplayed = Math.ceil(this.viewport.getViewportSize() / this.rowHeight);
var bufferItems = Math.ceil(itemsDisplayed * this.bufferMultiplier);
var end = start + itemsDisplayed + 2 * bufferItems;
var bufferOffset = renderedOffset + bufferItems * this.rowHeight;
var scrollOffset = this.viewport.measureScrollOffset();
var amount = Math.ceil(this.viewport.getViewportSize() / this.rowHeight);
var offset = Math.max(scrollOffset - this.headerHeight, 0);
var buffer = Math.ceil(amount * this.bufferMultiplier);
var skip = Math.round(offset / this.rowHeight);
var index = Math.max(0, skip);
var start = Math.max(0, index - buffer);
var end = Math.min(this.dataLength, index + amount + buffer);
var renderedOffset = start * this.rowHeight;
this.viewport.setRenderedContentOffset(renderedOffset);
this.viewport.setRenderedRange({ start: start, end: end });
this.indexChange.next(index);
this.stickyChange.next(renderedOffset);
// How far the scroll offset is from the lower buffer, which is usually where items start being displayed
var relativeScrollOffset = scrollOffset - bufferOffset;
var rowsScrolled = relativeScrollOffset / this.rowHeight;
var displayed = scrollOffset / this.rowHeight;
this.indexChange.next(displayed);
// Only bother updating the displayed information if we've scrolled more than a row
var rowSensitivity = 1.0;
if (Math.abs(rowsScrolled) < rowSensitivity) {
this.viewport.setRenderedContentOffset(renderedOffset);
this.viewport.setRenderedRange({ start: start, end: end });
return;
}
// Special case for the start of the table.
// At the top of the table, the first few rows are first rendered because they're visible, and then still rendered
// Because they move into the buffer. So we only need to change what's rendered once the user scrolls far enough down.
if (renderedOffset === 0 && rowsScrolled < 0) {
this.viewport.setRenderedContentOffset(renderedOffset);
this.viewport.setRenderedRange({ start: start, end: end });
return;
}
var rowsToMove = Math.sign(rowsScrolled) * Math.floor(Math.abs(rowsScrolled));
var adjustedRenderedOffset = Math.max(0, renderedOffset + rowsToMove * this.rowHeight);
this.viewport.setRenderedContentOffset(adjustedRenderedOffset);
var adjustedStart = Math.max(0, start + rowsToMove);
var adjustedEnd = adjustedStart + itemsDisplayed + 2 * bufferItems;
this.viewport.setRenderedRange({ start: adjustedStart, end: adjustedEnd });
this.stickyChange.next(adjustedRenderedOffset);
};

@@ -505,3 +534,6 @@ return FixedSizeTableVirtualScrollStrategy;

this.scrollStrategy.stickyChange
.pipe(operators.filter(function () { return _this.isStickyEnabled(); }), operators.delayWhen(function () { return !_this.stickyPositions ? rxjs.timer(0) : rxjs.of(); }), operators.tap(function () {
.pipe(operators.filter(function () { return _this.isStickyEnabled(); }),
// breaks sticky header on the top. needs investigation
// delayWhen(() => !this.stickyPositions ? timer(0) : of()),
operators.tap(function () {
if (!_this.stickyPositions) {

@@ -508,0 +540,0 @@ _this.initStickyPositions();

@@ -15,3 +15,3 @@ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/cdk/scrolling"),require("rxjs/operators"),require("rxjs"),require("@angular/material/table")):"function"==typeof define&&define.amd?define("ng-table-virtual-scroll",["exports","@angular/core","@angular/cdk/scrolling","rxjs/operators","rxjs","@angular/material/table"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["ng-table-virtual-scroll"]={},t.ng.core,t.ng.cdk.scrolling,t.rxjs.operators,t.rxjs,t.ng.material.table)}(this,(function(t,e,r,i,n,o){"use strict";

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)};Object.create;function s(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,o=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return a}Object.create;var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype._updateChangeSubscription=function(){var t,e=this;this.initStreams();var r=this._sort,o=this._paginator,a=this._internalPageChanges,h=this._filter,c=this._renderData,l=r?n.merge(r.sortChange,r.initialized):n.of(null),u=o?n.merge(o.page,a,o.initialized):n.of(null),p=this._data,f=n.combineLatest([p,h]).pipe(i.map((function(t){var r=s(t,1)[0];return e._filterData(r)}))),d=n.combineLatest([f,l]).pipe(i.map((function(t){var r=s(t,1)[0];return e._orderData(r)}))),g=n.combineLatest([d,u]).pipe(i.map((function(t){var r=s(t,1)[0];return e._pageData(r)})));null===(t=this._renderChangesSubscription)||void 0===t||t.unsubscribe(),this._renderChangesSubscription=new n.Subscription,this._renderChangesSubscription.add(g.subscribe((function(t){return e.dataToRender$.next(t)}))),this._renderChangesSubscription.add(this.dataOfRange$.subscribe((function(t){return c.next(t)})))},e.prototype.initStreams=function(){this.streamsReady||(this.dataToRender$=new n.ReplaySubject(1),this.dataOfRange$=new n.ReplaySubject(1),this.streamsReady=!0)},e}(o.MatTableDataSource),c=function(){function t(){this.indexChange=new n.Subject,this.stickyChange=new n.Subject,this.renderedRangeStream=new n.BehaviorSubject({start:0,end:0}),this.scrolledIndexChange=this.indexChange.pipe(i.distinctUntilChanged()),this._dataLength=0}return Object.defineProperty(t.prototype,"dataLength",{get:function(){return this._dataLength},set:function(t){this._dataLength=t,this.onDataLengthChanged()},enumerable:!1,configurable:!0}),t.prototype.attach=function(t){this.viewport=t,this.viewport.renderedRangeStream.subscribe(this.renderedRangeStream),this.onDataLengthChanged()},t.prototype.detach=function(){this.indexChange.complete(),this.stickyChange.complete(),this.renderedRangeStream.complete()},t.prototype.onContentScrolled=function(){this.updateContent()},t.prototype.onDataLengthChanged=function(){this.viewport&&this.viewport.setTotalContentSize(this.dataLength*this.rowHeight+this.headerHeight+this.footerHeight),this.updateContent()},t.prototype.onContentRendered=function(){},t.prototype.onRenderedOffsetChanged=function(){},t.prototype.scrollToIndex=function(t,e){this.viewport&&this.rowHeight&&this.viewport.scrollToOffset((t-1)*this.rowHeight+this.headerHeight,e)},t.prototype.setConfig=function(t){var e=t.rowHeight,r=t.headerHeight,i=t.footerHeight,n=t.bufferMultiplier;this.rowHeight===e&&this.headerHeight===r&&this.footerHeight===i&&this.bufferMultiplier===n||(this.rowHeight=e,this.headerHeight=r,this.footerHeight=i,this.bufferMultiplier=n,this.onDataLengthChanged())},t.prototype.updateContent=function(){if(this.viewport&&this.rowHeight){var t=this.viewport.measureScrollOffset(),e=Math.ceil(this.viewport.getViewportSize()/this.rowHeight),r=Math.max(t-this.headerHeight,0),i=Math.ceil(e*this.bufferMultiplier),n=Math.round(r/this.rowHeight),o=Math.max(0,n),a=Math.max(0,o-i),s=Math.min(this.dataLength,o+e+i),h=a*this.rowHeight;this.viewport.setRenderedContentOffset(h),this.viewport.setRenderedRange({start:a,end:s}),this.indexChange.next(o),this.stickyChange.next(h)}},t}();function l(t){return t.scrollStrategy}c.decorators=[{type:e.Injectable}];var u=".mat-header-row .mat-table-sticky",p=48,f=56,d=!0,g=48,y=!1,b=.7,S=function(){function t(t){this.zone=t,this.destroyed$=new n.Subject,this.rowHeight=p,this.headerEnabled=d,this.headerHeight=f,this.footerEnabled=y,this.footerHeight=g,this.bufferMultiplier=b,this.scrollStrategy=new c,this.dataSourceChanges=new n.Subject}return t.prototype.ngOnDestroy=function(){this.destroyed$.next(),this.destroyed$.complete(),this.dataSourceChanges.complete()},t.prototype.isStickyEnabled=function(){return!!this.scrollStrategy.viewport&&this.table._headerRowDefs.map((function(t){return t.sticky})).reduce((function(t,e){return t&&e}),!0)},t.prototype.ngAfterContentInit=function(){var t=this,e=this.table._switchDataSource;this.table._switchDataSource=function(r){e.call(t.table,r),t.connectDataSource(r)},this.connectDataSource(this.table.dataSource),this.scrollStrategy.stickyChange.pipe(i.filter((function(){return t.isStickyEnabled()})),i.delayWhen((function(){return t.stickyPositions?n.of():n.timer(0)})),i.tap((function(){t.stickyPositions||t.initStickyPositions()})),i.takeUntil(this.destroyed$)).subscribe((function(e){t.setSticky(e)}))},t.prototype.connectDataSource=function(t){var e=this;if(this.dataSourceChanges.next(),!(t instanceof h))throw new Error("[tvsItemSize] requires TableVirtualScrollDataSource be set as [dataSource] of [mat-table]");t.dataToRender$.pipe(i.distinctUntilChanged(),i.takeUntil(this.dataSourceChanges),i.takeUntil(this.destroyed$),i.tap((function(t){return e.scrollStrategy.dataLength=t.length})),i.switchMap((function(t){return e.scrollStrategy.renderedRangeStream.pipe(i.map((function(e){var r=e.start,i=e.end;return"number"!=typeof r||"number"!=typeof i?t:t.slice(r,i)})))}))).subscribe((function(r){e.zone.run((function(){t.dataOfRange$.next(r)}))}))},t.prototype.ngOnChanges=function(){var t={rowHeight:+this.rowHeight||p,headerHeight:this.headerEnabled?+this.headerHeight||f:0,footerHeight:this.footerEnabled?+this.footerHeight||g:0,bufferMultiplier:+this.bufferMultiplier||b};this.scrollStrategy.setConfig(t)},t.prototype.setSticky=function(t){var e=this;this.scrollStrategy.viewport.elementRef.nativeElement.querySelectorAll(u).forEach((function(r){var i=r.parentElement,n=0;e.stickyPositions.has(i)&&(n=e.stickyPositions.get(i)),r.style.top=n-t+"px"})),this.scrollStrategy.viewport.elementRef.nativeElement.querySelectorAll(".mat-footer-row .mat-table-sticky").forEach((function(r){var i=r.parentElement,n=0;e.stickyPositions.has(i)&&(n=e.stickyPositions.get(i)),r.style.bottom=-n+t+"px"}))},t.prototype.initStickyPositions=function(){var t=this;this.stickyPositions=new Map,this.scrollStrategy.viewport.elementRef.nativeElement.querySelectorAll(u).forEach((function(e){var r=e.parentElement;t.stickyPositions.has(r)||t.stickyPositions.set(r,r.offsetTop)}))},t}();S.decorators=[{type:e.Directive,args:[{selector:"cdk-virtual-scroll-viewport[tvsItemSize]",providers:[{provide:r.VIRTUAL_SCROLL_STRATEGY,useFactory:l,deps:[e.forwardRef((function(){return S}))]}]}]}],S.ctorParameters=function(){return[{type:e.NgZone}]},S.propDecorators={rowHeight:[{type:e.Input,args:["tvsItemSize"]}],headerEnabled:[{type:e.Input}],headerHeight:[{type:e.Input}],footerEnabled:[{type:e.Input}],footerHeight:[{type:e.Input}],bufferMultiplier:[{type:e.Input}],table:[{type:e.ContentChild,args:[o.MatTable,{static:!1}]}]};var m=function(){};m.decorators=[{type:e.NgModule,args:[{declarations:[S],imports:[],exports:[S]}]}],t.FixedSizeTableVirtualScrollStrategy=c,t.TableItemSizeDirective=S,t.TableVirtualScrollDataSource=h,t.TableVirtualScrollModule=m,t._tableVirtualScrollDirectiveStrategyFactory=l,Object.defineProperty(t,"__esModule",{value:!0})}));
***************************************************************************** */var a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)};Object.create;function s(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,o=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return a}Object.create;var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype._updateChangeSubscription=function(){var t,e=this;this.initStreams();var r=this._sort,o=this._paginator,a=this._internalPageChanges,h=this._filter,c=this._renderData,l=r?n.merge(r.sortChange,r.initialized):n.of(null),u=o?n.merge(o.page,a,o.initialized):n.of(null),p=this._data,d=n.combineLatest([p,h]).pipe(i.map((function(t){var r=s(t,1)[0];return e._filterData(r)}))),f=n.combineLatest([d,l]).pipe(i.map((function(t){var r=s(t,1)[0];return e._orderData(r)}))),g=n.combineLatest([f,u]).pipe(i.map((function(t){var r=s(t,1)[0];return e._pageData(r)})));null===(t=this._renderChangesSubscription)||void 0===t||t.unsubscribe(),this._renderChangesSubscription=new n.Subscription,this._renderChangesSubscription.add(g.subscribe((function(t){return e.dataToRender$.next(t)}))),this._renderChangesSubscription.add(this.dataOfRange$.subscribe((function(t){return c.next(t)})))},e.prototype.initStreams=function(){this.streamsReady||(this.dataToRender$=new n.ReplaySubject(1),this.dataOfRange$=new n.ReplaySubject(1),this.streamsReady=!0)},e}(o.MatTableDataSource),c=function(){function t(){this.indexChange=new n.Subject,this.stickyChange=new n.Subject,this.renderedRangeStream=new n.BehaviorSubject({start:0,end:0}),this.scrolledIndexChange=this.indexChange.pipe(i.distinctUntilChanged()),this._dataLength=0}return Object.defineProperty(t.prototype,"dataLength",{get:function(){return this._dataLength},set:function(t){this._dataLength=t,this.onDataLengthChanged()},enumerable:!1,configurable:!0}),t.prototype.attach=function(t){this.viewport=t,this.viewport.renderedRangeStream.subscribe(this.renderedRangeStream),this.onDataLengthChanged()},t.prototype.detach=function(){this.indexChange.complete(),this.stickyChange.complete(),this.renderedRangeStream.complete()},t.prototype.onContentScrolled=function(){this.updateContent()},t.prototype.onDataLengthChanged=function(){this.viewport&&this.viewport.setTotalContentSize(this.dataLength*this.rowHeight+this.headerHeight+this.footerHeight),this.updateContent()},t.prototype.onContentRendered=function(){},t.prototype.onRenderedOffsetChanged=function(){},t.prototype.scrollToIndex=function(t,e){this.viewport&&this.rowHeight&&this.viewport.scrollToOffset((t-1)*this.rowHeight+this.headerHeight,e)},t.prototype.setConfig=function(t){var e=t.rowHeight,r=t.headerHeight,i=t.footerHeight,n=t.bufferMultiplier;this.rowHeight===e&&this.headerHeight===r&&this.footerHeight===i&&this.bufferMultiplier===n||(this.rowHeight=e,this.headerHeight=r,this.footerHeight=i,this.bufferMultiplier=n,this.onDataLengthChanged())},t.prototype.updateContent=function(){if(this.viewport&&this.rowHeight){var t=this.viewport.getOffsetToRenderedContentStart(),e=t/this.rowHeight,r=Math.ceil(this.viewport.getViewportSize()/this.rowHeight),i=Math.ceil(r*this.bufferMultiplier),n=e+r+2*i,o=t+i*this.rowHeight,a=this.viewport.measureScrollOffset(),s=(a-o)/this.rowHeight,h=a/this.rowHeight;this.indexChange.next(h);if(Math.abs(s)<1)return this.viewport.setRenderedContentOffset(t),void this.viewport.setRenderedRange({start:e,end:n});if(0===t&&s<0)return this.viewport.setRenderedContentOffset(t),void this.viewport.setRenderedRange({start:e,end:n});var c=Math.sign(s)*Math.floor(Math.abs(s)),l=Math.max(0,t+c*this.rowHeight);this.viewport.setRenderedContentOffset(l);var u=Math.max(0,e+c),p=u+r+2*i;this.viewport.setRenderedRange({start:u,end:p}),this.stickyChange.next(l)}},t}();function l(t){return t.scrollStrategy}c.decorators=[{type:e.Injectable}];var u=".mat-header-row .mat-table-sticky",p=48,d=56,f=!0,g=48,y=!1,b=.7,S=function(){function t(t){this.zone=t,this.destroyed$=new n.Subject,this.rowHeight=p,this.headerEnabled=f,this.headerHeight=d,this.footerEnabled=y,this.footerHeight=g,this.bufferMultiplier=b,this.scrollStrategy=new c,this.dataSourceChanges=new n.Subject}return t.prototype.ngOnDestroy=function(){this.destroyed$.next(),this.destroyed$.complete(),this.dataSourceChanges.complete()},t.prototype.isStickyEnabled=function(){return!!this.scrollStrategy.viewport&&this.table._headerRowDefs.map((function(t){return t.sticky})).reduce((function(t,e){return t&&e}),!0)},t.prototype.ngAfterContentInit=function(){var t=this,e=this.table._switchDataSource;this.table._switchDataSource=function(r){e.call(t.table,r),t.connectDataSource(r)},this.connectDataSource(this.table.dataSource),this.scrollStrategy.stickyChange.pipe(i.filter((function(){return t.isStickyEnabled()})),i.tap((function(){t.stickyPositions||t.initStickyPositions()})),i.takeUntil(this.destroyed$)).subscribe((function(e){t.setSticky(e)}))},t.prototype.connectDataSource=function(t){var e=this;if(this.dataSourceChanges.next(),!(t instanceof h))throw new Error("[tvsItemSize] requires TableVirtualScrollDataSource be set as [dataSource] of [mat-table]");t.dataToRender$.pipe(i.distinctUntilChanged(),i.takeUntil(this.dataSourceChanges),i.takeUntil(this.destroyed$),i.tap((function(t){return e.scrollStrategy.dataLength=t.length})),i.switchMap((function(t){return e.scrollStrategy.renderedRangeStream.pipe(i.map((function(e){var r=e.start,i=e.end;return"number"!=typeof r||"number"!=typeof i?t:t.slice(r,i)})))}))).subscribe((function(r){e.zone.run((function(){t.dataOfRange$.next(r)}))}))},t.prototype.ngOnChanges=function(){var t={rowHeight:+this.rowHeight||p,headerHeight:this.headerEnabled?+this.headerHeight||d:0,footerHeight:this.footerEnabled?+this.footerHeight||g:0,bufferMultiplier:+this.bufferMultiplier||b};this.scrollStrategy.setConfig(t)},t.prototype.setSticky=function(t){var e=this;this.scrollStrategy.viewport.elementRef.nativeElement.querySelectorAll(u).forEach((function(r){var i=r.parentElement,n=0;e.stickyPositions.has(i)&&(n=e.stickyPositions.get(i)),r.style.top=n-t+"px"})),this.scrollStrategy.viewport.elementRef.nativeElement.querySelectorAll(".mat-footer-row .mat-table-sticky").forEach((function(r){var i=r.parentElement,n=0;e.stickyPositions.has(i)&&(n=e.stickyPositions.get(i)),r.style.bottom=-n+t+"px"}))},t.prototype.initStickyPositions=function(){var t=this;this.stickyPositions=new Map,this.scrollStrategy.viewport.elementRef.nativeElement.querySelectorAll(u).forEach((function(e){var r=e.parentElement;t.stickyPositions.has(r)||t.stickyPositions.set(r,r.offsetTop)}))},t}();S.decorators=[{type:e.Directive,args:[{selector:"cdk-virtual-scroll-viewport[tvsItemSize]",providers:[{provide:r.VIRTUAL_SCROLL_STRATEGY,useFactory:l,deps:[e.forwardRef((function(){return S}))]}]}]}],S.ctorParameters=function(){return[{type:e.NgZone}]},S.propDecorators={rowHeight:[{type:e.Input,args:["tvsItemSize"]}],headerEnabled:[{type:e.Input}],headerHeight:[{type:e.Input}],footerEnabled:[{type:e.Input}],footerHeight:[{type:e.Input}],bufferMultiplier:[{type:e.Input}],table:[{type:e.ContentChild,args:[o.MatTable,{static:!1}]}]};var v=function(){};v.decorators=[{type:e.NgModule,args:[{declarations:[S],imports:[],exports:[S]}]}],t.FixedSizeTableVirtualScrollStrategy=c,t.TableItemSizeDirective=S,t.TableVirtualScrollDataSource=h,t.TableVirtualScrollModule=v,t._tableVirtualScrollDirectiveStrategyFactory=l,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=ng-table-virtual-scroll.umd.min.js.map

@@ -39,3 +39,2 @@ import { Injectable } from '@angular/core';

onContentRendered() {
// no-op
}

@@ -69,15 +68,36 @@ onRenderedOffsetChanged() {

}
const renderedOffset = this.viewport.getOffsetToRenderedContentStart();
const start = renderedOffset / this.rowHeight;
const itemsDisplayed = Math.ceil(this.viewport.getViewportSize() / this.rowHeight);
const bufferItems = Math.ceil(itemsDisplayed * this.bufferMultiplier);
const end = start + itemsDisplayed + 2 * bufferItems;
const bufferOffset = renderedOffset + bufferItems * this.rowHeight;
const scrollOffset = this.viewport.measureScrollOffset();
const amount = Math.ceil(this.viewport.getViewportSize() / this.rowHeight);
const offset = Math.max(scrollOffset - this.headerHeight, 0);
const buffer = Math.ceil(amount * this.bufferMultiplier);
const skip = Math.round(offset / this.rowHeight);
const index = Math.max(0, skip);
const start = Math.max(0, index - buffer);
const end = Math.min(this.dataLength, index + amount + buffer);
const renderedOffset = start * this.rowHeight;
this.viewport.setRenderedContentOffset(renderedOffset);
this.viewport.setRenderedRange({ start, end });
this.indexChange.next(index);
this.stickyChange.next(renderedOffset);
// How far the scroll offset is from the lower buffer, which is usually where items start being displayed
const relativeScrollOffset = scrollOffset - bufferOffset;
const rowsScrolled = relativeScrollOffset / this.rowHeight;
const displayed = scrollOffset / this.rowHeight;
this.indexChange.next(displayed);
// Only bother updating the displayed information if we've scrolled more than a row
const rowSensitivity = 1.0;
if (Math.abs(rowsScrolled) < rowSensitivity) {
this.viewport.setRenderedContentOffset(renderedOffset);
this.viewport.setRenderedRange({ start, end });
return;
}
// Special case for the start of the table.
// At the top of the table, the first few rows are first rendered because they're visible, and then still rendered
// Because they move into the buffer. So we only need to change what's rendered once the user scrolls far enough down.
if (renderedOffset === 0 && rowsScrolled < 0) {
this.viewport.setRenderedContentOffset(renderedOffset);
this.viewport.setRenderedRange({ start, end });
return;
}
const rowsToMove = Math.sign(rowsScrolled) * Math.floor(Math.abs(rowsScrolled));
const adjustedRenderedOffset = Math.max(0, renderedOffset + rowsToMove * this.rowHeight);
this.viewport.setRenderedContentOffset(adjustedRenderedOffset);
const adjustedStart = Math.max(0, start + rowsToMove);
const adjustedEnd = adjustedStart + itemsDisplayed + 2 * bufferItems;
this.viewport.setRenderedRange({ start: adjustedStart, end: adjustedEnd });
this.stickyChange.next(adjustedRenderedOffset);
}

@@ -88,2 +108,2 @@ }

];
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZml4ZWQtc2l6ZS10YWJsZS12aXJ0dWFsLXNjcm9sbC1zdHJhdGVneS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL25nLXRhYmxlLXZpcnR1YWwtc2Nyb2xsL3NyYy9saWIvZml4ZWQtc2l6ZS10YWJsZS12aXJ0dWFsLXNjcm9sbC1zdHJhdGVneS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQzNDLE9BQU8sRUFBRSxvQkFBb0IsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBQ3RELE9BQU8sRUFBRSxlQUFlLEVBQUUsT0FBTyxFQUFFLE1BQU0sTUFBTSxDQUFDO0FBWWhELE1BQU0sT0FBTyxtQ0FBbUM7SUFEaEQ7UUFNVSxnQkFBVyxHQUFHLElBQUksT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4gICAgY29uc3QgYWRqdXN0ZWRTdGFydCA9IE1hdGgubWF4KDAsIHN0YXJ0ICsgcm93c1RvTW92ZSk7XG4gICAgY29uc3QgYWRqdXN0ZWRFbmQgPSBhZGp1c3RlZFN0YXJ0ICsgaXRlbXNEaXNwbGF5ZWQgKyAyICogYnVmZmVySXRlbXM7XG4gICAgdGhpcy52aWV3cG9ydC5zZXRSZW5kZXJlZFJhbmdlKHtzdGFydDogYWRqdXN0ZWRTdGFydCwgZW5kOiBhZGp1c3RlZEVuZH0pO1xuXG4gICAgdGhpcy5zdGlja3lDaGFuZ2UubmV4dChhZGp1c3RlZFJlbmRlcmVkT2Zmc2V0KTtcbiAgfVxufVxuIl19
import { ContentChild, Directive, forwardRef, Input, NgZone } from '@angular/core';
import { VIRTUAL_SCROLL_STRATEGY } from '@angular/cdk/scrolling';
import { delayWhen, distinctUntilChanged, filter, map, switchMap, takeUntil, tap } from 'rxjs/operators';
import { distinctUntilChanged, filter, map, switchMap, takeUntil, tap } from 'rxjs/operators';
import { TableVirtualScrollDataSource } from './table-data-source';
import { MatTable } from '@angular/material/table';
import { FixedSizeTableVirtualScrollStrategy } from './fixed-size-table-virtual-scroll-strategy';
import { of, Subject, timer } from 'rxjs';
import { Subject } from 'rxjs';
export function _tableVirtualScrollDirectiveStrategyFactory(tableDir) {

@@ -53,3 +53,6 @@ return tableDir.scrollStrategy;

this.scrollStrategy.stickyChange
.pipe(filter(() => this.isStickyEnabled()), delayWhen(() => !this.stickyPositions ? timer(0) : of()), tap(() => {
.pipe(filter(() => this.isStickyEnabled()),
// breaks sticky header on the top. needs investigation
// delayWhen(() => !this.stickyPositions ? timer(0) : of()),
tap(() => {
if (!this.stickyPositions) {

@@ -143,2 +146,2 @@ this.initStickyPositions();

};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFibGUtaXRlbS1zaXplLmRpcmVjdGl2ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2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TtcbiAgICBpZiAoZGF0YVNvdXJjZSBpbnN0YW5jZW9mIFRhYmxlVmlydHVhbFNjcm9sbERhdGFTb3VyY2UpIHtcbiAgICAgIGRhdGFTb3VyY2VcbiAgICAgICAgLmRhdGFUb1JlbmRlciRcbiAgICAgICAgLnBpcGUoXG4gICAgICAgICAgZGlzdGluY3RVbnRpbENoYW5nZWQoKSxcbiAgICAgICAgICB0YWtlVW50aWwodGhpcy5kYXRhU291cmNlQ2hhbmdlcyksXG4gICAgICAgICAgdGFrZVVudGlsKHRoaXMuZGVzdHJveWVkJCksXG4gICAgICAgICAgdGFwKGRhdGEgPT4gdGhpcy5zY3JvbGxTdHJhdGVneS5kYXRhTGVuZ3RoID0gZGF0YS5sZW5ndGgpLFxuICAgICAgICAgIHN3aXRjaE1hcChkYXRhID0+XG4gICAgICAgICAgICB0aGlzLnNjcm9sbFN0cmF0ZWd5XG4gICAgICAgICAgICAgIC5yZW5kZXJlZFJhbmdlU3RyZWFtXG4gICAgICAgICAgICAgIC5waXBlKFxuICAgICAgICAgICAgICAgIG1hcCgoe1xuICAgICAgICAgICAgICAgICAgICAgICBzdGFydCxcbiAgICAgICAgICAgICAgICAgICAgICAgZW5kXG4gICAgICAgICAgICAgICAgICAgICB9KSA9PiB0eXBlb2Ygc3RhcnQgIT09ICdudW1iZXInIHx8IHR5cGVvZiBlbmQgIT09ICdudW1iZXInID8gZGF0YSA6IGRhdGEuc2xpY2Uoc3RhcnQsIGVuZCkpXG4gICAgICAgICAgICAgIClcbiAgICAgICAgICApXG4gICAgICAgIClcbiAgICAgICAgLnN1YnNjcmliZShkYXRhID0+IHtcbiAgICAgICAgICB0aGlzLnpvbmUucnVuKCgpID0+IHtcbiAgICAgICAgICAgIGRhdGFTb3VyY2UuZGF0YU9mUmFuZ2UkLm5leHQoZGF0YSk7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0pO1xuICAgIH0gZWxzZSB7XG4gICAgICB0aHJvdyBuZXcgRXJyb3IoJ1t0dn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RWxlbWVudC5xdWVyeVNlbGVjdG9yQWxsKHN0aWNreUhlYWRlclNlbGVjdG9yKVxuICAgICAgLmZvckVhY2goZWwgPT4ge1xuICAgICAgICBjb25zdCBwYXJlbnQgPSBlbC5wYXJlbnRFbGVtZW50O1xuICAgICAgICBpZiAoIXRoaXMuc3RpY2t5UG9zaXRpb25zLmhhcyhwYXJlbnQpKSB7XG4gICAgICAgICAgdGhpcy5zdGlja3lQb3NpdGlvbnMuc2V0KHBhcmVudCwgcGFyZW50Lm9mZnNldFRvcCk7XG4gICAgICAgIH1cbiAgICAgIH0pO1xuICB9XG59XG4iXX0=
import { Injectable, Directive, forwardRef, NgZone, Input, ContentChild, NgModule } from '@angular/core';
import { VIRTUAL_SCROLL_STRATEGY } from '@angular/cdk/scrolling';
import { map, distinctUntilChanged, filter, delayWhen, tap, takeUntil, switchMap } from 'rxjs/operators';
import { merge, of, combineLatest, Subscription, ReplaySubject, Subject, BehaviorSubject, timer } from 'rxjs';
import { map, distinctUntilChanged, filter, tap, takeUntil, switchMap } from 'rxjs/operators';
import { merge, of, combineLatest, Subscription, ReplaySubject, Subject, BehaviorSubject } from 'rxjs';
import { MatTableDataSource, MatTable } from '@angular/material/table';

@@ -78,3 +78,2 @@

onContentRendered() {
// no-op
}

@@ -108,15 +107,36 @@ onRenderedOffsetChanged() {

}
const renderedOffset = this.viewport.getOffsetToRenderedContentStart();
const start = renderedOffset / this.rowHeight;
const itemsDisplayed = Math.ceil(this.viewport.getViewportSize() / this.rowHeight);
const bufferItems = Math.ceil(itemsDisplayed * this.bufferMultiplier);
const end = start + itemsDisplayed + 2 * bufferItems;
const bufferOffset = renderedOffset + bufferItems * this.rowHeight;
const scrollOffset = this.viewport.measureScrollOffset();
const amount = Math.ceil(this.viewport.getViewportSize() / this.rowHeight);
const offset = Math.max(scrollOffset - this.headerHeight, 0);
const buffer = Math.ceil(amount * this.bufferMultiplier);
const skip = Math.round(offset / this.rowHeight);
const index = Math.max(0, skip);
const start = Math.max(0, index - buffer);
const end = Math.min(this.dataLength, index + amount + buffer);
const renderedOffset = start * this.rowHeight;
this.viewport.setRenderedContentOffset(renderedOffset);
this.viewport.setRenderedRange({ start, end });
this.indexChange.next(index);
this.stickyChange.next(renderedOffset);
// How far the scroll offset is from the lower buffer, which is usually where items start being displayed
const relativeScrollOffset = scrollOffset - bufferOffset;
const rowsScrolled = relativeScrollOffset / this.rowHeight;
const displayed = scrollOffset / this.rowHeight;
this.indexChange.next(displayed);
// Only bother updating the displayed information if we've scrolled more than a row
const rowSensitivity = 1.0;
if (Math.abs(rowsScrolled) < rowSensitivity) {
this.viewport.setRenderedContentOffset(renderedOffset);
this.viewport.setRenderedRange({ start, end });
return;
}
// Special case for the start of the table.
// At the top of the table, the first few rows are first rendered because they're visible, and then still rendered
// Because they move into the buffer. So we only need to change what's rendered once the user scrolls far enough down.
if (renderedOffset === 0 && rowsScrolled < 0) {
this.viewport.setRenderedContentOffset(renderedOffset);
this.viewport.setRenderedRange({ start, end });
return;
}
const rowsToMove = Math.sign(rowsScrolled) * Math.floor(Math.abs(rowsScrolled));
const adjustedRenderedOffset = Math.max(0, renderedOffset + rowsToMove * this.rowHeight);
this.viewport.setRenderedContentOffset(adjustedRenderedOffset);
const adjustedStart = Math.max(0, start + rowsToMove);
const adjustedEnd = adjustedStart + itemsDisplayed + 2 * bufferItems;
this.viewport.setRenderedRange({ start: adjustedStart, end: adjustedEnd });
this.stickyChange.next(adjustedRenderedOffset);
}

@@ -173,3 +193,6 @@ }

this.scrollStrategy.stickyChange
.pipe(filter(() => this.isStickyEnabled()), delayWhen(() => !this.stickyPositions ? timer(0) : of()), tap(() => {
.pipe(filter(() => this.isStickyEnabled()),
// breaks sticky header on the top. needs investigation
// delayWhen(() => !this.stickyPositions ? timer(0) : of()),
tap(() => {
if (!this.stickyPositions) {

@@ -176,0 +199,0 @@ this.initStickyPositions();

{
"name": "ng-table-virtual-scroll",
"version": "1.3.6",
"version": "1.3.7",
"description": "Virtual scroll for for Angular Material Table",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/diprokon/ng-table-virtual-scroll",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc