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

front-angular-vs-repeat

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

front-angular-vs-repeat - npm Package Compare versions

Comparing version 1.1.7-2 to 1.1.7-3

2

package.json
{
"name": "front-angular-vs-repeat",
"version": "1.1.7-2",
"version": "1.1.7-3",
"description": "Virtual Scroll for AngularJS ngRepeat directive",

@@ -5,0 +5,0 @@ "homepage": "http://kamilkp.github.io/angular-vs-repeat",

@@ -362,2 +362,3 @@ //

$scrollParent.on('scroll', scrollHandler);
$scrollParent.on('mousewheel', scrollHandler);

@@ -364,0 +365,0 @@ function onWindowResize() {

@@ -5,2 +5,2 @@ //

//
!function(a,b){"use strict";function c(){if("pageYOffset"in a)return{scrollTop:pageYOffset,scrollLeft:pageXOffset};var b,c,d=document,e=d.documentElement,f=d.body;return b=e.scrollLeft||f.scrollLeft||0,c=e.scrollTop||f.scrollTop||0,{scrollTop:c,scrollLeft:b}}function d(b,c){return b===a?"clientWidth"===c?a.innerWidth:a.innerHeight:b[c]}function e(b,d){return b===a?c()[d]:b[d]}function f(b,d,e){var f=b.getBoundingClientRect()[e?"left":"top"],g=d===a?0:d.getBoundingClientRect()[e?"left":"top"],h=f-g+(d===a?c():d)[e?"scrollLeft":"scrollTop"];return h}var g=document.documentElement,h=g.matches?"matches":g.matchesSelector?"matchesSelector":g.webkitMatches?"webkitMatches":g.webkitMatchesSelector?"webkitMatchesSelector":g.msMatches?"msMatches":g.msMatchesSelector?"msMatchesSelector":g.mozMatches?"mozMatches":g.mozMatchesSelector?"mozMatchesSelector":null,i=b.element.prototype.closest||function(a){for(var c=this[0].parentNode;c!==document.documentElement&&null!=c&&!c[h](a);)c=c.parentNode;return c&&c[h](a)?b.element(c):b.element()},j="[ng-repeat]",k=b.module("vs-repeat",[]).directive("vsRepeat",["$compile","$parse",function(c,g){return{restrict:"A",scope:!0,compile:function(h,k){var l,m,n,o,p,q,r=b.isDefined(k.vsRepeatContainer)?b.element(h[0].querySelector(k.vsRepeatContainer)):h,s=r.children(j).eq(0),t=s[0].outerHTML,u="$vs_collection",v={vsRepeat:"elementSize",vsOffsetBefore:"offsetBefore",vsOffsetAfter:"offsetAfter",vsScrolledToEndOffset:"scrolledToEndOffset",vsExcess:"excess"};if(!(s.length>0))throw new Error("angular-vs-repeat: no ng-repeat directive on a child element");q="ng-repeat",l=s.attr("ng-repeat");var w=s.prev(),x=s.next();return m=/^\s*(\S+)\s+in\s+([\S\s]+?)(track\s+by\s+\S+)?$/.exec(l),n=m[1],o=m[2],p=m[3],s.remove(),{pre:function(h,j,k){function l(){if(!H||H.length<1)h[u]=[],D=0,h.sizesCumulative=[0];else if(D=H.length,M){h.sizes=H.map(function(a){var c=h.$new(!1);b.extend(c,a),c[n]=a;var d=k.vsSize||k.vsSizeProperty?c.$eval(k.vsSize||k.vsSizeProperty):h.elementSize;return c.$destroy(),d});var a=0;h.sizesCumulative=h.sizes.map(function(b){var c=a;return a+=b,c}),h.sizesCumulative.push(a)}else m();z()}function m(){L&&h.$$postDigest(function(){if(E[0].offsetHeight||E[0].offsetWidth){for(var a=w.length>0?w.nextUntil(x):x.length>0?x.prevAll():E.children(),b=0,c=!1,d=!1;b<a.length;){if(null!=a[b].attributes[q]||d){c||(h.elementSize=0),c=!0,a[b][Q]&&(h.elementSize+=a[b][Q]);break}b++}c&&(z(),L=!1,h.$root&&!h.$root.$$phase&&h.$apply())}else var e=h.$watch(function(){(E[0].offsetHeight||E[0].offsetWidth)&&(e(),m())})})}function r(){var a="tr"===G?"":"min-",b=I?a+"width":a+"height";return b}function s(){C()&&h.$digest()}function y(){"undefined"!=typeof k.vsAutoresize&&(L=!0,m(),h.$root&&!h.$root.$$phase&&h.$apply()),C()&&h.$apply()}function z(){S=void 0,T=void 0,U=D,V=0,A(M?h.sizesCumulative[D]:h.elementSize*D),C(),h.$emit("vsRepeatReinitialized",h.startIndex,h.endIndex)}function A(a){h.totalSize=h.offsetBefore+a+h.offsetAfter}function B(){var a=d(N[0],P);a!==W&&(z(),h.$root&&!h.$root.$$phase&&h.$apply()),W=a}function C(){var a=e(N[0],R),b=d(N[0],P),c=E[0]===N[0]?0:f(E[0],N[0],I),i=h.startIndex,j=h.endIndex;if(M){for(i=0;h.sizesCumulative[i]<a-h.offsetBefore-c;)i++;for(i>0&&i--,i=Math.max(Math.floor(i-h.excess/2),0),j=i;h.sizesCumulative[j]<a-h.offsetBefore-c+b;)j++;j=Math.min(Math.ceil(j+h.excess/2),D)}else i=Math.max(Math.floor((a-h.offsetBefore-c)/h.elementSize)-h.excess/2,0),j=Math.min(i+Math.ceil(b/h.elementSize)+h.excess,D);U=Math.min(i,U),V=Math.max(j,V),h.startIndex=O.latch?U:i,h.endIndex=O.latch?V:j;var l=!1;if(null==S?l=!0:null==T&&(l=!0),l||(O.hunked?Math.abs(h.startIndex-S)>=h.excess/2||0===h.startIndex&&0!==S?l=!0:(Math.abs(h.endIndex-T)>=h.excess/2||h.endIndex===D&&T!==D)&&(l=!0):l=h.startIndex!==S||h.endIndex!==T),l){if(h[u]=H.slice(h.startIndex,h.endIndex),h.$emit("vsRepeatInnerCollectionUpdated",h.startIndex,h.endIndex,S,T),k.vsScrolledToEnd){var m=H.length-(h.scrolledToEndOffset||0);(h.endIndex>=m&&T<m||H.length&&h.endIndex===H.length)&&h.$eval(k.vsScrolledToEnd)}S=h.startIndex,T=h.endIndex;var n=M?"(sizesCumulative[$index + startIndex] + offsetBefore)":"(($index + startIndex) * elementSize + offsetBefore)",o=g(n),p=o(h,{$index:0}),q=o(h,{$index:h[u].length}),s=h.totalSize;J.css(r(),p+"px"),K.css(r(),s-q+"px")}return l}var D,E=b.isDefined(k.vsRepeatContainer)?b.element(j[0].querySelector(k.vsRepeatContainer)):j,F=b.element(t),G=F[0].tagName.toLowerCase(),H=[],I="undefined"!=typeof k.vsHorizontal,J=b.element("<"+G+' class="vs-repeat-before-content"></'+G+">"),K=b.element("<"+G+' class="vs-repeat-after-content"></'+G+">"),L=!k.vsRepeat,M=!!k.vsSize||!!k.vsSizeProperty,N=k.vsScrollParent?"window"===k.vsScrollParent?b.element(a):i.call(E,k.vsScrollParent):E,O="vsOptions"in k?h.$eval(k.vsOptions):{},P=I?"clientWidth":"clientHeight",Q=I?"offsetWidth":"offsetHeight",R=I?"scrollLeft":"scrollTop";if(h.totalSize=0,!("vsSize"in k)&&"vsSizeProperty"in k&&console.warn("vs-size-property attribute is deprecated. Please use vs-size attribute which also accepts angular expressions."),0===N.length)throw"Specified scroll parent selector did not match any element";h.$scrollParent=N,M&&(h.sizesCumulative=[]),h.elementSize=+k.vsRepeat||d(N[0],P)||50,h.offsetBefore=0,h.offsetAfter=0,h.excess=2,I?(J.css("height","100%"),K.css("height","100%")):(J.css("width","100%"),K.css("width","100%")),Object.keys(v).forEach(function(a){k[a]&&k.$observe(a,function(b){h[v[a]]=+b,z()})}),h.$watchCollection(o,function(a){H=a||[],l()}),F.eq(0).attr(q,n+" in "+u+(p?" "+p:"")),F.addClass("vs-repeat-repeated-element"),x.length>0?(x.before(J),x.before(F),c(F)(h),x.before(K)):(E.append(J),E.append(F),c(F)(h),E.append(K)),h.startIndex=0,h.endIndex=0,N.on("scroll",s),b.element(a).on("resize",y),h.$on("$destroy",function(){b.element(a).off("resize",y),N.off("scroll",s)}),h.$on("vsRepeatTrigger",l),h.$on("vsRepeatResize",function(){L=!0,m()}),h.$on("vsResetScroll",function(){N[0].scrollTop=0,N[0].scrollLeft=0});var S,T,U,V;h.$on("vsRenderAll",function(){O.latch&&setTimeout(function(){var a=D;V=Math.max(a,V),h.endIndex=O.latch?V:a,h[u]=H.slice(h.startIndex,h.endIndex),T=h.endIndex,h.$$postDigest(function(){J.css(r(),0),K.css(r(),0)}),h.$apply(function(){h.$emit("vsRenderAllDone")})})});var W;h.$watch(function(){"function"==typeof a.requestAnimationFrame?a.requestAnimationFrame(B):B()})}}}}}]);"undefined"!=typeof module&&module.exports&&(module.exports=k.name)}(window,window.angular);
!function(a,b){"use strict";function c(){if("pageYOffset"in a)return{scrollTop:pageYOffset,scrollLeft:pageXOffset};var b,c,d=document,e=d.documentElement,f=d.body;return b=e.scrollLeft||f.scrollLeft||0,c=e.scrollTop||f.scrollTop||0,{scrollTop:c,scrollLeft:b}}function d(b,c){return b===a?"clientWidth"===c?a.innerWidth:a.innerHeight:b[c]}function e(b,d){return b===a?c()[d]:b[d]}function f(b,d,e){var f=b.getBoundingClientRect()[e?"left":"top"],g=d===a?0:d.getBoundingClientRect()[e?"left":"top"],h=f-g+(d===a?c():d)[e?"scrollLeft":"scrollTop"];return h}var g=document.documentElement,h=g.matches?"matches":g.matchesSelector?"matchesSelector":g.webkitMatches?"webkitMatches":g.webkitMatchesSelector?"webkitMatchesSelector":g.msMatches?"msMatches":g.msMatchesSelector?"msMatchesSelector":g.mozMatches?"mozMatches":g.mozMatchesSelector?"mozMatchesSelector":null,i=b.element.prototype.closest||function(a){for(var c=this[0].parentNode;c!==document.documentElement&&null!=c&&!c[h](a);)c=c.parentNode;return c&&c[h](a)?b.element(c):b.element()},j="[ng-repeat]",k=b.module("vs-repeat",[]).directive("vsRepeat",["$compile","$parse",function(c,g){return{restrict:"A",scope:!0,compile:function(h,k){var l,m,n,o,p,q,r=b.isDefined(k.vsRepeatContainer)?b.element(h[0].querySelector(k.vsRepeatContainer)):h,s=r.children(j).eq(0),t=s[0].outerHTML,u="$vs_collection",v={vsRepeat:"elementSize",vsOffsetBefore:"offsetBefore",vsOffsetAfter:"offsetAfter",vsScrolledToEndOffset:"scrolledToEndOffset",vsExcess:"excess"};if(!(s.length>0))throw new Error("angular-vs-repeat: no ng-repeat directive on a child element");q="ng-repeat",l=s.attr("ng-repeat");var w=s.prev(),x=s.next();return m=/^\s*(\S+)\s+in\s+([\S\s]+?)(track\s+by\s+\S+)?$/.exec(l),n=m[1],o=m[2],p=m[3],s.remove(),{pre:function(h,j,k){function l(){if(!H||H.length<1)h[u]=[],D=0,h.sizesCumulative=[0];else if(D=H.length,M){h.sizes=H.map(function(a){var c=h.$new(!1);b.extend(c,a),c[n]=a;var d=k.vsSize||k.vsSizeProperty?c.$eval(k.vsSize||k.vsSizeProperty):h.elementSize;return c.$destroy(),d});var a=0;h.sizesCumulative=h.sizes.map(function(b){var c=a;return a+=b,c}),h.sizesCumulative.push(a)}else m();z()}function m(){L&&h.$$postDigest(function(){if(E[0].offsetHeight||E[0].offsetWidth){for(var a=w.length>0?w.nextUntil(x):x.length>0?x.prevAll():E.children(),b=0,c=!1,d=!1;b<a.length;){if(null!=a[b].attributes[q]||d){c||(h.elementSize=0),c=!0,a[b][Q]&&(h.elementSize+=a[b][Q]);break}b++}c&&(z(),L=!1,h.$root&&!h.$root.$$phase&&h.$apply())}else var e=h.$watch(function(){(E[0].offsetHeight||E[0].offsetWidth)&&(e(),m())})})}function r(){var a="tr"===G?"":"min-",b=I?a+"width":a+"height";return b}function s(){C()&&h.$digest()}function y(){"undefined"!=typeof k.vsAutoresize&&(L=!0,m(),h.$root&&!h.$root.$$phase&&h.$apply()),C()&&h.$apply()}function z(){S=void 0,T=void 0,U=D,V=0,A(M?h.sizesCumulative[D]:h.elementSize*D),C(),h.$emit("vsRepeatReinitialized",h.startIndex,h.endIndex)}function A(a){h.totalSize=h.offsetBefore+a+h.offsetAfter}function B(){var a=d(N[0],P);a!==W&&(z(),h.$root&&!h.$root.$$phase&&h.$apply()),W=a}function C(){var a=e(N[0],R),b=d(N[0],P),c=E[0]===N[0]?0:f(E[0],N[0],I),i=h.startIndex,j=h.endIndex;if(M){for(i=0;h.sizesCumulative[i]<a-h.offsetBefore-c;)i++;for(i>0&&i--,i=Math.max(Math.floor(i-h.excess/2),0),j=i;h.sizesCumulative[j]<a-h.offsetBefore-c+b;)j++;j=Math.min(Math.ceil(j+h.excess/2),D)}else i=Math.max(Math.floor((a-h.offsetBefore-c)/h.elementSize)-h.excess/2,0),j=Math.min(i+Math.ceil(b/h.elementSize)+h.excess,D);U=Math.min(i,U),V=Math.max(j,V),h.startIndex=O.latch?U:i,h.endIndex=O.latch?V:j;var l=!1;if(null==S?l=!0:null==T&&(l=!0),l||(O.hunked?Math.abs(h.startIndex-S)>=h.excess/2||0===h.startIndex&&0!==S?l=!0:(Math.abs(h.endIndex-T)>=h.excess/2||h.endIndex===D&&T!==D)&&(l=!0):l=h.startIndex!==S||h.endIndex!==T),l){if(h[u]=H.slice(h.startIndex,h.endIndex),h.$emit("vsRepeatInnerCollectionUpdated",h.startIndex,h.endIndex,S,T),k.vsScrolledToEnd){var m=H.length-(h.scrolledToEndOffset||0);(h.endIndex>=m&&T<m||H.length&&h.endIndex===H.length)&&h.$eval(k.vsScrolledToEnd)}S=h.startIndex,T=h.endIndex;var n=M?"(sizesCumulative[$index + startIndex] + offsetBefore)":"(($index + startIndex) * elementSize + offsetBefore)",o=g(n),p=o(h,{$index:0}),q=o(h,{$index:h[u].length}),s=h.totalSize;J.css(r(),p+"px"),K.css(r(),s-q+"px")}return l}var D,E=b.isDefined(k.vsRepeatContainer)?b.element(j[0].querySelector(k.vsRepeatContainer)):j,F=b.element(t),G=F[0].tagName.toLowerCase(),H=[],I="undefined"!=typeof k.vsHorizontal,J=b.element("<"+G+' class="vs-repeat-before-content"></'+G+">"),K=b.element("<"+G+' class="vs-repeat-after-content"></'+G+">"),L=!k.vsRepeat,M=!!k.vsSize||!!k.vsSizeProperty,N=k.vsScrollParent?"window"===k.vsScrollParent?b.element(a):i.call(E,k.vsScrollParent):E,O="vsOptions"in k?h.$eval(k.vsOptions):{},P=I?"clientWidth":"clientHeight",Q=I?"offsetWidth":"offsetHeight",R=I?"scrollLeft":"scrollTop";if(h.totalSize=0,!("vsSize"in k)&&"vsSizeProperty"in k&&console.warn("vs-size-property attribute is deprecated. Please use vs-size attribute which also accepts angular expressions."),0===N.length)throw"Specified scroll parent selector did not match any element";h.$scrollParent=N,M&&(h.sizesCumulative=[]),h.elementSize=+k.vsRepeat||d(N[0],P)||50,h.offsetBefore=0,h.offsetAfter=0,h.excess=2,I?(J.css("height","100%"),K.css("height","100%")):(J.css("width","100%"),K.css("width","100%")),Object.keys(v).forEach(function(a){k[a]&&k.$observe(a,function(b){h[v[a]]=+b,z()})}),h.$watchCollection(o,function(a){H=a||[],l()}),F.eq(0).attr(q,n+" in "+u+(p?" "+p:"")),F.addClass("vs-repeat-repeated-element"),x.length>0?(x.before(J),x.before(F),c(F)(h),x.before(K)):(E.append(J),E.append(F),c(F)(h),E.append(K)),h.startIndex=0,h.endIndex=0,N.on("scroll",s),N.on("mousewheel",s),b.element(a).on("resize",y),h.$on("$destroy",function(){b.element(a).off("resize",y),N.off("scroll",s)}),h.$on("vsRepeatTrigger",l),h.$on("vsRepeatResize",function(){L=!0,m()}),h.$on("vsResetScroll",function(){N[0].scrollTop=0,N[0].scrollLeft=0});var S,T,U,V;h.$on("vsRenderAll",function(){O.latch&&setTimeout(function(){var a=D;V=Math.max(a,V),h.endIndex=O.latch?V:a,h[u]=H.slice(h.startIndex,h.endIndex),T=h.endIndex,h.$$postDigest(function(){J.css(r(),0),K.css(r(),0)}),h.$apply(function(){h.$emit("vsRenderAllDone")})})});var W;h.$watch(function(){"function"==typeof a.requestAnimationFrame?a.requestAnimationFrame(B):B()})}}}}}]);"undefined"!=typeof module&&module.exports&&(module.exports=k.name)}(window,window.angular);
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc