Socket
Socket
Sign inDemoInstall

ngx-virtual-scroller

Package Overview
Dependencies
5
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.3 to 4.0.1

CHANGELOG.md

16

bundles/ngx-virtual-scroller.umd.min.js

@@ -1,2 +0,16 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@tweenjs/tween.js")):"function"==typeof define&&define.amd?define("ngx-virtual-scroller",["exports","@angular/core","@angular/common","@tweenjs/tween.js"],t):t((e=e||self)["ngx-virtual-scroller"]={},e.ng.core,e.ng.common,e.TWEEN)}(this,function(e,t,i,n){"use strict";function r(e,t,i,n){var r,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s}function o(e,t){return function(i,n){t(i,n,e)}}function s(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function l(){return{scrollThrottlingTime:0,scrollDebounceTime:0,scrollAnimationTime:750,checkResizeInterval:1e3,resizeBypassRefreshThreshold:5,modifyOverflowStyleOfParentScroll:!0,stripedTable:!1}}var a=function(){function e(e,n,r,o,s,l){this.element=e,this.renderer=n,this.zone=r,this.changeDetectorRef=o,this.window=window,this.executeRefreshOutsideAngularZone=!1,this._enableUnequalChildrenSizes=!1,this.useMarginInsteadOfTranslate=!1,this.ssrViewportWidth=1920,this.ssrViewportHeight=1080,this._bufferAmount=0,this._items=[],this.compareItems=function(e,t){return e===t},this.vsUpdate=new t.EventEmitter,this.vsChange=new t.EventEmitter,this.vsStart=new t.EventEmitter,this.vsEnd=new t.EventEmitter,this.calculatedScrollbarWidth=0,this.calculatedScrollbarHeight=0,this.padding=0,this.previousViewPort={},this.cachedPageSize=0,this.previousScrollNumberElements=0,this.isAngularUniversalSSR=i.isPlatformServer(s),this.scrollThrottlingTime=l.scrollThrottlingTime,this.scrollDebounceTime=l.scrollDebounceTime,this.scrollAnimationTime=l.scrollAnimationTime,this.scrollbarWidth=l.scrollbarWidth,this.scrollbarHeight=l.scrollbarHeight,this.checkResizeInterval=l.checkResizeInterval,this.resizeBypassRefreshThreshold=l.resizeBypassRefreshThreshold,this.modifyOverflowStyleOfParentScroll=l.modifyOverflowStyleOfParentScroll,this.stripedTable=l.stripedTable,this.horizontal=!1,this.resetWrapGroupDimensions()}return Object.defineProperty(e.prototype,"viewPortInfo",{get:function(){var e=this.previousViewPort||{};return{startIndex:e.startIndex||0,endIndex:e.endIndex||0,scrollStartPosition:e.scrollStartPosition||0,scrollEndPosition:e.scrollEndPosition||0,maxScrollPosition:e.maxScrollPosition||0,startIndexWithBuffer:e.startIndexWithBuffer||0,endIndexWithBuffer:e.endIndexWithBuffer||0}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enableUnequalChildrenSizes",{get:function(){return this._enableUnequalChildrenSizes},set:function(e){this._enableUnequalChildrenSizes!==e&&(this._enableUnequalChildrenSizes=e,this.minMeasuredChildWidth=undefined,this.minMeasuredChildHeight=undefined)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bufferAmount",{get:function(){return"number"==typeof this._bufferAmount&&this._bufferAmount>=0?this._bufferAmount:this.enableUnequalChildrenSizes?5:0},set:function(e){this._bufferAmount=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scrollThrottlingTime",{get:function(){return this._scrollThrottlingTime},set:function(e){this._scrollThrottlingTime=e,this.updateOnScrollFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scrollDebounceTime",{get:function(){return this._scrollDebounceTime},set:function(e){this._scrollDebounceTime=e,this.updateOnScrollFunction()},enumerable:!0,configurable:!0}),e.prototype.updateOnScrollFunction=function(){var e=this;this.scrollDebounceTime?this.onScroll=this.debounce(function(){e.refresh_internal(!1)},this.scrollDebounceTime):this.scrollThrottlingTime?this.onScroll=this.throttleTrailing(function(){e.refresh_internal(!1)},this.scrollThrottlingTime):this.onScroll=function(){e.refresh_internal(!1)}},Object.defineProperty(e.prototype,"checkResizeInterval",{get:function(){return this._checkResizeInterval},set:function(e){this._checkResizeInterval!==e&&(this._checkResizeInterval=e,this.addScrollEventHandlers())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"items",{get:function(){return this._items},set:function(e){e!==this._items&&(this._items=e||[],this.refresh_internal(!0))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"horizontal",{get:function(){return this._horizontal},set:function(e){this._horizontal=e,this.updateDirection()},enumerable:!0,configurable:!0}),e.prototype.revertParentOverscroll=function(){var e=this.getScrollElement();e&&this.oldParentScrollOverflow&&(e.style["overflow-y"]=this.oldParentScrollOverflow.y,e.style["overflow-x"]=this.oldParentScrollOverflow.x),this.oldParentScrollOverflow=undefined},Object.defineProperty(e.prototype,"parentScroll",{get:function(){return this._parentScroll},set:function(e){if(this._parentScroll!==e){this.revertParentOverscroll(),this._parentScroll=e,this.addScrollEventHandlers();var t=this.getScrollElement();this.modifyOverflowStyleOfParentScroll&&t!==this.element.nativeElement&&(this.oldParentScrollOverflow={x:t.style["overflow-x"],y:t.style["overflow-y"]},t.style["overflow-y"]=this.horizontal?"visible":"auto",t.style["overflow-x"]=this.horizontal?"auto":"visible")}},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){this.addScrollEventHandlers()},e.prototype.ngOnDestroy=function(){this.removeScrollEventHandlers(),this.revertParentOverscroll()},e.prototype.ngOnChanges=function(e){var t=this.cachedItemsLength!==this.items.length;this.cachedItemsLength=this.items.length;var i=!e.items||!e.items.previousValue||0===e.items.previousValue.length;this.refresh_internal(t||i)},e.prototype.ngDoCheck=function(){if(this.cachedItemsLength!==this.items.length)return this.cachedItemsLength=this.items.length,void this.refresh_internal(!0);if(this.previousViewPort&&this.viewPortItems&&this.viewPortItems.length>0){for(var e=!1,t=0;t<this.viewPortItems.length;++t)if(!this.compareItems(this.items[this.previousViewPort.startIndexWithBuffer+t],this.viewPortItems[t])){e=!0;break}e&&this.refresh_internal(!0)}},e.prototype.refresh=function(){this.refresh_internal(!0)},e.prototype.invalidateAllCachedMeasurements=function(){this.wrapGroupDimensions={maxChildSizePerWrapGroup:[],numberOfKnownWrapGroupChildSizes:0,sumOfKnownWrapGroupChildWidths:0,sumOfKnownWrapGroupChildHeights:0},this.minMeasuredChildWidth=undefined,this.minMeasuredChildHeight=undefined,this.refresh_internal(!1)},e.prototype.invalidateCachedMeasurementForItem=function(e){if(this.enableUnequalChildrenSizes){var t=this.items&&this.items.indexOf(e);t>=0&&this.invalidateCachedMeasurementAtIndex(t)}else this.minMeasuredChildWidth=undefined,this.minMeasuredChildHeight=undefined;this.refresh_internal(!1)},e.prototype.invalidateCachedMeasurementAtIndex=function(e){if(this.enableUnequalChildrenSizes){var t=this.wrapGroupDimensions.maxChildSizePerWrapGroup[e];t&&(this.wrapGroupDimensions.maxChildSizePerWrapGroup[e]=undefined,--this.wrapGroupDimensions.numberOfKnownWrapGroupChildSizes,this.wrapGroupDimensions.sumOfKnownWrapGroupChildWidths-=t.childWidth||0,this.wrapGroupDimensions.sumOfKnownWrapGroupChildHeights-=t.childHeight||0)}else this.minMeasuredChildWidth=undefined,this.minMeasuredChildHeight=undefined;this.refresh_internal(!1)},e.prototype.scrollInto=function(e,t,i,n,r){void 0===t&&(t=!0),void 0===i&&(i=0),void 0===n&&(n=undefined),void 0===r&&(r=undefined);var o=this.items.indexOf(e);-1!==o&&this.scrollToIndex(o,t,i,n,r)},e.prototype.scrollToIndex=function(e,t,i,n,r){var o=this;void 0===t&&(t=!0),void 0===i&&(i=0),void 0===n&&(n=undefined),void 0===r&&(r=undefined);var s=5,l=function(){if(--s<=0)r&&r();else{var n=o.calculateDimensions(),a=Math.min(Math.max(e,0),n.itemCount-1);o.previousViewPort.startIndex!==a?o.scrollToIndex_internal(e,t,i,0,l):r&&r()}};this.scrollToIndex_internal(e,t,i,n,l)},e.prototype.scrollToIndex_internal=function(e,t,i,n,r){void 0===t&&(t=!0),void 0===i&&(i=0),void 0===n&&(n=undefined),void 0===r&&(r=undefined),n=n===undefined?this.scrollAnimationTime:n;var o=this.calculateDimensions(),s=this.calculatePadding(e,o)+i;t||(s-=o.wrapGroupsPerPage*o[this._childScrollDim]),this.scrollToPosition(s,n,r)},e.prototype.scrollToPosition=function(e,t,i){var r=this;void 0===t&&(t=undefined),void 0===i&&(i=undefined),e+=this.getElementsOffset(),t=t===undefined?this.scrollAnimationTime:t;var o,s=this.getScrollElement();if(this.currentTween&&(this.currentTween.stop(),this.currentTween=undefined),!t)return this.renderer.setProperty(s,this._scrollType,e),void this.refresh_internal(!1,i);var l={scrollPosition:s[this._scrollType]},a=new n.Tween(l).to({scrollPosition:e},t).easing(n.Easing.Quadratic.Out).onUpdate(function(e){isNaN(e.scrollPosition)||(r.renderer.setProperty(s,r._scrollType,e.scrollPosition),r.refresh_internal(!1))}).onStop(function(){cancelAnimationFrame(o)}).start(),h=function(t){a.isPlaying()&&(a.update(t),l.scrollPosition!==e?r.zone.runOutsideAngular(function(){o=requestAnimationFrame(h)}):r.refresh_internal(!1,i))};h(),this.currentTween=a},e.prototype.getElementSize=function(e){var t=e.getBoundingClientRect(),i=getComputedStyle(e),n=parseInt(i["margin-top"],10)||0,r=parseInt(i["margin-bottom"],10)||0,o=parseInt(i["margin-left"],10)||0,s=parseInt(i["margin-right"],10)||0;return{top:t.top+n,bottom:t.bottom+r,left:t.left+o,right:t.right+s,width:t.width+o+s,height:t.height+n+r}},e.prototype.checkScrollElementResized=function(){var e,t=this.getElementSize(this.getScrollElement());if(this.previousScrollBoundingRect){var i=Math.abs(t.width-this.previousScrollBoundingRect.width),n=Math.abs(t.height-this.previousScrollBoundingRect.height);e=i>this.resizeBypassRefreshThreshold||n>this.resizeBypassRefreshThreshold}else e=!0;e&&(this.previousScrollBoundingRect=t,t.width>0&&t.height>0&&this.refresh_internal(!1))},e.prototype.updateDirection=function(){this.horizontal?(this._invisiblePaddingProperty="width",this._offsetType="offsetLeft",this._pageOffsetType="pageXOffset",this._childScrollDim="childWidth",this._marginDir="margin-left",this._translateDir="translateX",this._scrollType="scrollLeft"):(this._invisiblePaddingProperty="height",this._offsetType="offsetTop",this._pageOffsetType="pageYOffset",this._childScrollDim="childHeight",this._marginDir="margin-top",this._translateDir="translateY",this._scrollType="scrollTop")},e.prototype.debounce=function(e,t){var i=this.throttleTrailing(e,t),n=function(){i.cancel(),i.apply(this,arguments)};return n.cancel=function(){i.cancel()},n},e.prototype.throttleTrailing=function(e,t){var i=undefined,n=arguments,r=function(){var r=this;n=arguments,i||(t<=0?e.apply(r,n):i=setTimeout(function(){i=undefined,e.apply(r,n)},t))};return r.cancel=function(){i&&(clearTimeout(i),i=undefined)},r},e.prototype.refresh_internal=function(e,t,i){var n=this;if(void 0===t&&(t=undefined),void 0===i&&(i=2),e&&this.previousViewPort&&this.previousViewPort.scrollStartPosition>0){var r=this.previousViewPort,o=this.viewPortItems,s=t;t=function(){var e=n.previousViewPort.scrollLength-r.scrollLength;if(e>0&&n.viewPortItems){var t=o[0],i=n.items.findIndex(function(e){return n.compareItems(t,e)});if(i>n.previousViewPort.startIndexWithBuffer){for(var l=!1,a=1;a<n.viewPortItems.length;++a)if(!n.compareItems(n.items[i+a],o[a])){l=!0;break}if(!l)return void n.scrollToPosition(n.previousViewPort.scrollStartPosition+e,0,s)}}s&&s()}}this.zone.runOutsideAngular(function(){requestAnimationFrame(function(){e&&n.resetWrapGroupDimensions();var r=n.calculateViewport(),o=e||r.startIndex!==n.previousViewPort.startIndex,s=e||r.endIndex!==n.previousViewPort.endIndex,l=r.scrollLength!==n.previousViewPort.scrollLength,a=r.padding!==n.previousViewPort.padding,h=r.scrollStartPosition!==n.previousViewPort.scrollStartPosition||r.scrollEndPosition!==n.previousViewPort.scrollEndPosition||r.maxScrollPosition!==n.previousViewPort.maxScrollPosition;if(n.previousViewPort=r,l&&n.renderer.setStyle(n.invisiblePaddingElementRef.nativeElement,n._invisiblePaddingProperty,r.scrollLength+"px"),a&&(n.useMarginInsteadOfTranslate?n.renderer.setStyle(n.contentElementRef.nativeElement,n._marginDir,r.padding+"px"):(n.renderer.setStyle(n.contentElementRef.nativeElement,"transform",n._translateDir+"("+r.padding+"px)"),n.renderer.setStyle(n.contentElementRef.nativeElement,"webkitTransform",n._translateDir+"("+r.padding+"px)"))),n.headerElementRef){var d=n.getScrollElement()[n._scrollType],p=n.getElementsOffset(),c=Math.max(d-r.padding-p+n.headerElementRef.nativeElement.clientHeight,0);n.renderer.setStyle(n.headerElementRef.nativeElement,"transform",n._translateDir+"("+c+"px)"),n.renderer.setStyle(n.headerElementRef.nativeElement,"webkitTransform",n._translateDir+"("+c+"px)")}var u=o||s?{startIndex:r.startIndex,endIndex:r.endIndex,scrollStartPosition:r.scrollStartPosition,scrollEndPosition:r.scrollEndPosition,startIndexWithBuffer:r.startIndexWithBuffer,endIndexWithBuffer:r.endIndexWithBuffer,maxScrollPosition:r.maxScrollPosition}:undefined;if(o||s||h){var f=function(){n.viewPortItems=r.startIndexWithBuffer>=0&&r.endIndexWithBuffer>=0?n.items.slice(r.startIndexWithBuffer,r.endIndexWithBuffer+1):[],n.vsUpdate.emit(n.viewPortItems),o&&n.vsStart.emit(u),s&&n.vsEnd.emit(u),(o||s)&&(n.changeDetectorRef.markForCheck(),n.vsChange.emit(u)),i>0?n.refresh_internal(!1,t,i-1):t&&t()};n.executeRefreshOutsideAngularZone?f():n.zone.run(f)}else{if(i>0&&(l||a))return void n.refresh_internal(!1,t,i-1);t&&t()}})})},e.prototype.getScrollElement=function(){return this.parentScroll instanceof Window?document.scrollingElement||document.documentElement||document.body:this.parentScroll||this.element.nativeElement},e.prototype.addScrollEventHandlers=function(){var e=this;if(!this.isAngularUniversalSSR){var t=this.getScrollElement();this.removeScrollEventHandlers(),this.zone.runOutsideAngular(function(){e.parentScroll instanceof Window?(e.disposeScrollHandler=e.renderer.listen("window","scroll",e.onScroll),e.disposeResizeHandler=e.renderer.listen("window","resize",e.onScroll)):(e.disposeScrollHandler=e.renderer.listen(t,"scroll",e.onScroll),e._checkResizeInterval>0&&(e.checkScrollElementResizedTimer=setInterval(function(){e.checkScrollElementResized()},e._checkResizeInterval)))})}},e.prototype.removeScrollEventHandlers=function(){this.checkScrollElementResizedTimer&&clearInterval(this.checkScrollElementResizedTimer),this.disposeScrollHandler&&(this.disposeScrollHandler(),this.disposeScrollHandler=undefined),this.disposeResizeHandler&&(this.disposeResizeHandler(),this.disposeResizeHandler=undefined)},e.prototype.getElementsOffset=function(){if(this.isAngularUniversalSSR)return 0;var e=0;if(this.containerElementRef&&this.containerElementRef.nativeElement&&(e+=this.containerElementRef.nativeElement[this._offsetType]),this.parentScroll){var t=this.getScrollElement(),i=this.getElementSize(this.element.nativeElement),n=this.getElementSize(t);this.horizontal?e+=i.left-n.left:e+=i.top-n.top,this.parentScroll instanceof Window||(e+=t[this._scrollType])}return e},e.prototype.countItemsPerWrapGroup=function(){if(this.isAngularUniversalSSR)return Math.round(this.horizontal?this.ssrViewportHeight/this.ssrChildHeight:this.ssrViewportWidth/this.ssrChildWidth);var e=this.horizontal?"offsetLeft":"offsetTop",t=(this.containerElementRef&&this.containerElementRef.nativeElement||this.contentElementRef.nativeElement).children,i=t?t.length:0;if(0===i)return 1;for(var n=t[0][e],r=1;r<i&&n===t[r][e];)++r;return r},e.prototype.getScrollStartPosition=function(){var e=undefined;return this.parentScroll instanceof Window&&(e=window[this._pageOffsetType]),e||this.getScrollElement()[this._scrollType]||0},e.prototype.resetWrapGroupDimensions=function(){var e=this.wrapGroupDimensions;if(this.invalidateAllCachedMeasurements(),this.enableUnequalChildrenSizes&&e&&0!==e.numberOfKnownWrapGroupChildSizes)for(var t=this.countItemsPerWrapGroup(),i=0;i<e.maxChildSizePerWrapGroup.length;++i){var n=e.maxChildSizePerWrapGroup[i];if(n&&n.items&&n.items.length){if(n.items.length!==t)return;for(var r=!1,o=t*i,s=0;s<t;++s)if(!this.compareItems(n.items[s],this.items[o+s])){r=!0;break}r||(++this.wrapGroupDimensions.numberOfKnownWrapGroupChildSizes,this.wrapGroupDimensions.sumOfKnownWrapGroupChildWidths+=n.childWidth||0,this.wrapGroupDimensions.sumOfKnownWrapGroupChildHeights+=n.childHeight||0,this.wrapGroupDimensions.maxChildSizePerWrapGroup[i]=n)}}},e.prototype.calculateDimensions=function(){var e=this.getScrollElement();this.calculatedScrollbarHeight=Math.max(Math.min(e.offsetHeight-e.clientHeight,25),this.calculatedScrollbarHeight),this.calculatedScrollbarWidth=Math.max(Math.min(e.offsetWidth-e.clientWidth,25),this.calculatedScrollbarWidth);var t,i,n,r=e.offsetWidth-(this.scrollbarWidth||this.calculatedScrollbarWidth||(this.horizontal?0:25)),o=e.offsetHeight-(this.scrollbarHeight||this.calculatedScrollbarHeight||(this.horizontal?25:0)),s=this.containerElementRef&&this.containerElementRef.nativeElement||this.contentElementRef.nativeElement,l=this.countItemsPerWrapGroup();if(this.isAngularUniversalSSR){r=this.ssrViewportWidth,o=this.ssrViewportHeight,i=this.ssrChildWidth,n=this.ssrChildHeight;var a=Math.max(Math.ceil(r/i),1),h=Math.max(Math.ceil(o/n),1);t=this.horizontal?a:h}else if(this.enableUnequalChildrenSizes){var d=e[this._scrollType]-(this.previousViewPort?this.previousViewPort.padding:0),p=this.previousViewPort.startIndexWithBuffer||0,c=Math.ceil(p/l),u=0,f=0,m=0,g=0;t=0;for(var v=0;v<s.children.length;++v){++p;W=s.children[v],E=this.getElementSize(W);if(u=Math.max(u,E.width),f=Math.max(f,E.height),p%l==0){var y=this.wrapGroupDimensions.maxChildSizePerWrapGroup[c];y&&(--this.wrapGroupDimensions.numberOfKnownWrapGroupChildSizes,this.wrapGroupDimensions.sumOfKnownWrapGroupChildWidths-=y.childWidth||0,this.wrapGroupDimensions.sumOfKnownWrapGroupChildHeights-=y.childHeight||0),++this.wrapGroupDimensions.numberOfKnownWrapGroupChildSizes;var S=this.items.slice(p-l,p);if(this.wrapGroupDimensions.maxChildSizePerWrapGroup[c]={childWidth:u,childHeight:f,items:S},this.wrapGroupDimensions.sumOfKnownWrapGroupChildWidths+=u,this.wrapGroupDimensions.sumOfKnownWrapGroupChildHeights+=f,this.horizontal){var w=Math.min(u,Math.max(r-m,0));if(d>0)w-=P=Math.min(d,w),d-=P;m+=w,w>0&&r>=m&&++t}else{var P,b=Math.min(f,Math.max(o-g,0));if(d>0)b-=P=Math.min(d,b),d-=P;g+=b,b>0&&o>=g&&++t}++c,u=0,f=0}}var x=this.wrapGroupDimensions.sumOfKnownWrapGroupChildWidths/this.wrapGroupDimensions.numberOfKnownWrapGroupChildSizes,I=this.wrapGroupDimensions.sumOfKnownWrapGroupChildHeights/this.wrapGroupDimensions.numberOfKnownWrapGroupChildSizes;i=this.childWidth||x||r,n=this.childHeight||I||o,this.horizontal?r>m&&(t+=Math.ceil((r-m)/i)):o>g&&(t+=Math.ceil((o-g)/n))}else{if(s.children.length>0){this.childWidth&&this.childHeight||(!this.minMeasuredChildWidth&&r>0&&(this.minMeasuredChildWidth=r),!this.minMeasuredChildHeight&&o>0&&(this.minMeasuredChildHeight=o));var W=s.children[0],E=this.getElementSize(W);this.minMeasuredChildWidth=Math.min(this.minMeasuredChildWidth,E.width),this.minMeasuredChildHeight=Math.min(this.minMeasuredChildHeight,E.height)}i=this.childWidth||this.minMeasuredChildWidth||r,n=this.childHeight||this.minMeasuredChildHeight||o;a=Math.max(Math.ceil(r/i),1),h=Math.max(Math.ceil(o/n),1);t=this.horizontal?a:h}var C=this.items.length,z=l*t,T=C/z,_=Math.ceil(C/l),O=0,M=this.horizontal?i:n;if(this.enableUnequalChildrenSizes){var R=0;for(v=0;v<_;++v){var G=this.wrapGroupDimensions.maxChildSizePerWrapGroup[v]&&this.wrapGroupDimensions.maxChildSizePerWrapGroup[v][this._childScrollDim];G?O+=G:++R}O+=Math.round(R*M)}else O=_*M;this.headerElementRef&&(O+=this.headerElementRef.nativeElement.clientHeight);var D=this.horizontal?r:o;return{itemCount:C,itemsPerWrapGroup:l,wrapGroupsPerPage:t,itemsPerPage:z,pageCount_fractional:T,childWidth:i,childHeight:n,scrollLength:O,viewportLength:D,maxScrollPosition:Math.max(O-D,0)}},e.prototype.calculatePadding=function(e,t){if(0===t.itemCount)return 0;var i=t[this._childScrollDim],n=Math.floor(e/t.itemsPerWrapGroup)||0;if(!this.enableUnequalChildrenSizes)return i*n;for(var r=0,o=0,s=0;s<n;++s){var l=this.wrapGroupDimensions.maxChildSizePerWrapGroup[s]&&this.wrapGroupDimensions.maxChildSizePerWrapGroup[s][this._childScrollDim];l?o+=l:++r}return o+=Math.round(r*i)},e.prototype.calculatePageInfo=function(e,t){var i=0;if(this.enableUnequalChildrenSizes)for(var n=Math.ceil(t.itemCount/t.itemsPerWrapGroup),r=0,o=t[this._childScrollDim],s=0;s<n;++s){var l=this.wrapGroupDimensions.maxChildSizePerWrapGroup[s]&&this.wrapGroupDimensions.maxChildSizePerWrapGroup[s][this._childScrollDim];if(e<(r+=l||o)){i=s/n;break}}else i=e/t.scrollLength;var a=Math.min(Math.max(i*t.pageCount_fractional,0),t.pageCount_fractional)*t.itemsPerPage,h=t.itemCount-t.itemsPerPage-1,d=Math.min(Math.floor(a),h);if(d-=d%t.itemsPerWrapGroup,this.stripedTable){var p=2*t.itemsPerWrapGroup;d%p!=0&&(d=Math.max(d-d%p,0))}var c=Math.ceil(a)+t.itemsPerPage-1,u=(c+1)%t.itemsPerWrapGroup;u>0&&(c+=t.itemsPerWrapGroup-u),isNaN(d)&&(d=0),isNaN(c)&&(c=0),d=Math.min(Math.max(d,0),t.itemCount-1),c=Math.min(Math.max(c,0),t.itemCount-1);var f=this.bufferAmount*t.itemsPerWrapGroup;return{startIndex:d,endIndex:c,startIndexWithBuffer:Math.min(Math.max(d-f,0),t.itemCount-1),endIndexWithBuffer:Math.min(Math.max(c+f,0),t.itemCount-1),scrollStartPosition:e,scrollEndPosition:e+t.viewportLength,maxScrollPosition:t.maxScrollPosition}},e.prototype.calculateViewport=function(){var e=this.calculateDimensions(),t=this.getElementsOffset(),i=this.getScrollStartPosition();i>e.scrollLength+t&&!(this.parentScroll instanceof Window)?i=e.scrollLength:i-=t,i=Math.max(0,i);var n=this.calculatePageInfo(i,e),r=this.calculatePadding(n.startIndexWithBuffer,e),o=e.scrollLength;return{startIndex:n.startIndex,endIndex:n.endIndex,startIndexWithBuffer:n.startIndexWithBuffer,endIndexWithBuffer:n.endIndexWithBuffer,padding:Math.round(r),scrollLength:Math.round(o),scrollStartPosition:n.scrollStartPosition,scrollEndPosition:n.scrollEndPosition,maxScrollPosition:n.maxScrollPosition}},r([t.Input(),s("design:type",Boolean)],e.prototype,"executeRefreshOutsideAngularZone",void 0),r([t.Input(),s("design:type",Boolean),s("design:paramtypes",[Boolean])],e.prototype,"enableUnequalChildrenSizes",null),r([t.Input(),s("design:type",Boolean)],e.prototype,"useMarginInsteadOfTranslate",void 0),r([t.Input(),s("design:type",Boolean)],e.prototype,"modifyOverflowStyleOfParentScroll",void 0),r([t.Input(),s("design:type",Boolean)],e.prototype,"stripedTable",void 0),r([t.Input(),s("design:type",Number)],e.prototype,"scrollbarWidth",void 0),r([t.Input(),s("design:type",Number)],e.prototype,"scrollbarHeight",void 0),r([t.Input(),s("design:type",Number)],e.prototype,"childWidth",void 0),r([t.Input(),s("design:type",Number)],e.prototype,"childHeight",void 0),r([t.Input(),s("design:type",Number)],e.prototype,"ssrChildWidth",void 0),r([t.Input(),s("design:type",Number)],e.prototype,"ssrChildHeight",void 0),r([t.Input(),s("design:type",Number)],e.prototype,"ssrViewportWidth",void 0),r([t.Input(),s("design:type",Number)],e.prototype,"ssrViewportHeight",void 0),r([t.Input(),s("design:type",Number),s("design:paramtypes",[Number])],e.prototype,"bufferAmount",null),r([t.Input(),s("design:type",Number)],e.prototype,"scrollAnimationTime",void 0),r([t.Input(),s("design:type",Number)],e.prototype,"resizeBypassRefreshThreshold",void 0),r([t.Input(),s("design:type",Number),s("design:paramtypes",[Number])],e.prototype,"scrollThrottlingTime",null),r([t.Input(),s("design:type",Number),s("design:paramtypes",[Number])],e.prototype,"scrollDebounceTime",null),r([t.Input(),s("design:type",Number),s("design:paramtypes",[Number])],e.prototype,"checkResizeInterval",null),r([t.Input(),s("design:type",Array),s("design:paramtypes",[Array])],e.prototype,"items",null),r([t.Input(),s("design:type",Function)],e.prototype,"compareItems",void 0),r([t.Input(),s("design:type",Boolean),s("design:paramtypes",[Boolean])],e.prototype,"horizontal",null),r([t.Input(),s("design:type",Object),s("design:paramtypes",[Object])],e.prototype,"parentScroll",null),r([t.Output(),s("design:type",t.EventEmitter)],e.prototype,"vsUpdate",void 0),r([t.Output(),s("design:type",t.EventEmitter)],e.prototype,"vsChange",void 0),r([t.Output(),s("design:type",t.EventEmitter)],e.prototype,"vsStart",void 0),r([t.Output(),s("design:type",t.EventEmitter)],e.prototype,"vsEnd",void 0),r([t.ViewChild("content",{read:t.ElementRef,"static":!1}),s("design:type",t.ElementRef)],e.prototype,"contentElementRef",void 0),r([t.ViewChild("invisiblePadding",{read:t.ElementRef,"static":!1}),s("design:type",t.ElementRef)],e.prototype,"invisiblePaddingElementRef",void 0),r([t.ContentChild("header",{read:t.ElementRef,"static":!1}),s("design:type",t.ElementRef)],e.prototype,"headerElementRef",void 0),r([t.ContentChild("container",{read:t.ElementRef,"static":!1}),s("design:type",t.ElementRef)],e.prototype,"containerElementRef",void 0),e=r([t.Component({selector:"virtual-scroller,[virtualScroller]",exportAs:"virtualScroller",template:'\n <div class="total-padding" #invisiblePadding></div>\n <div class="scrollable-content" #content>\n <ng-content></ng-content>\n </div>\n ',host:{"[class.horizontal]":"horizontal","[class.vertical]":"!horizontal","[class.selfScroll]":"!parentScroll"},styles:["\n :host {\n position: relative;\n\t display: block;\n -webkit-overflow-scrolling: touch;\n }\n\t\n\t:host.horizontal.selfScroll {\n overflow-y: visible;\n overflow-x: auto;\n\t}\n\t:host.vertical.selfScroll {\n overflow-y: auto;\n overflow-x: visible;\n\t}\n\t\n .scrollable-content {\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n max-width: 100vw;\n max-height: 100vh;\n position: absolute;\n }\n\n\t.scrollable-content ::ng-deep > * {\n\t\tbox-sizing: border-box;\n\t}\n\t\n\t:host.horizontal {\n\t\twhite-space: nowrap;\n\t}\n\t\n\t:host.horizontal .scrollable-content {\n\t\tdisplay: flex;\n\t}\n\t\n\t:host.horizontal .scrollable-content ::ng-deep > * {\n\t\tflex-shrink: 0;\n\t\tflex-grow: 0;\n\t\twhite-space: initial;\n\t}\n\t\n .total-padding {\n width: 1px;\n opacity: 0;\n }\n \n :host.horizontal .total-padding {\n height: 100%;\n }\n "]}),o(4,t.Inject(t.PLATFORM_ID)),o(5,t.Optional()),o(5,t.Inject("virtual-scroller-default-options")),s("design:paramtypes",[t.ElementRef,t.Renderer2,t.NgZone,t.ChangeDetectorRef,Object,Object])],e)}(),h=function(){function e(){}return e=r([t.NgModule({exports:[a],declarations:[a],imports:[i.CommonModule],providers:[{provide:"virtual-scroller-default-options",useFactory:l}]})],e)}();e.VIRTUAL_SCROLLER_DEFAULT_OPTIONS_FACTORY=l,e.VirtualScrollerComponent=a,e.VirtualScrollerModule=h,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@tweenjs/tween.js")):"function"==typeof define&&define.amd?define("ngx-virtual-scroller",["exports","@angular/core","@angular/common","@tweenjs/tween.js"],t):t((e=e||self)["ngx-virtual-scroller"]={},e.ng.core,e.ng.common,e.TWEEN)}(this,(function(e,t,i,r){"use strict";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */function n(e,t,i,r){var n,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s}function o(e,t){return function(i,r){t(i,r,e)}}function s(){return{scrollThrottlingTime:0,scrollDebounceTime:0,scrollAnimationTime:750,checkResizeInterval:1e3,resizeBypassRefreshThreshold:5,modifyOverflowStyleOfParentScroll:!0,stripedTable:!1}}var l=function(){function e(e,r,n,o,s,l){this.element=e,this.renderer=r,this.zone=n,this.changeDetectorRef=o,this.window=window,this.executeRefreshOutsideAngularZone=!1,this._enableUnequalChildrenSizes=!1,this.RTL=!1,this.useMarginInsteadOfTranslate=!1,this.ssrViewportWidth=1920,this.ssrViewportHeight=1080,this._items=[],this.compareItems=function(e,t){return e===t},this.vsUpdate=new t.EventEmitter,this.vsChange=new t.EventEmitter,this.vsStart=new t.EventEmitter,this.vsEnd=new t.EventEmitter,this.calculatedScrollbarWidth=0,this.calculatedScrollbarHeight=0,this.padding=0,this.previousViewPort={},this.cachedPageSize=0,this.previousScrollNumberElements=0,this.isAngularUniversalSSR=i.isPlatformServer(s),this.scrollThrottlingTime=l.scrollThrottlingTime,this.scrollDebounceTime=l.scrollDebounceTime,this.scrollAnimationTime=l.scrollAnimationTime,this.scrollbarWidth=l.scrollbarWidth,this.scrollbarHeight=l.scrollbarHeight,this.checkResizeInterval=l.checkResizeInterval,this.resizeBypassRefreshThreshold=l.resizeBypassRefreshThreshold,this.modifyOverflowStyleOfParentScroll=l.modifyOverflowStyleOfParentScroll,this.stripedTable=l.stripedTable,this.horizontal=!1,this.resetWrapGroupDimensions()}return Object.defineProperty(e.prototype,"viewPortInfo",{get:function(){var e=this.previousViewPort||{};return{startIndex:e.startIndex||0,endIndex:e.endIndex||0,scrollStartPosition:e.scrollStartPosition||0,scrollEndPosition:e.scrollEndPosition||0,maxScrollPosition:e.maxScrollPosition||0,startIndexWithBuffer:e.startIndexWithBuffer||0,endIndexWithBuffer:e.endIndexWithBuffer||0}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enableUnequalChildrenSizes",{get:function(){return this._enableUnequalChildrenSizes},set:function(e){this._enableUnequalChildrenSizes!==e&&(this._enableUnequalChildrenSizes=e,this.minMeasuredChildWidth=void 0,this.minMeasuredChildHeight=void 0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bufferAmount",{get:function(){return"number"==typeof this._bufferAmount&&this._bufferAmount>=0?this._bufferAmount:this.enableUnequalChildrenSizes?5:0},set:function(e){this._bufferAmount=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scrollThrottlingTime",{get:function(){return this._scrollThrottlingTime},set:function(e){this._scrollThrottlingTime=e,this.updateOnScrollFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scrollDebounceTime",{get:function(){return this._scrollDebounceTime},set:function(e){this._scrollDebounceTime=e,this.updateOnScrollFunction()},enumerable:!0,configurable:!0}),e.prototype.updateOnScrollFunction=function(){var e=this;this.scrollDebounceTime?this.onScroll=this.debounce((function(){e.refresh_internal(!1)}),this.scrollDebounceTime):this.scrollThrottlingTime?this.onScroll=this.throttleTrailing((function(){e.refresh_internal(!1)}),this.scrollThrottlingTime):this.onScroll=function(){e.refresh_internal(!1)}},Object.defineProperty(e.prototype,"checkResizeInterval",{get:function(){return this._checkResizeInterval},set:function(e){this._checkResizeInterval!==e&&(this._checkResizeInterval=e,this.addScrollEventHandlers())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"items",{get:function(){return this._items},set:function(e){e!==this._items&&(this._items=e||[],this.refresh_internal(!0))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"horizontal",{get:function(){return this._horizontal},set:function(e){this._horizontal=e,this.updateDirection()},enumerable:!0,configurable:!0}),e.prototype.revertParentOverscroll=function(){var e=this.getScrollElement();e&&this.oldParentScrollOverflow&&(e.style["overflow-y"]=this.oldParentScrollOverflow.y,e.style["overflow-x"]=this.oldParentScrollOverflow.x),this.oldParentScrollOverflow=void 0},Object.defineProperty(e.prototype,"parentScroll",{get:function(){return this._parentScroll},set:function(e){if(this._parentScroll!==e){this.revertParentOverscroll(),this._parentScroll=e,this.addScrollEventHandlers();var t=this.getScrollElement();this.modifyOverflowStyleOfParentScroll&&t!==this.element.nativeElement&&(this.oldParentScrollOverflow={x:t.style["overflow-x"],y:t.style["overflow-y"]},t.style["overflow-y"]=this.horizontal?"visible":"auto",t.style["overflow-x"]=this.horizontal?"auto":"visible")}},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){this.addScrollEventHandlers()},e.prototype.ngOnDestroy=function(){this.removeScrollEventHandlers(),this.revertParentOverscroll()},e.prototype.ngOnChanges=function(e){var t=this.cachedItemsLength!==this.items.length;this.cachedItemsLength=this.items.length;var i=!e.items||!e.items.previousValue||0===e.items.previousValue.length;this.refresh_internal(t||i)},e.prototype.ngDoCheck=function(){if(this.cachedItemsLength!==this.items.length)return this.cachedItemsLength=this.items.length,void this.refresh_internal(!0);if(this.previousViewPort&&this.viewPortItems&&this.viewPortItems.length>0){for(var e=!1,t=0;t<this.viewPortItems.length;++t)if(!this.compareItems(this.items[this.previousViewPort.startIndexWithBuffer+t],this.viewPortItems[t])){e=!0;break}e&&this.refresh_internal(!0)}},e.prototype.refresh=function(){this.refresh_internal(!0)},e.prototype.invalidateAllCachedMeasurements=function(){this.wrapGroupDimensions={maxChildSizePerWrapGroup:[],numberOfKnownWrapGroupChildSizes:0,sumOfKnownWrapGroupChildWidths:0,sumOfKnownWrapGroupChildHeights:0},this.minMeasuredChildWidth=void 0,this.minMeasuredChildHeight=void 0,this.refresh_internal(!1)},e.prototype.invalidateCachedMeasurementForItem=function(e){if(this.enableUnequalChildrenSizes){var t=this.items&&this.items.indexOf(e);t>=0&&this.invalidateCachedMeasurementAtIndex(t)}else this.minMeasuredChildWidth=void 0,this.minMeasuredChildHeight=void 0;this.refresh_internal(!1)},e.prototype.invalidateCachedMeasurementAtIndex=function(e){if(this.enableUnequalChildrenSizes){var t=this.wrapGroupDimensions.maxChildSizePerWrapGroup[e];t&&(this.wrapGroupDimensions.maxChildSizePerWrapGroup[e]=void 0,--this.wrapGroupDimensions.numberOfKnownWrapGroupChildSizes,this.wrapGroupDimensions.sumOfKnownWrapGroupChildWidths-=t.childWidth||0,this.wrapGroupDimensions.sumOfKnownWrapGroupChildHeights-=t.childHeight||0)}else this.minMeasuredChildWidth=void 0,this.minMeasuredChildHeight=void 0;this.refresh_internal(!1)},e.prototype.scrollInto=function(e,t,i,r,n){void 0===t&&(t=!0),void 0===i&&(i=0),void 0===r&&(r=void 0),void 0===n&&(n=void 0);var o=this.items.indexOf(e);-1!==o&&this.scrollToIndex(o,t,i,r,n)},e.prototype.scrollToIndex=function(e,t,i,r,n){var o=this;void 0===t&&(t=!0),void 0===i&&(i=0),void 0===r&&(r=void 0),void 0===n&&(n=void 0);var s=5,l=function(){if(--s<=0)n&&n();else{var r=o.calculateDimensions(),a=Math.min(Math.max(e,0),r.itemCount-1);o.previousViewPort.startIndex!==a?o.scrollToIndex_internal(e,t,i,0,l):n&&n()}};this.scrollToIndex_internal(e,t,i,r,l)},e.prototype.scrollToIndex_internal=function(e,t,i,r,n){void 0===t&&(t=!0),void 0===i&&(i=0),void 0===r&&(r=void 0),void 0===n&&(n=void 0),r=void 0===r?this.scrollAnimationTime:r;var o=this.calculateDimensions(),s=this.calculatePadding(e,o)+i;t||(s-=o.wrapGroupsPerPage*o[this._childScrollDim]),this.scrollToPosition(s,r,n)},e.prototype.scrollToPosition=function(e,t,i){var n=this;void 0===t&&(t=void 0),void 0===i&&(i=void 0),e+=this.getElementsOffset(),t=void 0===t?this.scrollAnimationTime:t;var o,s=this.getScrollElement();if(this.currentTween&&(this.currentTween.stop(),this.currentTween=void 0),!t)return this.renderer.setProperty(s,this._scrollType,e),void this.refresh_internal(!1,i);var l={scrollPosition:s[this._scrollType]},a=new r.Tween(l).to({scrollPosition:e},t).easing(r.Easing.Quadratic.Out).onUpdate((function(e){isNaN(e.scrollPosition)||(n.renderer.setProperty(s,n._scrollType,e.scrollPosition),n.refresh_internal(!1))})).onStop((function(){cancelAnimationFrame(o)})).start(),h=function(t){a.isPlaying()&&(a.update(t),l.scrollPosition!==e?n.zone.runOutsideAngular((function(){o=requestAnimationFrame(h)})):n.refresh_internal(!1,i))};h(),this.currentTween=a},e.prototype.getElementSize=function(e){var t=e.getBoundingClientRect(),i=getComputedStyle(e),r=parseInt(i["margin-top"],10)||0,n=parseInt(i["margin-bottom"],10)||0,o=parseInt(i["margin-left"],10)||0,s=parseInt(i["margin-right"],10)||0;return{top:t.top+r,bottom:t.bottom+n,left:t.left+o,right:t.right+s,width:t.width+o+s,height:t.height+r+n}},e.prototype.checkScrollElementResized=function(){var e,t=this.getElementSize(this.getScrollElement());if(this.previousScrollBoundingRect){var i=Math.abs(t.width-this.previousScrollBoundingRect.width),r=Math.abs(t.height-this.previousScrollBoundingRect.height);e=i>this.resizeBypassRefreshThreshold||r>this.resizeBypassRefreshThreshold}else e=!0;e&&(this.previousScrollBoundingRect=t,t.width>0&&t.height>0&&this.refresh_internal(!1))},e.prototype.updateDirection=function(){this.horizontal?(this._invisiblePaddingProperty="width",this._offsetType="offsetLeft",this._pageOffsetType="pageXOffset",this._childScrollDim="childWidth",this._marginDir="margin-left",this._translateDir="translateX",this._scrollType="scrollLeft"):(this._invisiblePaddingProperty="height",this._offsetType="offsetTop",this._pageOffsetType="pageYOffset",this._childScrollDim="childHeight",this._marginDir="margin-top",this._translateDir="translateY",this._scrollType="scrollTop")},e.prototype.debounce=function(e,t){var i=this.throttleTrailing(e,t),r=function(){i.cancel(),i.apply(this,arguments)};return r.cancel=function(){i.cancel()},r},e.prototype.throttleTrailing=function(e,t){var i=void 0,r=arguments,n=function(){var n=this;r=arguments,i||(t<=0?e.apply(n,r):i=setTimeout((function(){i=void 0,e.apply(n,r)}),t))};return n.cancel=function(){i&&(clearTimeout(i),i=void 0)},n},e.prototype.refresh_internal=function(e,t,i){var r=this;if(void 0===t&&(t=void 0),void 0===i&&(i=2),e&&this.previousViewPort&&this.previousViewPort.scrollStartPosition>0){var n=this.previousViewPort,o=this.viewPortItems,s=t;t=function(){var e=r.previousViewPort.scrollLength-n.scrollLength;if(e>0&&r.viewPortItems){var t=o[0],i=r.items.findIndex((function(e){return r.compareItems(t,e)}));if(i>r.previousViewPort.startIndexWithBuffer){for(var l=!1,a=1;a<r.viewPortItems.length;++a)if(!r.compareItems(r.items[i+a],o[a])){l=!0;break}if(!l)return void r.scrollToPosition(r.previousViewPort.scrollStartPosition+e,0,s)}}s&&s()}}this.zone.runOutsideAngular((function(){requestAnimationFrame((function(){e&&r.resetWrapGroupDimensions();var n=r.calculateViewport(),o=e||n.startIndex!==r.previousViewPort.startIndex,s=e||n.endIndex!==r.previousViewPort.endIndex,l=n.scrollLength!==r.previousViewPort.scrollLength,a=n.padding!==r.previousViewPort.padding,h=n.scrollStartPosition!==r.previousViewPort.scrollStartPosition||n.scrollEndPosition!==r.previousViewPort.scrollEndPosition||n.maxScrollPosition!==r.previousViewPort.maxScrollPosition;if(r.previousViewPort=n,l&&r.renderer.setStyle(r.invisiblePaddingElementRef.nativeElement,r._invisiblePaddingProperty,n.scrollLength+"px"),a&&(r.useMarginInsteadOfTranslate?r.renderer.setStyle(r.contentElementRef.nativeElement,r._marginDir,n.padding+"px"):(r.renderer.setStyle(r.contentElementRef.nativeElement,"transform",r._translateDir+"("+n.padding+"px)"),r.renderer.setStyle(r.contentElementRef.nativeElement,"webkitTransform",r._translateDir+"("+n.padding+"px)"))),r.headerElementRef){var c=r.getScrollElement()[r._scrollType],d=r.getElementsOffset(),p=Math.max(c-n.padding-d+r.headerElementRef.nativeElement.clientHeight,0);r.renderer.setStyle(r.headerElementRef.nativeElement,"transform",r._translateDir+"("+p+"px)"),r.renderer.setStyle(r.headerElementRef.nativeElement,"webkitTransform",r._translateDir+"("+p+"px)")}var u=o||s?{startIndex:n.startIndex,endIndex:n.endIndex,scrollStartPosition:n.scrollStartPosition,scrollEndPosition:n.scrollEndPosition,startIndexWithBuffer:n.startIndexWithBuffer,endIndexWithBuffer:n.endIndexWithBuffer,maxScrollPosition:n.maxScrollPosition}:void 0;if(o||s||h){var f=function(){r.viewPortItems=n.startIndexWithBuffer>=0&&n.endIndexWithBuffer>=0?r.items.slice(n.startIndexWithBuffer,n.endIndexWithBuffer+1):[],r.vsUpdate.emit(r.viewPortItems),o&&r.vsStart.emit(u),s&&r.vsEnd.emit(u),(o||s)&&(r.changeDetectorRef.markForCheck(),r.vsChange.emit(u)),i>0?r.refresh_internal(!1,t,i-1):t&&t()};r.executeRefreshOutsideAngularZone?f():r.zone.run(f)}else{if(i>0&&(l||a))return void r.refresh_internal(!1,t,i-1);t&&t()}}))}))},e.prototype.getScrollElement=function(){return this.parentScroll instanceof Window?document.scrollingElement||document.documentElement||document.body:this.parentScroll||this.element.nativeElement},e.prototype.addScrollEventHandlers=function(){var e=this;if(!this.isAngularUniversalSSR){var t=this.getScrollElement();this.removeScrollEventHandlers(),this.zone.runOutsideAngular((function(){e.parentScroll instanceof Window?(e.disposeScrollHandler=e.renderer.listen("window","scroll",e.onScroll),e.disposeResizeHandler=e.renderer.listen("window","resize",e.onScroll)):(e.disposeScrollHandler=e.renderer.listen(t,"scroll",e.onScroll),e._checkResizeInterval>0&&(e.checkScrollElementResizedTimer=setInterval((function(){e.checkScrollElementResized()}),e._checkResizeInterval)))}))}},e.prototype.removeScrollEventHandlers=function(){this.checkScrollElementResizedTimer&&clearInterval(this.checkScrollElementResizedTimer),this.disposeScrollHandler&&(this.disposeScrollHandler(),this.disposeScrollHandler=void 0),this.disposeResizeHandler&&(this.disposeResizeHandler(),this.disposeResizeHandler=void 0)},e.prototype.getElementsOffset=function(){if(this.isAngularUniversalSSR)return 0;var e=0;if(this.containerElementRef&&this.containerElementRef.nativeElement&&(e+=this.containerElementRef.nativeElement[this._offsetType]),this.parentScroll){var t=this.getScrollElement(),i=this.getElementSize(this.element.nativeElement),r=this.getElementSize(t);this.horizontal?e+=i.left-r.left:e+=i.top-r.top,this.parentScroll instanceof Window||(e+=t[this._scrollType])}return e},e.prototype.countItemsPerWrapGroup=function(){if(this.isAngularUniversalSSR)return Math.round(this.horizontal?this.ssrViewportHeight/this.ssrChildHeight:this.ssrViewportWidth/this.ssrChildWidth);var e=this.horizontal?"offsetLeft":"offsetTop",t=(this.containerElementRef&&this.containerElementRef.nativeElement||this.contentElementRef.nativeElement).children,i=t?t.length:0;if(0===i)return 1;for(var r=t[0][e],n=1;n<i&&r===t[n][e];)++n;return n},e.prototype.getScrollStartPosition=function(){var e=void 0;return this.parentScroll instanceof Window&&(e=window[this._pageOffsetType]),e||this.getScrollElement()[this._scrollType]||0},e.prototype.resetWrapGroupDimensions=function(){var e=this.wrapGroupDimensions;if(this.invalidateAllCachedMeasurements(),this.enableUnequalChildrenSizes&&e&&0!==e.numberOfKnownWrapGroupChildSizes)for(var t=this.countItemsPerWrapGroup(),i=0;i<e.maxChildSizePerWrapGroup.length;++i){var r=e.maxChildSizePerWrapGroup[i];if(r&&r.items&&r.items.length){if(r.items.length!==t)return;for(var n=!1,o=t*i,s=0;s<t;++s)if(!this.compareItems(r.items[s],this.items[o+s])){n=!0;break}n||(++this.wrapGroupDimensions.numberOfKnownWrapGroupChildSizes,this.wrapGroupDimensions.sumOfKnownWrapGroupChildWidths+=r.childWidth||0,this.wrapGroupDimensions.sumOfKnownWrapGroupChildHeights+=r.childHeight||0,this.wrapGroupDimensions.maxChildSizePerWrapGroup[i]=r)}}},e.prototype.calculateDimensions=function(){var e=this.getScrollElement();this.calculatedScrollbarHeight=Math.max(Math.min(e.offsetHeight-e.clientHeight,25),this.calculatedScrollbarHeight),this.calculatedScrollbarWidth=Math.max(Math.min(e.offsetWidth-e.clientWidth,25),this.calculatedScrollbarWidth);var t,i,r,n=e.offsetWidth-(this.scrollbarWidth||this.calculatedScrollbarWidth||(this.horizontal?0:25)),o=e.offsetHeight-(this.scrollbarHeight||this.calculatedScrollbarHeight||(this.horizontal?25:0)),s=this.containerElementRef&&this.containerElementRef.nativeElement||this.contentElementRef.nativeElement,l=this.countItemsPerWrapGroup();if(this.isAngularUniversalSSR){n=this.ssrViewportWidth,o=this.ssrViewportHeight,i=this.ssrChildWidth,r=this.ssrChildHeight;var a=Math.max(Math.ceil(n/i),1),h=Math.max(Math.ceil(o/r),1);t=this.horizontal?a:h}else if(this.enableUnequalChildrenSizes){var c=e[this._scrollType]-(this.previousViewPort?this.previousViewPort.padding:0),d=this.previousViewPort.startIndexWithBuffer||0,p=Math.ceil(d/l),u=0,f=0,m=0,v=0;t=0;for(var g=0;g<s.children.length;++g){++d;W=s.children[g],C=this.getElementSize(W);if(u=Math.max(u,C.width),f=Math.max(f,C.height),d%l==0){var S=this.wrapGroupDimensions.maxChildSizePerWrapGroup[p];S&&(--this.wrapGroupDimensions.numberOfKnownWrapGroupChildSizes,this.wrapGroupDimensions.sumOfKnownWrapGroupChildWidths-=S.childWidth||0,this.wrapGroupDimensions.sumOfKnownWrapGroupChildHeights-=S.childHeight||0),++this.wrapGroupDimensions.numberOfKnownWrapGroupChildSizes;var w=this.items.slice(d-l,d);if(this.wrapGroupDimensions.maxChildSizePerWrapGroup[p]={childWidth:u,childHeight:f,items:w},this.wrapGroupDimensions.sumOfKnownWrapGroupChildWidths+=u,this.wrapGroupDimensions.sumOfKnownWrapGroupChildHeights+=f,this.horizontal){var y=Math.min(u,Math.max(n-m,0));if(c>0)y-=P=Math.min(c,y),c-=P;m+=y,y>0&&n>=m&&++t}else{var P,b=Math.min(f,Math.max(o-v,0));if(c>0)b-=P=Math.min(c,b),c-=P;v+=b,b>0&&o>=v&&++t}++p,u=0,f=0}}var I=this.wrapGroupDimensions.sumOfKnownWrapGroupChildWidths/this.wrapGroupDimensions.numberOfKnownWrapGroupChildSizes,x=this.wrapGroupDimensions.sumOfKnownWrapGroupChildHeights/this.wrapGroupDimensions.numberOfKnownWrapGroupChildSizes;i=this.childWidth||I||n,r=this.childHeight||x||o,this.horizontal?n>m&&(t+=Math.ceil((n-m)/i)):o>v&&(t+=Math.ceil((o-v)/r))}else{if(s.children.length>0){this.childWidth&&this.childHeight||(!this.minMeasuredChildWidth&&n>0&&(this.minMeasuredChildWidth=n),!this.minMeasuredChildHeight&&o>0&&(this.minMeasuredChildHeight=o));var W=s.children[0],C=this.getElementSize(W);this.minMeasuredChildWidth=Math.min(this.minMeasuredChildWidth,C.width),this.minMeasuredChildHeight=Math.min(this.minMeasuredChildHeight,C.height)}i=this.childWidth||this.minMeasuredChildWidth||n,r=this.childHeight||this.minMeasuredChildHeight||o;a=Math.max(Math.ceil(n/i),1),h=Math.max(Math.ceil(o/r),1);t=this.horizontal?a:h}var E=this.items.length,z=l*t,T=E/z,_=Math.ceil(E/l),O=0,M=this.horizontal?i:r;if(this.enableUnequalChildrenSizes){var R=0;for(g=0;g<_;++g){var G=this.wrapGroupDimensions.maxChildSizePerWrapGroup[g]&&this.wrapGroupDimensions.maxChildSizePerWrapGroup[g][this._childScrollDim];G?O+=G:++R}O+=Math.round(R*M)}else O=_*M;this.headerElementRef&&(O+=this.headerElementRef.nativeElement.clientHeight);var D=this.horizontal?n:o;return{itemCount:E,itemsPerWrapGroup:l,wrapGroupsPerPage:t,itemsPerPage:z,pageCount_fractional:T,childWidth:i,childHeight:r,scrollLength:O,viewportLength:D,maxScrollPosition:Math.max(O-D,0)}},e.prototype.calculatePadding=function(e,t){if(0===t.itemCount)return 0;var i=t[this._childScrollDim],r=Math.floor(e/t.itemsPerWrapGroup)||0;if(!this.enableUnequalChildrenSizes)return i*r;for(var n=0,o=0,s=0;s<r;++s){var l=this.wrapGroupDimensions.maxChildSizePerWrapGroup[s]&&this.wrapGroupDimensions.maxChildSizePerWrapGroup[s][this._childScrollDim];l?o+=l:++n}return o+=Math.round(n*i)},e.prototype.calculatePageInfo=function(e,t){var i=0;if(this.enableUnequalChildrenSizes)for(var r=Math.ceil(t.itemCount/t.itemsPerWrapGroup),n=0,o=t[this._childScrollDim],s=0;s<r;++s){var l=this.wrapGroupDimensions.maxChildSizePerWrapGroup[s]&&this.wrapGroupDimensions.maxChildSizePerWrapGroup[s][this._childScrollDim];if(e<(n+=l||o)){i=s/r;break}}else i=e/t.scrollLength;var a=Math.min(Math.max(i*t.pageCount_fractional,0),t.pageCount_fractional)*t.itemsPerPage,h=t.itemCount-t.itemsPerPage-1,c=Math.min(Math.floor(a),h);if(c-=c%t.itemsPerWrapGroup,this.stripedTable){var d=2*t.itemsPerWrapGroup;c%d!=0&&(c=Math.max(c-c%d,0))}var p=Math.ceil(a)+t.itemsPerPage-1,u=(p+1)%t.itemsPerWrapGroup;u>0&&(p+=t.itemsPerWrapGroup-u),isNaN(c)&&(c=0),isNaN(p)&&(p=0),c=Math.min(Math.max(c,0),t.itemCount-1),p=Math.min(Math.max(p,0),t.itemCount-1);var f=this.bufferAmount*t.itemsPerWrapGroup;return{startIndex:c,endIndex:p,startIndexWithBuffer:Math.min(Math.max(c-f,0),t.itemCount-1),endIndexWithBuffer:Math.min(Math.max(p+f,0),t.itemCount-1),scrollStartPosition:e,scrollEndPosition:e+t.viewportLength,maxScrollPosition:t.maxScrollPosition}},e.prototype.calculateViewport=function(){var e=this.calculateDimensions(),t=this.getElementsOffset(),i=this.getScrollStartPosition();i>e.scrollLength+t&&!(this.parentScroll instanceof Window)?i=e.scrollLength:i-=t,i=Math.max(0,i);var r=this.calculatePageInfo(i,e),n=this.calculatePadding(r.startIndexWithBuffer,e),o=e.scrollLength;return{startIndex:r.startIndex,endIndex:r.endIndex,startIndexWithBuffer:r.startIndexWithBuffer,endIndexWithBuffer:r.endIndexWithBuffer,padding:Math.round(n),scrollLength:Math.round(o),scrollStartPosition:r.scrollStartPosition,scrollEndPosition:r.scrollEndPosition,maxScrollPosition:r.maxScrollPosition}},e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:t.NgZone},{type:t.ChangeDetectorRef},{type:Object,decorators:[{type:t.Inject,args:[t.PLATFORM_ID]}]},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:["virtual-scroller-default-options"]}]}]},n([t.Input()],e.prototype,"executeRefreshOutsideAngularZone",void 0),n([t.Input()],e.prototype,"enableUnequalChildrenSizes",null),n([t.Input()],e.prototype,"RTL",void 0),n([t.Input()],e.prototype,"useMarginInsteadOfTranslate",void 0),n([t.Input()],e.prototype,"modifyOverflowStyleOfParentScroll",void 0),n([t.Input()],e.prototype,"stripedTable",void 0),n([t.Input()],e.prototype,"scrollbarWidth",void 0),n([t.Input()],e.prototype,"scrollbarHeight",void 0),n([t.Input()],e.prototype,"childWidth",void 0),n([t.Input()],e.prototype,"childHeight",void 0),n([t.Input()],e.prototype,"ssrChildWidth",void 0),n([t.Input()],e.prototype,"ssrChildHeight",void 0),n([t.Input()],e.prototype,"ssrViewportWidth",void 0),n([t.Input()],e.prototype,"ssrViewportHeight",void 0),n([t.Input()],e.prototype,"bufferAmount",null),n([t.Input()],e.prototype,"scrollAnimationTime",void 0),n([t.Input()],e.prototype,"resizeBypassRefreshThreshold",void 0),n([t.Input()],e.prototype,"scrollThrottlingTime",null),n([t.Input()],e.prototype,"scrollDebounceTime",null),n([t.Input()],e.prototype,"checkResizeInterval",null),n([t.Input()],e.prototype,"items",null),n([t.Input()],e.prototype,"compareItems",void 0),n([t.Input()],e.prototype,"horizontal",null),n([t.Input()],e.prototype,"parentScroll",null),n([t.Output()],e.prototype,"vsUpdate",void 0),n([t.Output()],e.prototype,"vsChange",void 0),n([t.Output()],e.prototype,"vsStart",void 0),n([t.Output()],e.prototype,"vsEnd",void 0),n([t.ViewChild("content",{read:t.ElementRef,static:!0})],e.prototype,"contentElementRef",void 0),n([t.ViewChild("invisiblePadding",{read:t.ElementRef,static:!0})],e.prototype,"invisiblePaddingElementRef",void 0),n([t.ContentChild("header",{read:t.ElementRef,static:!1})],e.prototype,"headerElementRef",void 0),n([t.ContentChild("container",{read:t.ElementRef,static:!1})],e.prototype,"containerElementRef",void 0),e=n([t.Component({selector:"virtual-scroller,[virtualScroller]",exportAs:"virtualScroller",template:'\n <div class="total-padding" #invisiblePadding></div>\n <div class="scrollable-content" #content>\n <ng-content></ng-content>\n </div>\n ',host:{"[class.horizontal]":"horizontal","[class.vertical]":"!horizontal","[class.selfScroll]":"!parentScroll","[class.rtl]":"RTL"},styles:["\n :host {\n position: relative;\n\t display: block;\n -webkit-overflow-scrolling: touch;\n }\n\n\t:host.horizontal.selfScroll {\n overflow-y: visible;\n overflow-x: auto;\n\t}\n\t\n\t:host.horizontal.selfScroll.rtl {\n\t\ttransform: scaleX(-1);\n\t}\n\n\t:host.vertical.selfScroll {\n overflow-y: auto;\n overflow-x: visible;\n\t}\n\n .scrollable-content {\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n max-width: 100vw;\n max-height: 100vh;\n position: absolute;\n }\n\n\t.scrollable-content ::ng-deep > * {\n\t\tbox-sizing: border-box;\n\t}\n\n\t:host.horizontal {\n\t\twhite-space: nowrap;\n\t}\n\n\t:host.horizontal .scrollable-content {\n\t\tdisplay: flex;\n\t}\n\n\t:host.horizontal .scrollable-content ::ng-deep > * {\n\t\tflex-shrink: 0;\n\t\tflex-grow: 0;\n\t\twhite-space: initial;\n\t}\n\n\t:host.horizontal.rtl .scrollable-content ::ng-deep > * {\n\t\ttransform:scaleX(-1);\n\t}\n\t\n .total-padding {\n width: 1px;\n opacity: 0;\n }\n\n :host.horizontal .total-padding {\n height: 100%;\n }\n "]}),o(4,t.Inject(t.PLATFORM_ID)),o(5,t.Optional()),o(5,t.Inject("virtual-scroller-default-options"))],e)}(),a=function(){function e(){}return e=n([t.NgModule({exports:[l],declarations:[l],imports:[i.CommonModule],providers:[{provide:"virtual-scroller-default-options",useFactory:s}]})],e)}();e.VIRTUAL_SCROLLER_DEFAULT_OPTIONS_FACTORY=s,e.VirtualScrollerComponent=l,e.VirtualScrollerModule=a,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=ngx-virtual-scroller.umd.min.js.map

149

fesm2015/ngx-virtual-scroller.js

@@ -1,3 +0,3 @@

import { __decorate, __metadata, __param } from 'tslib';
import { EventEmitter, Input, Output, ViewChild, ElementRef, ContentChild, Component, Inject, PLATFORM_ID, Optional, Renderer2, NgZone, ChangeDetectorRef, NgModule } from '@angular/core';
import { __decorate, __param } from 'tslib';
import { EventEmitter, ElementRef, Renderer2, NgZone, ChangeDetectorRef, Inject, PLATFORM_ID, Optional, Input, Output, ViewChild, ContentChild, Component, NgModule } from '@angular/core';
import { isPlatformServer, CommonModule } from '@angular/common';

@@ -26,6 +26,6 @@ import { Tween, Easing } from '@tweenjs/tween.js';

this._enableUnequalChildrenSizes = false;
this.RTL = false;
this.useMarginInsteadOfTranslate = false;
this.ssrViewportWidth = 1920;
this.ssrViewportHeight = 1080;
this._bufferAmount = 0;
this._items = [];

@@ -919,133 +919,105 @@ this.compareItems = (item1, item2) => item1 === item2;

};
VirtualScrollerComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: Renderer2 },
{ type: NgZone },
{ type: ChangeDetectorRef },
{ type: Object, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] },
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: ['virtual-scroller-default-options',] }] }
];
__decorate([
Input(),
__metadata("design:type", Boolean)
Input()
], VirtualScrollerComponent.prototype, "executeRefreshOutsideAngularZone", void 0);
__decorate([
Input(),
__metadata("design:type", Boolean),
__metadata("design:paramtypes", [Boolean])
Input()
], VirtualScrollerComponent.prototype, "enableUnequalChildrenSizes", null);
__decorate([
Input(),
__metadata("design:type", Boolean)
Input()
], VirtualScrollerComponent.prototype, "RTL", void 0);
__decorate([
Input()
], VirtualScrollerComponent.prototype, "useMarginInsteadOfTranslate", void 0);
__decorate([
Input(),
__metadata("design:type", Boolean)
Input()
], VirtualScrollerComponent.prototype, "modifyOverflowStyleOfParentScroll", void 0);
__decorate([
Input(),
__metadata("design:type", Boolean)
Input()
], VirtualScrollerComponent.prototype, "stripedTable", void 0);
__decorate([
Input(),
__metadata("design:type", Number)
Input()
], VirtualScrollerComponent.prototype, "scrollbarWidth", void 0);
__decorate([
Input(),
__metadata("design:type", Number)
Input()
], VirtualScrollerComponent.prototype, "scrollbarHeight", void 0);
__decorate([
Input(),
__metadata("design:type", Number)
Input()
], VirtualScrollerComponent.prototype, "childWidth", void 0);
__decorate([
Input(),
__metadata("design:type", Number)
Input()
], VirtualScrollerComponent.prototype, "childHeight", void 0);
__decorate([
Input(),
__metadata("design:type", Number)
Input()
], VirtualScrollerComponent.prototype, "ssrChildWidth", void 0);
__decorate([
Input(),
__metadata("design:type", Number)
Input()
], VirtualScrollerComponent.prototype, "ssrChildHeight", void 0);
__decorate([
Input(),
__metadata("design:type", Number)
Input()
], VirtualScrollerComponent.prototype, "ssrViewportWidth", void 0);
__decorate([
Input(),
__metadata("design:type", Number)
Input()
], VirtualScrollerComponent.prototype, "ssrViewportHeight", void 0);
__decorate([
Input(),
__metadata("design:type", Number),
__metadata("design:paramtypes", [Number])
Input()
], VirtualScrollerComponent.prototype, "bufferAmount", null);
__decorate([
Input(),
__metadata("design:type", Number)
Input()
], VirtualScrollerComponent.prototype, "scrollAnimationTime", void 0);
__decorate([
Input(),
__metadata("design:type", Number)
Input()
], VirtualScrollerComponent.prototype, "resizeBypassRefreshThreshold", void 0);
__decorate([
Input(),
__metadata("design:type", Number),
__metadata("design:paramtypes", [Number])
Input()
], VirtualScrollerComponent.prototype, "scrollThrottlingTime", null);
__decorate([
Input(),
__metadata("design:type", Number),
__metadata("design:paramtypes", [Number])
Input()
], VirtualScrollerComponent.prototype, "scrollDebounceTime", null);
__decorate([
Input(),
__metadata("design:type", Number),
__metadata("design:paramtypes", [Number])
Input()
], VirtualScrollerComponent.prototype, "checkResizeInterval", null);
__decorate([
Input(),
__metadata("design:type", Array),
__metadata("design:paramtypes", [Array])
Input()
], VirtualScrollerComponent.prototype, "items", null);
__decorate([
Input(),
__metadata("design:type", Function)
Input()
], VirtualScrollerComponent.prototype, "compareItems", void 0);
__decorate([
Input(),
__metadata("design:type", Boolean),
__metadata("design:paramtypes", [Boolean])
Input()
], VirtualScrollerComponent.prototype, "horizontal", null);
__decorate([
Input(),
__metadata("design:type", Object),
__metadata("design:paramtypes", [Object])
Input()
], VirtualScrollerComponent.prototype, "parentScroll", null);
__decorate([
Output(),
__metadata("design:type", EventEmitter)
Output()
], VirtualScrollerComponent.prototype, "vsUpdate", void 0);
__decorate([
Output(),
__metadata("design:type", EventEmitter)
Output()
], VirtualScrollerComponent.prototype, "vsChange", void 0);
__decorate([
Output(),
__metadata("design:type", EventEmitter)
Output()
], VirtualScrollerComponent.prototype, "vsStart", void 0);
__decorate([
Output(),
__metadata("design:type", EventEmitter)
Output()
], VirtualScrollerComponent.prototype, "vsEnd", void 0);
__decorate([
ViewChild('content', { read: ElementRef, static: false }),
__metadata("design:type", ElementRef)
ViewChild('content', { read: ElementRef, static: true })
], VirtualScrollerComponent.prototype, "contentElementRef", void 0);
__decorate([
ViewChild('invisiblePadding', { read: ElementRef, static: false }),
__metadata("design:type", ElementRef)
ViewChild('invisiblePadding', { read: ElementRef, static: true })
], VirtualScrollerComponent.prototype, "invisiblePaddingElementRef", void 0);
__decorate([
ContentChild('header', { read: ElementRef, static: false }),
__metadata("design:type", ElementRef)
ContentChild('header', { read: ElementRef, static: false })
], VirtualScrollerComponent.prototype, "headerElementRef", void 0);
__decorate([
ContentChild('container', { read: ElementRef, static: false }),
__metadata("design:type", ElementRef)
ContentChild('container', { read: ElementRef, static: false })
], VirtualScrollerComponent.prototype, "containerElementRef", void 0);

@@ -1065,3 +1037,4 @@ VirtualScrollerComponent = __decorate([

'[class.vertical]': "!horizontal",
'[class.selfScroll]': "!parentScroll"
'[class.selfScroll]': "!parentScroll",
'[class.rtl]': "RTL"
},

@@ -1074,3 +1047,3 @@ styles: [`

}
:host.horizontal.selfScroll {

@@ -1080,2 +1053,7 @@ overflow-y: visible;

}
:host.horizontal.selfScroll.rtl {
transform: scaleX(-1);
}
:host.vertical.selfScroll {

@@ -1085,3 +1063,3 @@ overflow-y: auto;

}
.scrollable-content {

@@ -1100,11 +1078,11 @@ top: 0;

}
:host.horizontal {
white-space: nowrap;
}
:host.horizontal .scrollable-content {
display: flex;
}
:host.horizontal .scrollable-content ::ng-deep > * {

@@ -1115,2 +1093,6 @@ flex-shrink: 0;

}
:host.horizontal.rtl .scrollable-content ::ng-deep > * {
transform:scaleX(-1);
}

@@ -1121,3 +1103,3 @@ .total-padding {

}
:host.horizontal .total-padding {

@@ -1129,8 +1111,3 @@ height: 100%;

__param(4, Inject(PLATFORM_ID)),
__param(5, Optional()), __param(5, Inject('virtual-scroller-default-options')),
__metadata("design:paramtypes", [ElementRef,
Renderer2,
NgZone,
ChangeDetectorRef,
Object, Object])
__param(5, Optional()), __param(5, Inject('virtual-scroller-default-options'))
], VirtualScrollerComponent);

@@ -1137,0 +1114,0 @@ let VirtualScrollerModule = class VirtualScrollerModule {

@@ -1,4 +0,4 @@

import { __decorate, __metadata, __param } from 'tslib';
import { Input, Output, EventEmitter, ViewChild, ElementRef, ContentChild, Component, Inject, PLATFORM_ID, Optional, Renderer2, NgZone, ChangeDetectorRef, NgModule } from '@angular/core';
import { CommonModule, isPlatformServer } from '@angular/common';
import { __decorate, __param } from 'tslib';
import { EventEmitter, ElementRef, Renderer2, NgZone, ChangeDetectorRef, Inject, PLATFORM_ID, Optional, Input, Output, ViewChild, ContentChild, Component, NgModule } from '@angular/core';
import { isPlatformServer, CommonModule } from '@angular/common';
import { Tween, Easing } from '@tweenjs/tween.js';

@@ -26,6 +26,6 @@

this._enableUnequalChildrenSizes = false;
this.RTL = false;
this.useMarginInsteadOfTranslate = false;
this.ssrViewportWidth = 1920;
this.ssrViewportHeight = 1080;
this._bufferAmount = 0;
this._items = [];

@@ -975,133 +975,105 @@ this.compareItems = function (item1, item2) { return item1 === item2; };

};
VirtualScrollerComponent.ctorParameters = function () { return [
{ type: ElementRef },
{ type: Renderer2 },
{ type: NgZone },
{ type: ChangeDetectorRef },
{ type: Object, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] },
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: ['virtual-scroller-default-options',] }] }
]; };
__decorate([
Input(),
__metadata("design:type", Boolean)
Input()
], VirtualScrollerComponent.prototype, "executeRefreshOutsideAngularZone", void 0);
__decorate([
Input(),
__metadata("design:type", Boolean),
__metadata("design:paramtypes", [Boolean])
Input()
], VirtualScrollerComponent.prototype, "enableUnequalChildrenSizes", null);
__decorate([
Input(),
__metadata("design:type", Boolean)
Input()
], VirtualScrollerComponent.prototype, "RTL", void 0);
__decorate([
Input()
], VirtualScrollerComponent.prototype, "useMarginInsteadOfTranslate", void 0);
__decorate([
Input(),
__metadata("design:type", Boolean)
Input()
], VirtualScrollerComponent.prototype, "modifyOverflowStyleOfParentScroll", void 0);
__decorate([
Input(),
__metadata("design:type", Boolean)
Input()
], VirtualScrollerComponent.prototype, "stripedTable", void 0);
__decorate([
Input(),
__metadata("design:type", Number)
Input()
], VirtualScrollerComponent.prototype, "scrollbarWidth", void 0);
__decorate([
Input(),
__metadata("design:type", Number)
Input()
], VirtualScrollerComponent.prototype, "scrollbarHeight", void 0);
__decorate([
Input(),
__metadata("design:type", Number)
Input()
], VirtualScrollerComponent.prototype, "childWidth", void 0);
__decorate([
Input(),
__metadata("design:type", Number)
Input()
], VirtualScrollerComponent.prototype, "childHeight", void 0);
__decorate([
Input(),
__metadata("design:type", Number)
Input()
], VirtualScrollerComponent.prototype, "ssrChildWidth", void 0);
__decorate([
Input(),
__metadata("design:type", Number)
Input()
], VirtualScrollerComponent.prototype, "ssrChildHeight", void 0);
__decorate([
Input(),
__metadata("design:type", Number)
Input()
], VirtualScrollerComponent.prototype, "ssrViewportWidth", void 0);
__decorate([
Input(),
__metadata("design:type", Number)
Input()
], VirtualScrollerComponent.prototype, "ssrViewportHeight", void 0);
__decorate([
Input(),
__metadata("design:type", Number),
__metadata("design:paramtypes", [Number])
Input()
], VirtualScrollerComponent.prototype, "bufferAmount", null);
__decorate([
Input(),
__metadata("design:type", Number)
Input()
], VirtualScrollerComponent.prototype, "scrollAnimationTime", void 0);
__decorate([
Input(),
__metadata("design:type", Number)
Input()
], VirtualScrollerComponent.prototype, "resizeBypassRefreshThreshold", void 0);
__decorate([
Input(),
__metadata("design:type", Number),
__metadata("design:paramtypes", [Number])
Input()
], VirtualScrollerComponent.prototype, "scrollThrottlingTime", null);
__decorate([
Input(),
__metadata("design:type", Number),
__metadata("design:paramtypes", [Number])
Input()
], VirtualScrollerComponent.prototype, "scrollDebounceTime", null);
__decorate([
Input(),
__metadata("design:type", Number),
__metadata("design:paramtypes", [Number])
Input()
], VirtualScrollerComponent.prototype, "checkResizeInterval", null);
__decorate([
Input(),
__metadata("design:type", Array),
__metadata("design:paramtypes", [Array])
Input()
], VirtualScrollerComponent.prototype, "items", null);
__decorate([
Input(),
__metadata("design:type", Function)
Input()
], VirtualScrollerComponent.prototype, "compareItems", void 0);
__decorate([
Input(),
__metadata("design:type", Boolean),
__metadata("design:paramtypes", [Boolean])
Input()
], VirtualScrollerComponent.prototype, "horizontal", null);
__decorate([
Input(),
__metadata("design:type", Object),
__metadata("design:paramtypes", [Object])
Input()
], VirtualScrollerComponent.prototype, "parentScroll", null);
__decorate([
Output(),
__metadata("design:type", EventEmitter)
Output()
], VirtualScrollerComponent.prototype, "vsUpdate", void 0);
__decorate([
Output(),
__metadata("design:type", EventEmitter)
Output()
], VirtualScrollerComponent.prototype, "vsChange", void 0);
__decorate([
Output(),
__metadata("design:type", EventEmitter)
Output()
], VirtualScrollerComponent.prototype, "vsStart", void 0);
__decorate([
Output(),
__metadata("design:type", EventEmitter)
Output()
], VirtualScrollerComponent.prototype, "vsEnd", void 0);
__decorate([
ViewChild('content', { read: ElementRef, static: false }),
__metadata("design:type", ElementRef)
ViewChild('content', { read: ElementRef, static: true })
], VirtualScrollerComponent.prototype, "contentElementRef", void 0);
__decorate([
ViewChild('invisiblePadding', { read: ElementRef, static: false }),
__metadata("design:type", ElementRef)
ViewChild('invisiblePadding', { read: ElementRef, static: true })
], VirtualScrollerComponent.prototype, "invisiblePaddingElementRef", void 0);
__decorate([
ContentChild('header', { read: ElementRef, static: false }),
__metadata("design:type", ElementRef)
ContentChild('header', { read: ElementRef, static: false })
], VirtualScrollerComponent.prototype, "headerElementRef", void 0);
__decorate([
ContentChild('container', { read: ElementRef, static: false }),
__metadata("design:type", ElementRef)
ContentChild('container', { read: ElementRef, static: false })
], VirtualScrollerComponent.prototype, "containerElementRef", void 0);

@@ -1116,13 +1088,9 @@ VirtualScrollerComponent = __decorate([

'[class.vertical]': "!horizontal",
'[class.selfScroll]': "!parentScroll"
'[class.selfScroll]': "!parentScroll",
'[class.rtl]': "RTL"
},
styles: ["\n :host {\n position: relative;\n\t display: block;\n -webkit-overflow-scrolling: touch;\n }\n\t\n\t:host.horizontal.selfScroll {\n overflow-y: visible;\n overflow-x: auto;\n\t}\n\t:host.vertical.selfScroll {\n overflow-y: auto;\n overflow-x: visible;\n\t}\n\t\n .scrollable-content {\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n max-width: 100vw;\n max-height: 100vh;\n position: absolute;\n }\n\n\t.scrollable-content ::ng-deep > * {\n\t\tbox-sizing: border-box;\n\t}\n\t\n\t:host.horizontal {\n\t\twhite-space: nowrap;\n\t}\n\t\n\t:host.horizontal .scrollable-content {\n\t\tdisplay: flex;\n\t}\n\t\n\t:host.horizontal .scrollable-content ::ng-deep > * {\n\t\tflex-shrink: 0;\n\t\tflex-grow: 0;\n\t\twhite-space: initial;\n\t}\n\t\n .total-padding {\n width: 1px;\n opacity: 0;\n }\n \n :host.horizontal .total-padding {\n height: 100%;\n }\n "]
styles: ["\n :host {\n position: relative;\n\t display: block;\n -webkit-overflow-scrolling: touch;\n }\n\n\t:host.horizontal.selfScroll {\n overflow-y: visible;\n overflow-x: auto;\n\t}\n\t\n\t:host.horizontal.selfScroll.rtl {\n\t\ttransform: scaleX(-1);\n\t}\n\n\t:host.vertical.selfScroll {\n overflow-y: auto;\n overflow-x: visible;\n\t}\n\n .scrollable-content {\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n max-width: 100vw;\n max-height: 100vh;\n position: absolute;\n }\n\n\t.scrollable-content ::ng-deep > * {\n\t\tbox-sizing: border-box;\n\t}\n\n\t:host.horizontal {\n\t\twhite-space: nowrap;\n\t}\n\n\t:host.horizontal .scrollable-content {\n\t\tdisplay: flex;\n\t}\n\n\t:host.horizontal .scrollable-content ::ng-deep > * {\n\t\tflex-shrink: 0;\n\t\tflex-grow: 0;\n\t\twhite-space: initial;\n\t}\n\n\t:host.horizontal.rtl .scrollable-content ::ng-deep > * {\n\t\ttransform:scaleX(-1);\n\t}\n\t\n .total-padding {\n width: 1px;\n opacity: 0;\n }\n\n :host.horizontal .total-padding {\n height: 100%;\n }\n "]
}),
__param(4, Inject(PLATFORM_ID)),
__param(5, Optional()), __param(5, Inject('virtual-scroller-default-options')),
__metadata("design:paramtypes", [ElementRef,
Renderer2,
NgZone,
ChangeDetectorRef,
Object, Object])
__param(5, Optional()), __param(5, Inject('virtual-scroller-default-options'))
], VirtualScrollerComponent);

@@ -1129,0 +1097,0 @@ return VirtualScrollerComponent;

@@ -1,1 +0,1 @@

{"__symbolic":"module","version":4,"metadata":{"VirtualScrollerDefaultOptions":{"__symbolic":"interface"},"VIRTUAL_SCROLLER_DEFAULT_OPTIONS_FACTORY":{"__symbolic":"function","parameters":[],"value":{"scrollThrottlingTime":0,"scrollDebounceTime":0,"scrollAnimationTime":750,"checkResizeInterval":1000,"resizeBypassRefreshThreshold":5,"modifyOverflowStyleOfParentScroll":true,"stripedTable":false}},"WrapGroupDimensions":{"__symbolic":"interface"},"WrapGroupDimension":{"__symbolic":"interface"},"IDimensions":{"__symbolic":"interface"},"IPageInfo":{"__symbolic":"interface"},"IViewport":{"__symbolic":"interface"},"VirtualScrollerComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":92,"character":1},"arguments":[{"selector":"virtual-scroller,[virtualScroller]","exportAs":"virtualScroller","template":"\n <div class=\"total-padding\" #invisiblePadding></div>\n <div class=\"scrollable-content\" #content>\n <ng-content></ng-content>\n </div>\n ","host":{"[class.horizontal]":"horizontal","[class.vertical]":"!horizontal","[class.selfScroll]":"!parentScroll","$quoted$":["[class.horizontal]","[class.vertical]","[class.selfScroll]"]},"styles":["\n :host {\n position: relative;\n\t display: block;\n -webkit-overflow-scrolling: touch;\n }\n\t\n\t:host.horizontal.selfScroll {\n overflow-y: visible;\n overflow-x: auto;\n\t}\n\t:host.vertical.selfScroll {\n overflow-y: auto;\n overflow-x: visible;\n\t}\n\t\n .scrollable-content {\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n max-width: 100vw;\n max-height: 100vh;\n position: absolute;\n }\n\n\t.scrollable-content ::ng-deep > * {\n\t\tbox-sizing: border-box;\n\t}\n\t\n\t:host.horizontal {\n\t\twhite-space: nowrap;\n\t}\n\t\n\t:host.horizontal .scrollable-content {\n\t\tdisplay: flex;\n\t}\n\t\n\t:host.horizontal .scrollable-content ::ng-deep > * {\n\t\tflex-shrink: 0;\n\t\tflex-grow: 0;\n\t\twhite-space: initial;\n\t}\n\t\n .total-padding {\n width: 1px;\n opacity: 0;\n }\n \n :host.horizontal .total-padding {\n height: 100%;\n }\n "]}]}],"members":{"executeRefreshOutsideAngularZone":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":177,"character":2}}]}],"enableUnequalChildrenSizes":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":181,"character":2}}]}],"useMarginInsteadOfTranslate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":195,"character":2}}]}],"modifyOverflowStyleOfParentScroll":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":198,"character":2}}]}],"stripedTable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":201,"character":2}}]}],"scrollbarWidth":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":204,"character":2}}]}],"scrollbarHeight":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":207,"character":2}}]}],"childWidth":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":210,"character":2}}]}],"childHeight":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":213,"character":2}}]}],"ssrChildWidth":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":216,"character":2}}]}],"ssrChildHeight":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":219,"character":2}}]}],"ssrViewportWidth":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":222,"character":2}}]}],"ssrViewportHeight":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":225,"character":2}}]}],"bufferAmount":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":229,"character":2}}]}],"scrollAnimationTime":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":241,"character":2}}]}],"resizeBypassRefreshThreshold":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":244,"character":2}}]}],"scrollThrottlingTime":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":248,"character":2}}]}],"scrollDebounceTime":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":258,"character":2}}]}],"updateOnScrollFunction":[{"__symbolic":"method"}],"checkResizeInterval":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":288,"character":2}}]}],"items":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":302,"character":2}}]}],"compareItems":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":315,"character":2}}]}],"horizontal":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":319,"character":2}}]}],"revertParentOverscroll":[{"__symbolic":"method"}],"parentScroll":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":340,"character":2}}]}],"vsUpdate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":361,"character":2}}]}],"vsChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":364,"character":2}}]}],"vsStart":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":367,"character":2}}]}],"vsEnd":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":370,"character":2}}]}],"contentElementRef":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":373,"character":2},"arguments":["content",{"read":{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":373,"character":31},"static":false}]}]}],"invisiblePaddingElementRef":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":376,"character":2},"arguments":["invisiblePadding",{"read":{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":376,"character":40},"static":false}]}]}],"headerElementRef":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":379,"character":2},"arguments":["header",{"read":{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":379,"character":33},"static":false}]}]}],"containerElementRef":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":382,"character":2},"arguments":["container",{"read":{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":382,"character":36},"static":false}]}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"ngDoCheck":[{"__symbolic":"method"}],"refresh":[{"__symbolic":"method"}],"invalidateAllCachedMeasurements":[{"__symbolic":"method"}],"invalidateCachedMeasurementForItem":[{"__symbolic":"method"}],"invalidateCachedMeasurementAtIndex":[{"__symbolic":"method"}],"scrollInto":[{"__symbolic":"method"}],"scrollToIndex":[{"__symbolic":"method"}],"scrollToIndex_internal":[{"__symbolic":"method"}],"scrollToPosition":[{"__symbolic":"method"}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,null,null,null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":584,"character":3},"arguments":[{"__symbolic":"reference","module":"@angular/core","name":"PLATFORM_ID","line":584,"character":10}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":585,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":585,"character":15},"arguments":["virtual-scroller-default-options"]}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":580,"character":41},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":581,"character":31},{"__symbolic":"reference","module":"@angular/core","name":"NgZone","line":582,"character":27},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":583,"character":31},{"__symbolic":"reference","name":"Object"},{"__symbolic":"reference","name":"any"}]}],"getElementSize":[{"__symbolic":"method"}],"checkScrollElementResized":[{"__symbolic":"method"}],"updateDirection":[{"__symbolic":"method"}],"debounce":[{"__symbolic":"method"}],"throttleTrailing":[{"__symbolic":"method"}],"refresh_internal":[{"__symbolic":"method"}],"getScrollElement":[{"__symbolic":"method"}],"addScrollEventHandlers":[{"__symbolic":"method"}],"removeScrollEventHandlers":[{"__symbolic":"method"}],"getElementsOffset":[{"__symbolic":"method"}],"countItemsPerWrapGroup":[{"__symbolic":"method"}],"getScrollStartPosition":[{"__symbolic":"method"}],"resetWrapGroupDimensions":[{"__symbolic":"method"}],"calculateDimensions":[{"__symbolic":"method"}],"calculatePadding":[{"__symbolic":"method"}],"calculatePageInfo":[{"__symbolic":"method"}],"calculateViewport":[{"__symbolic":"method"}]}},"VirtualScrollerModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":1317,"character":1},"arguments":[{"exports":[{"__symbolic":"reference","name":"VirtualScrollerComponent"}],"declarations":[{"__symbolic":"reference","name":"VirtualScrollerComponent"}],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":1320,"character":11}],"providers":[{"provide":"virtual-scroller-default-options","useFactory":{"__symbolic":"reference","name":"VIRTUAL_SCROLLER_DEFAULT_OPTIONS_FACTORY"}}]}]}],"members":{}}},"origins":{"VirtualScrollerDefaultOptions":"./virtual-scroller","VIRTUAL_SCROLLER_DEFAULT_OPTIONS_FACTORY":"./virtual-scroller","WrapGroupDimensions":"./virtual-scroller","WrapGroupDimension":"./virtual-scroller","IDimensions":"./virtual-scroller","IPageInfo":"./virtual-scroller","IViewport":"./virtual-scroller","VirtualScrollerComponent":"./virtual-scroller","VirtualScrollerModule":"./virtual-scroller"},"importAs":"ngx-virtual-scroller"}
{"__symbolic":"module","version":4,"metadata":{"VirtualScrollerDefaultOptions":{"__symbolic":"interface"},"VIRTUAL_SCROLLER_DEFAULT_OPTIONS_FACTORY":{"__symbolic":"function","parameters":[],"value":{"scrollThrottlingTime":0,"scrollDebounceTime":0,"scrollAnimationTime":750,"checkResizeInterval":1000,"resizeBypassRefreshThreshold":5,"modifyOverflowStyleOfParentScroll":true,"stripedTable":false}},"WrapGroupDimensions":{"__symbolic":"interface"},"WrapGroupDimension":{"__symbolic":"interface"},"IDimensions":{"__symbolic":"interface"},"IPageInfo":{"__symbolic":"interface"},"IViewport":{"__symbolic":"interface"},"VirtualScrollerComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":92,"character":1},"arguments":[{"selector":"virtual-scroller,[virtualScroller]","exportAs":"virtualScroller","template":"\n <div class=\"total-padding\" #invisiblePadding></div>\n <div class=\"scrollable-content\" #content>\n <ng-content></ng-content>\n </div>\n ","host":{"[class.horizontal]":"horizontal","[class.vertical]":"!horizontal","[class.selfScroll]":"!parentScroll","[class.rtl]":"RTL","$quoted$":["[class.horizontal]","[class.vertical]","[class.selfScroll]","[class.rtl]"]},"styles":["\n :host {\n position: relative;\n\t display: block;\n -webkit-overflow-scrolling: touch;\n }\n\n\t:host.horizontal.selfScroll {\n overflow-y: visible;\n overflow-x: auto;\n\t}\n\t\n\t:host.horizontal.selfScroll.rtl {\n\t\ttransform: scaleX(-1);\n\t}\n\n\t:host.vertical.selfScroll {\n overflow-y: auto;\n overflow-x: visible;\n\t}\n\n .scrollable-content {\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n max-width: 100vw;\n max-height: 100vh;\n position: absolute;\n }\n\n\t.scrollable-content ::ng-deep > * {\n\t\tbox-sizing: border-box;\n\t}\n\n\t:host.horizontal {\n\t\twhite-space: nowrap;\n\t}\n\n\t:host.horizontal .scrollable-content {\n\t\tdisplay: flex;\n\t}\n\n\t:host.horizontal .scrollable-content ::ng-deep > * {\n\t\tflex-shrink: 0;\n\t\tflex-grow: 0;\n\t\twhite-space: initial;\n\t}\n\n\t:host.horizontal.rtl .scrollable-content ::ng-deep > * {\n\t\ttransform:scaleX(-1);\n\t}\n\t\n .total-padding {\n width: 1px;\n opacity: 0;\n }\n\n :host.horizontal .total-padding {\n height: 100%;\n }\n "]}]}],"members":{"executeRefreshOutsideAngularZone":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":187,"character":2}}]}],"enableUnequalChildrenSizes":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":191,"character":2}}]}],"RTL":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":204,"character":2}}]}],"useMarginInsteadOfTranslate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":207,"character":2}}]}],"modifyOverflowStyleOfParentScroll":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":210,"character":2}}]}],"stripedTable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":213,"character":2}}]}],"scrollbarWidth":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":216,"character":2}}]}],"scrollbarHeight":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":219,"character":2}}]}],"childWidth":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":222,"character":2}}]}],"childHeight":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":225,"character":2}}]}],"ssrChildWidth":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":228,"character":2}}]}],"ssrChildHeight":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":231,"character":2}}]}],"ssrViewportWidth":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":234,"character":2}}]}],"ssrViewportHeight":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":237,"character":2}}]}],"bufferAmount":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":241,"character":2}}]}],"scrollAnimationTime":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":253,"character":2}}]}],"resizeBypassRefreshThreshold":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":256,"character":2}}]}],"scrollThrottlingTime":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":260,"character":2}}]}],"scrollDebounceTime":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":270,"character":2}}]}],"updateOnScrollFunction":[{"__symbolic":"method"}],"checkResizeInterval":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":300,"character":2}}]}],"items":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":314,"character":2}}]}],"compareItems":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":327,"character":2}}]}],"horizontal":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":331,"character":2}}]}],"revertParentOverscroll":[{"__symbolic":"method"}],"parentScroll":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":352,"character":2}}]}],"vsUpdate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":373,"character":2}}]}],"vsChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":376,"character":2}}]}],"vsStart":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":379,"character":2}}]}],"vsEnd":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":382,"character":2}}]}],"contentElementRef":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":385,"character":2},"arguments":["content",{"read":{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":385,"character":31},"static":true}]}]}],"invisiblePaddingElementRef":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":388,"character":2},"arguments":["invisiblePadding",{"read":{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":388,"character":40},"static":true}]}]}],"headerElementRef":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":391,"character":2},"arguments":["header",{"read":{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":391,"character":33},"static":false}]}]}],"containerElementRef":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":394,"character":2},"arguments":["container",{"read":{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":394,"character":36},"static":false}]}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"ngDoCheck":[{"__symbolic":"method"}],"refresh":[{"__symbolic":"method"}],"invalidateAllCachedMeasurements":[{"__symbolic":"method"}],"invalidateCachedMeasurementForItem":[{"__symbolic":"method"}],"invalidateCachedMeasurementAtIndex":[{"__symbolic":"method"}],"scrollInto":[{"__symbolic":"method"}],"scrollToIndex":[{"__symbolic":"method"}],"scrollToIndex_internal":[{"__symbolic":"method"}],"scrollToPosition":[{"__symbolic":"method"}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,null,null,null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":596,"character":3},"arguments":[{"__symbolic":"reference","module":"@angular/core","name":"PLATFORM_ID","line":596,"character":10}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":597,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":597,"character":15},"arguments":["virtual-scroller-default-options"]}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":592,"character":41},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":593,"character":31},{"__symbolic":"reference","module":"@angular/core","name":"NgZone","line":594,"character":27},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":595,"character":31},{"__symbolic":"reference","name":"Object"},{"__symbolic":"reference","name":"any"}]}],"getElementSize":[{"__symbolic":"method"}],"checkScrollElementResized":[{"__symbolic":"method"}],"updateDirection":[{"__symbolic":"method"}],"debounce":[{"__symbolic":"method"}],"throttleTrailing":[{"__symbolic":"method"}],"refresh_internal":[{"__symbolic":"method"}],"getScrollElement":[{"__symbolic":"method"}],"addScrollEventHandlers":[{"__symbolic":"method"}],"removeScrollEventHandlers":[{"__symbolic":"method"}],"getElementsOffset":[{"__symbolic":"method"}],"countItemsPerWrapGroup":[{"__symbolic":"method"}],"getScrollStartPosition":[{"__symbolic":"method"}],"resetWrapGroupDimensions":[{"__symbolic":"method"}],"calculateDimensions":[{"__symbolic":"method"}],"calculatePadding":[{"__symbolic":"method"}],"calculatePageInfo":[{"__symbolic":"method"}],"calculateViewport":[{"__symbolic":"method"}]}},"VirtualScrollerModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":1329,"character":1},"arguments":[{"exports":[{"__symbolic":"reference","name":"VirtualScrollerComponent"}],"declarations":[{"__symbolic":"reference","name":"VirtualScrollerComponent"}],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":1332,"character":11}],"providers":[{"provide":"virtual-scroller-default-options","useFactory":{"__symbolic":"reference","name":"VIRTUAL_SCROLLER_DEFAULT_OPTIONS_FACTORY"}}]}]}],"members":{}}},"origins":{"VirtualScrollerDefaultOptions":"./virtual-scroller","VIRTUAL_SCROLLER_DEFAULT_OPTIONS_FACTORY":"./virtual-scroller","WrapGroupDimensions":"./virtual-scroller","WrapGroupDimension":"./virtual-scroller","IDimensions":"./virtual-scroller","IPageInfo":"./virtual-scroller","IViewport":"./virtual-scroller","VirtualScrollerComponent":"./virtual-scroller","VirtualScrollerModule":"./virtual-scroller"},"importAs":"ngx-virtual-scroller"}
{
"$schema": "./node_modules/ng-packagr/package.schema.json",
"name": "ngx-virtual-scroller",
"version": "3.0.3",
"version": "4.0.1",
"description": "Angular module for virtual -infinite- list. Supports horizontal/vertical, variable heights, & multi-column",

@@ -37,37 +37,8 @@ "main": "bundles/ngx-virtual-scroller.umd.js",

"peerDependencies": {
"@angular/core": ">=6.0.0"
"@angular/core": ">=6.0.0",
"tslib": "^1.10.0"
},
"dependencies": {
"@tweenjs/tween.js": "17.4.0",
"@types/tween.js": "17.2.0",
"tslib": "^1.9.0"
"@tweenjs/tween.js": "18.5.0"
},
"devDependencies": {
"@angular/cli": "8.0.0",
"@angular/common": "8.0.0",
"@angular/compiler": "8.0.0",
"@angular/compiler-cli": "8.0.0",
"@angular/core": "8.0.0",
"@angular/forms": "8.0.0",
"@angular/http": "7.2.15",
"@angular/language-service": "8.0.0",
"@angular/platform-browser": "8.0.0",
"@angular/platform-browser-dynamic": "8.0.0",
"@angular/router": "8.0.0",
"@types/node": "12.0.3",
"@types/tween.js": "17.2.0",
"codelyzer": "5.0.1",
"copyfiles": "^2.1.0",
"core-js": "3.1.3",
"ng-packagr": "5.2.0",
"npm-check": "5.9.0",
"replace": "1.1.0",
"replace-x": "^1.5.0",
"rimraf": "2.6.3",
"rxjs": "6.5.2",
"tslib": "^1.9.0",
"tslint": "5.16.0",
"typescript": "3.4.5",
"zone.js": "0.9.1"
},
"module": "fesm5/ngx-virtual-scroller.js",

@@ -74,0 +45,0 @@ "es2015": "fesm2015/ngx-virtual-scroller.js",

@@ -45,2 +45,3 @@ # Sponsors

## New features:
* RTL Support on Horizontal scrollers
* Support for fixed <thead> on <table> elements.

@@ -94,3 +95,3 @@ * Added API to query for current scroll px position (also passed as argument to IPageInfo listeners)

```sh
npm install ngx-virtual-scroller --save
npm install ngx-virtual-scroller
```

@@ -206,2 +207,3 @@

| executeRefreshOutsideAngularZone | boolean | Defaults to false. Disables full-app Angular ChangeDetection while scrolling, which can give a performance boost. Requires developer to manually execute change detection on any components which may have changed. USE WITH CAUTION - Read the "Performance" section below.
| RTL | boolean | Defaults to false. Set to true if you want horizontal slider to support RTL.

@@ -678,8 +680,9 @@ Note: The Events without the "vs" prefix have been deprecated because they might conflict with native DOM events due to their "bubbling" nature. See https://github.com/angular/angular/issues/13997

Note: executeRefreshOutsideAngularZone will disable Angular ChangeDetection during all virtual-scroller events, including: vsUpdate, vsStart, vsEnd, vsChange. If you change any data-bound properties inside these event handlers, you must perform manual change detection on those specific components. This can be done via changeDetectorRef.detectChanges() at the end of the event handler. Note: The changeDetectorRef is component-specific, so you'll need to inject it into a private variable in the constructor of the appropriate component before calling it in response to the virtual-scroller events.
WARNING - Failure to performa manual change detection in response to virtual-scroller events will cause your components to render a stale UI for a short time (until the next Change Detection cycle), which will make your app feel buggy.
Note - changeDetectorRef.detectChanges() will execute change detection on the component and all its nested children. If multiple components need to run change detection in response to a virtual-scroller event, you can call detectChanges from a higher-level component in the ancestor hierarchy rather than on each individual component. However, its important to avoid too many extra change detection cycles by not going too high in the hierarchy unless all the nested children really need to have change detection performed.
:warning: WARNING - Failure to perform manual change detection in response to _virtual-scroller_ events will cause your components to render a stale UI for a short time (until the next Change Detection cycle), which will make your app feel buggy.
Note - All virtual-scroller events are emitted at the same time in response to its internal "refresh" function. Some of these event emitters are bypassed if certain criteria don't apply. however vsUpdate will always be emitted. For this reason, you should consolidate all data-bound property changes & manual change detection into the vsUpdate event handler, to avoid duplicate change detection cycles from executing during the other virtual-scroller events.
*Note* - changeDetectorRef.detectChanges() will execute change detection on the component and all its nested children. If multiple components need to run change detection in response to a virtual-scroller event, you can call detectChanges from a higher-level component in the ancestor hierarchy rather than on each individual component. However, its important to avoid too many extra change detection cycles by not going too high in the hierarchy unless all the nested children really need to have change detection performed.
*Note* - All virtual-scroller events are emitted at the same time in response to its internal "refresh" function. Some of these event emitters are bypassed if certain criteria don't apply. however vsUpdate will always be emitted. For this reason, you should consolidate all data-bound property changes & manual change detection into the vsUpdate event handler, to avoid duplicate change detection cycles from executing during the other virtual-scroller events.
In the above code example, (vsUpdate)="changeDetectorRef.detectChanges()" is necessary because scroll.viewPortItems was changed internally be virtual-scroller during its internal "render" function before emitting (vsUpdate). executeRefreshOutsideAngularZone prevents MainComponent from refreshing its data-binding in response to this change, so a manual Change Detection cycle must be run. No extra manual change detection code is necessary for virtual-scroller or my-custom-component, even if their data-bound properties have changed, because they're nested children of MainComponent.

@@ -686,0 +689,0 @@

@@ -58,7 +58,9 @@ /// <reference types="tween.js" />

viewPortItems: any[];
window: Window;
readonly viewPortInfo: IPageInfo;
window: Window & typeof globalThis;
get viewPortInfo(): IPageInfo;
executeRefreshOutsideAngularZone: boolean;
protected _enableUnequalChildrenSizes: boolean;
enableUnequalChildrenSizes: boolean;
get enableUnequalChildrenSizes(): boolean;
set enableUnequalChildrenSizes(value: boolean);
RTL: boolean;
useMarginInsteadOfTranslate: boolean;

@@ -76,9 +78,12 @@ modifyOverflowStyleOfParentScroll: boolean;

protected _bufferAmount: number;
bufferAmount: number;
get bufferAmount(): number;
set bufferAmount(value: number);
scrollAnimationTime: number;
resizeBypassRefreshThreshold: number;
protected _scrollThrottlingTime: number;
scrollThrottlingTime: number;
get scrollThrottlingTime(): number;
set scrollThrottlingTime(value: number);
protected _scrollDebounceTime: number;
scrollDebounceTime: number;
get scrollDebounceTime(): number;
set scrollDebounceTime(value: number);
protected onScroll: () => void;

@@ -88,8 +93,11 @@ protected updateOnScrollFunction(): void;

protected _checkResizeInterval: number;
checkResizeInterval: number;
get checkResizeInterval(): number;
set checkResizeInterval(value: number);
protected _items: any[];
items: any[];
get items(): any[];
set items(value: any[]);
compareItems: (item1: any, item2: any) => boolean;
protected _horizontal: boolean;
horizontal: boolean;
get horizontal(): boolean;
set horizontal(value: boolean);
protected revertParentOverscroll(): void;

@@ -101,3 +109,4 @@ protected oldParentScrollOverflow: {

protected _parentScroll: Element | Window;
parentScroll: Element | Window;
get parentScroll(): Element | Window;
set parentScroll(value: Element | Window);
vsUpdate: EventEmitter<any[]>;

@@ -104,0 +113,0 @@ vsChange: EventEmitter<IPageInfo>;

Sorry, the diff of this file is too big to display

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 too big to display

Sorry, the diff of this file is too big to display

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc