angular-ui-scroll
Advanced tools
Comparing version 1.7.0-rc.2 to 1.7.0-rc.3
@@ -11,7 +11,5 @@ angular.module('application', ['ui.scroll']) | ||
$scope.hello = 'Hello Main Controller!'; | ||
var counter = 0; | ||
var reloadListener = $scope.$on('DO_RELOAD', function() { | ||
if ($scope.adapter) { | ||
counter = 0; | ||
$scope.adapter.reload(); | ||
@@ -25,6 +23,7 @@ } | ||
var min = -1000, max = 1000, delay = 0; | ||
var min = -50, max = 100, delay = 0; | ||
$scope.datasource = { | ||
get: function(index, count, success) { | ||
console.log('Getting ' + count + ' items started from ' + index + '...'); | ||
setTimeout(function() { | ||
@@ -36,3 +35,3 @@ var result = []; | ||
for (var i = start; i <= end; i++) { | ||
height = 50 + (counter++ * 2); | ||
height = 50 + (i + 1); | ||
result.push({ index: i, height: height }); | ||
@@ -39,0 +38,0 @@ } |
/*! | ||
* angular-ui-scroll (uncompressed) | ||
* https://github.com/angular-ui/ui-scroll | ||
* Version: 1.7.0-rc.2 -- 2017-09-29T16:03:15.269Z | ||
* Version: 1.7.0-rc.3 -- 2017-10-26T19:56:45.415Z | ||
* License: MIT | ||
@@ -6,0 +6,0 @@ */ |
/*! | ||
* angular-ui-scroll (compressed) | ||
* https://github.com/angular-ui/ui-scroll | ||
* Version: 1.7.0-rc.2 -- 2017-09-29T16:03:15.814Z | ||
* Version: 1.7.0-rc.3 -- 2017-10-26T19:56:45.454Z | ||
* License: MIT | ||
@@ -6,0 +6,0 @@ */ |
/*! | ||
* angular-ui-scroll (uncompressed) | ||
* https://github.com/angular-ui/ui-scroll | ||
* Version: 1.7.0-rc.2 -- 2017-09-29T16:03:15.269Z | ||
* Version: 1.7.0-rc.3 -- 2017-10-26T19:56:45.415Z | ||
* License: MIT | ||
@@ -941,3 +941,3 @@ */ | ||
buffer.next -= overage; | ||
viewport.adjustPadding(); | ||
viewport.adjustPaddings(); | ||
} | ||
@@ -974,3 +974,3 @@ }, | ||
}, | ||
adjustPadding: function adjustPadding() { | ||
adjustPaddings: function adjustPaddings() { | ||
if (!buffer.length) { | ||
@@ -1004,3 +1004,3 @@ return; | ||
}, | ||
adjustScrollTopAfterMinIndexSet: function adjustScrollTopAfterMinIndexSet(topPaddingHeightOld) { | ||
onAfterMinIndexSet: function onAfterMinIndexSet(topPaddingHeightOld) { | ||
// additional scrollTop adjustment in case of datasource.minIndex external set | ||
@@ -1010,5 +1010,10 @@ if (buffer.minIndexUser !== null && buffer.minIndex > buffer.minIndexUser) { | ||
viewport.scrollTop(viewport.scrollTop() + diff); | ||
diff -= viewport.scrollTop(); | ||
if (diff > 0) { | ||
bottomPadding.height(bottomPadding.height() + diff); | ||
viewport.scrollTop(viewport.scrollTop() + diff); | ||
} | ||
} | ||
}, | ||
adjustScrollTopAfterPrepend: function adjustScrollTopAfterPrepend(updates) { | ||
onAfterPrepend: function onAfterPrepend(updates) { | ||
if (!updates.prepended.length) return; | ||
@@ -1096,2 +1101,6 @@ var height = buffer.effectiveHeight(updates.prepended); | ||
if (template.nodeType !== Node.ELEMENT_NODE) { | ||
throw new Error('ui-scroll directive requires an Element node for templating the view'); | ||
} | ||
switch (template.tagName.toLowerCase()) { | ||
@@ -1226,28 +1235,48 @@ case 'dl': | ||
var indexStore = {}; | ||
var onRenderHandlers = []; | ||
function onRenderHandlersRunner() { | ||
if (onRenderHandlers.length) { | ||
angular.forEach(onRenderHandlers, function (handler) { | ||
return handler(); | ||
}); | ||
onRenderHandlers = []; | ||
} | ||
} | ||
function preDefineIndexProperty(datasource, propName) { | ||
var getter = void 0; | ||
// need to postpone min/maxIndexUser processing if the view is empty | ||
if (datasource.hasOwnProperty(propName) && !buffer.length) { | ||
getter = datasource[propName]; | ||
delete datasource[propName]; | ||
onRenderHandlers.push(function () { | ||
return datasource[propName] = getter; | ||
}); | ||
} | ||
} | ||
function defineProperty(datasource, propName, propUserName) { | ||
function defineIndexProperty(datasource, propName, propUserName) { | ||
var descriptor = Object.getOwnPropertyDescriptor(datasource, propName); | ||
if (!descriptor || !descriptor.set && !descriptor.get) { | ||
Object.defineProperty(datasource, propName, { | ||
set: function set(value) { | ||
indexStore[propName] = value; | ||
buffer[propUserName] = value; | ||
if (!pending.length) { | ||
var topPaddingHeightOld = viewport.topDataPos(); | ||
viewport.adjustPadding(); | ||
if (propName === 'minIndex') { | ||
viewport.adjustScrollTopAfterMinIndexSet(topPaddingHeightOld); | ||
} | ||
} | ||
}, | ||
get: function get() { | ||
return indexStore[propName]; | ||
if (descriptor && (descriptor.set || descriptor.get)) { | ||
return; | ||
} | ||
var getter = void 0; | ||
preDefineIndexProperty(datasource, propName); | ||
Object.defineProperty(datasource, propName, { | ||
set: function set(value) { | ||
getter = value; | ||
buffer[propUserName] = value; | ||
var topPaddingHeightOld = viewport.topDataPos(); | ||
viewport.adjustPaddings(); | ||
if (propName === 'minIndex') { | ||
viewport.onAfterMinIndexSet(topPaddingHeightOld); | ||
} | ||
}); | ||
} | ||
}, | ||
get: function get() { | ||
return getter; | ||
} | ||
}); | ||
} | ||
defineProperty(datasource, 'minIndex', 'minIndexUser'); | ||
defineProperty(datasource, 'maxIndex', 'maxIndexUser'); | ||
defineIndexProperty(datasource, 'minIndex', 'minIndexUser'); | ||
defineIndexProperty(datasource, 'maxIndex', 'maxIndexUser'); | ||
@@ -1435,7 +1464,7 @@ var fetchNext = datasource.get.length !== 2 ? function (success) { | ||
$q.all(updates.animated).then(function () { | ||
viewport.adjustPadding(); | ||
viewport.adjustPaddings(); | ||
adjustBuffer(rid); | ||
}); | ||
} else { | ||
viewport.adjustPadding(); | ||
viewport.adjustPaddings(); | ||
} | ||
@@ -1476,3 +1505,3 @@ } | ||
// We need the item bindings to be processed before we can do adjustment | ||
!$scope.$$phase && $scope.$digest(); | ||
!$scope.$$phase && !$scope.$root.$$phase && $scope.$digest(); | ||
@@ -1502,3 +1531,3 @@ updates.inserted.forEach(function (w) { | ||
// We need the item bindings to be processed before we can do adjustment | ||
!$scope.$$phase && $scope.$digest(); | ||
!$scope.$$phase && !$scope.$root.$$phase && $scope.$digest(); | ||
@@ -1512,3 +1541,3 @@ updates.inserted.forEach(function (w) { | ||
viewport.adjustScrollTopAfterPrepend(updates); | ||
viewport.onAfterPrepend(updates); | ||
@@ -1520,2 +1549,3 @@ if (isInvalid(rid)) { | ||
updatePaddings(rid, updates); | ||
onRenderHandlersRunner(); | ||
enqueueFetch(rid, updates); | ||
@@ -1522,0 +1552,0 @@ pending.shift(); |
/*! | ||
* angular-ui-scroll (compressed) | ||
* https://github.com/angular-ui/ui-scroll | ||
* Version: 1.7.0-rc.2 -- 2017-09-29T16:03:15.814Z | ||
* Version: 1.7.0-rc.3 -- 2017-10-26T19:56:45.454Z | ||
* License: MIT | ||
*/ | ||
!function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=7)}([function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){var n=e.match(/^(.+)(\s+on\s+)(.+)?/);if(n&&4===n.length){window.console.log('Angular ui-scroll adapter assignment warning. "Controller On" syntax has been deprecated since ui-scroll v1.6.1.');for(var r=n[3],i=n[1],o=t;o.length;){var a=o.scope(),u=(o.attr("ng-controller")||"").match(/(\w(?:\w|\d)*)(?:\s+as\s+(\w(?:\w|\d)*))?/);if(u&&u[1]===r)return{target:a,source:i};o=o.parent()}throw new Error('Angular ui-scroll adapter assignment error. Failed to locate target controller "'+r+'" to inject "'+i+'"')}}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(){function e(t,n,i,o,a,u,l,s){r(this,e),this.viewport=t,this.buffer=n,this.adjustBuffer=i,this.reload=o,this.isLoading=!1,this.disabled=!1;var c=t.getScope();this.startScope=c.$parent?c:s,this.publicContext={},this.assignAdapter(a.adapter,u,l),this.generatePublicContext(a,u)}return o(e,[{key:"assignAdapter",value:function(e,t,n){if(e&&(e=e.replace(/^\s+|\s+$/gm,""))){var r=i(e,n),o=void 0;try{r?(t(r.source).assign(r.target,{}),o=t(r.source)(r.target)):(t(e).assign(this.startScope,{}),o=t(e)(this.startScope))}catch(t){throw t.message="Angular ui-scroll Adapter assignment exception.\nCan't parse \""+e+'" expression.\n'+t.message,t}angular.extend(o,this.publicContext),this.publicContext=o}}},{key:"generatePublicContext",value:function(e,t){for(var n=this,r=["reload","applyUpdates","append","prepend","isBOF","isEOF","isEmpty"],i=r.length-1;i>=0;i--)this.publicContext[r[i]]=this[r[i]].bind(this);for(var o=["isLoading","topVisible","topVisibleElement","topVisibleScope","bottomVisible","bottomVisibleElement","bottomVisibleScope"],a=o.length-1;a>=0;a--)!function(r){var i=void 0,a=e[o[r]];Object.defineProperty(n,o[r],{get:function(){return i},set:function(e){i=e,n.publicContext[o[r]]=e,a&&t(a).assign(n.startScope,e)}})}(a);Object.defineProperty(this.publicContext,"disabled",{get:function(){return n.disabled},set:function(e){return(n.disabled=e)?null:n.adjustBuffer()}})}},{key:"loading",value:function(e){this.isLoading=e}},{key:"isBOF",value:function(){return this.buffer.bof}},{key:"isEOF",value:function(){return this.buffer.eof}},{key:"isEmpty",value:function(){return!this.buffer.length}},{key:"applyUpdates",value:function(e,t){var n=this;if(angular.isFunction(e))this.buffer.slice(0).forEach(function(t){n.applyUpdate(t,e(t.item,t.scope,t.element))});else{if(e%1!=0)throw new Error("applyUpdates - "+e+" is not a valid index");var r=e-this.buffer.first;r>=0&&r<this.buffer.length&&this.applyUpdate(this.buffer[r],t)}this.adjustBuffer()}},{key:"append",value:function(e){this.buffer.append(e),this.adjustBuffer(),this.viewport.clipTop(),this.viewport.clipBottom()}},{key:"prepend",value:function(e){this.buffer.prepend(e),this.adjustBuffer(),this.viewport.clipTop(),this.viewport.clipBottom()}},{key:"calculateProperties",value:function(){for(var e=null,t=0,n=!1,r=!1,i=this.buffer.length,o=0;o<i;o++){var a=this.buffer[o],u=a.element.offset().top;if(e!==u){var l=a.element.outerHeight(!0),s=this.viewport.topDataPos()+t+l;!n&&s>this.viewport.topVisiblePos()&&(n=!0,this.topVisible=a.item,this.topVisibleElement=a.element,this.topVisibleScope=a.scope),!r&&(s>=this.viewport.bottomVisiblePos()||o===i-1&&this.isEOF())&&(r=!0,this.bottomVisible=a.item,this.bottomVisibleElement=a.element,this.bottomVisibleScope=a.scope),t+=l}if(e=u,n&&r)break}}},{key:"applyUpdate",value:function(e,t){var n=this;if(angular.isArray(t)){var r=void 0,i=this.buffer.indexOf(e)+1;t.reverse().forEach(function(t){t===e.item?(r=!0,i--):n.buffer.insert(i,t)}),r||(e.op="remove")}}}]),e}();t.default=a},function(e,t,n){"use strict";function r(e,t){var n=Object.create(Array.prototype);return angular.extend(n,{size:t,reset:function(e){n.remove(0,n.length),n.eof=!1,n.bof=!1,n.first=e,n.next=e,n.minIndex=e,n.maxIndex=e,n.minIndexUser=null,n.maxIndexUser=null},append:function(e){e.forEach(function(e){++n.next,n.insert("append",e)}),n.maxIndex=n.eof?n.next-1:Math.max(n.next-1,n.maxIndex)},prepend:function(e){e.reverse().forEach(function(e){--n.first,n.insert("prepend",e)}),n.minIndex=n.bof?n.minIndex=n.first:Math.min(n.first,n.minIndex)},insert:function(e,t){var r={item:t};if(e%1==0)r.op="insert",n.splice(e,0,r);else switch(r.op=e,e){case"append":n.push(r);break;case"prepend":n.unshift(r)}},remove:function(t,r){if(angular.isNumber(t)){for(var i=t;i<r;i++)e.removeElement(n[i]);return n.splice(t,r-t)}return n.splice(n.indexOf(t),1),e.removeElementAnimated(t)},effectiveHeight:function(e){if(!e.length)return 0;var t=Number.MAX_VALUE,n=Number.NEGATIVE_INFINITY;return e.forEach(function(e){e.element[0].offsetParent&&(t=Math.min(t,e.element.offset().top),n=Math.max(n,e.element.offset().top+e.element.outerHeight(!0)))}),Math.max(0,n-t)}}),n}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function(){function e(t,n){r(this,e),this.$animate=t.has&&t.has("$animate")?t.get("$animate"):null,this.isAngularVersionLessThen1_3=1===angular.version.major&&angular.version.minor<3,this.$q=n}return i(e,[{key:"insertElement",value:function(e,t){return t.after(e),[]}},{key:"removeElement",value:function(e){return e.element.remove(),e.scope.$destroy(),[]}},{key:"insertElementAnimated",value:function(e,t){if(!this.$animate)return this.insertElement(e,t);if(this.isAngularVersionLessThen1_3){var n=this.$q.defer();return this.$animate.enter(e,null,t,function(){return n.resolve()}),[n.promise]}return[this.$animate.enter(e,null,t)]}},{key:"removeElementAnimated",value:function(e){if(!this.$animate)return this.removeElement(e);if(this.isAngularVersionLessThen1_3){var t=this.$q.defer();return this.$animate.leave(e.element,function(){return e.scope.$destroy(),t.resolve()}),[t.promise]}return[this.$animate.leave(e.element).then(function(){return e.scope.$destroy()})]}}]),e}();t.default=o},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&u.return&&u.return()}finally{if(i)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(){function e(){r(this,e)}return o(e,[{key:"registerFor",value:function(e){function t(e,t,n){var r=e[0],o=i({top:["scrollTop","pageYOffset","scrollLeft"],left:["scrollLeft","pageXOffset","scrollTop"]}[t],3),a=o[0],u=o[1],s=o[2];return l(r)?angular.isDefined(n)?r.scrollTo(e[s].call(e),n):u in r?r[u]:r.document.documentElement[a]:(angular.isDefined(n)&&(r[a]=n),r[a])}function n(e,t){var n=void 0,r=void 0,a=void 0,s=void 0,c=void 0,f=void 0,d=void 0,p=void 0,h=void 0,m=void 0,g=void 0,v=void 0;if(l(e))return n=document.documentElement[{height:"clientHeight",width:"clientWidth"}[t]],{base:n,padding:0,border:0,margin:0};var b=i({width:[e.offsetWidth,"Left","Right"],height:[e.offsetHeight,"Top","Bottom"]}[t],3);return n=b[0],d=b[1],p=b[2],f=u(e),g=o(e,f["padding"+d])||0,v=o(e,f["padding"+p])||0,r=o(e,f["border"+d+"Width"])||0,a=o(e,f["border"+p+"Width"])||0,s=f["margin"+d],c=f["margin"+p],h=o(e,s)||0,m=o(e,c)||0,{base:n,padding:g+v,border:r+a,margin:h+m}}function r(e,t,r){var i=void 0,o=void 0,a=n(e,t);return a.base>0?{base:a.base-a.padding-a.border,outer:a.base,outerfull:a.base+a.margin}[r]:(i=u(e),o=i[t],(o<0||null===o)&&(o=e.style[t]||0),o=parseFloat(o)||0,{base:o-a.padding-a.border,outer:o,outerfull:o+a.padding+a.border+a.margin}[r])}var o=void 0,a=void 0,u=void 0,l=void 0;return a=angular.element.prototype.css,e.prototype.css=function(e,t){var n=this,r=n[0];if(r&&3!==r.nodeType&&8!==r.nodeType&&r.style)return a.call(n,e,t)},l=function(e){return e&&e.document&&e.location&&e.alert&&e.setInterval},window.getComputedStyle?(u=function(e){return window.getComputedStyle(e,null)},o=function(e,t){return parseFloat(t)}):(u=function(e){return e.currentStyle},o=function(e,t){var n=void 0,r=void 0,i=void 0,o=void 0,a=void 0,u=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source;return new RegExp("^("+u+")(?!px)[a-z%]+$","i").test(t)?(a=e.style,n=a.left,i=e.runtimeStyle,o=i&&i.left,i&&(i.left=a.left),a.left=t,r=a.pixelLeft,a.left=n,o&&(i.left=o),r):parseFloat(t)}),angular.forEach({before:function(e){var t,n,r,i,o,a,u;if(u=this,n=u[0],o=u.parent(),t=o.contents(),t[0]===n)return o.prepend(e);for(r=i=1,a=t.length-1;1<=a?i<=a:i>=a;r=1<=a?++i:--i)if(t[r]===n)return void angular.element(t[r-1]).after(e);throw new Error("invalid DOM structure "+n.outerHTML)},height:function(e){var t;return t=this,angular.isDefined(e)?(angular.isNumber(e)&&(e+="px"),a.call(t,"height",e)):r(this[0],"height","base")},outerHeight:function(e){return r(this[0],"height",e?"outerfull":"outer")},outerWidth:function(e){return r(this[0],"width",e?"outerfull":"outer")},offset:function(e){var t=void 0,n=void 0,r=this,i={top:0,left:0},o=r[0],a=o&&o.ownerDocument;if(arguments.length){if(void 0===e)return r;throw new Error("offset setter method is not implemented")}if(a)return t=a.documentElement,null!=o.getBoundingClientRect&&(i=o.getBoundingClientRect()),n=a.defaultView||a.parentWindow,{top:i.top+(n.pageYOffset||t.scrollTop)-(t.clientTop||0),left:i.left+(n.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}},scrollTop:function(e){return t(this,"top",e)},scrollLeft:function(e){return t(this,"left",e)}},function(t,n){if(!e.prototype[n])return e.prototype[n]=t})}}]),e}();t.default=a},function(e,t,n){"use strict";function r(e,t,n,r,i,a){function u(){return c.outerHeight()*a}var l=null,s=null,c=r&&r.viewport?r.viewport:angular.element(window),f=r&&r.container?r.container:void 0,d=r&&r.scope?r.scope:i;return c.css({"overflow-anchor":"none","overflow-y":"auto",display:"block"}),angular.extend(c,{getScope:function(){return d},createPaddingElements:function(e){l=new o.default(e),s=new o.default(e),n.before(l),n.after(s)},applyContainerStyle:function(){f&&f!==c&&c.css("height",window.getComputedStyle(f[0]).height)},bottomDataPos:function(){var e=c[0].scrollHeight;return(e=null!=e?e:c[0].document.documentElement.scrollHeight)-s.height()},topDataPos:function(){return l.height()},bottomVisiblePos:function(){return c.scrollTop()+c.outerHeight()},topVisiblePos:function(){return c.scrollTop()},insertElement:function(t,n){return e.insertElement(t,n||l)},insertElementAnimated:function(t,n){return e.insertElementAnimated(t,n||l)},shouldLoadBottom:function(){return!t.eof&&c.bottomDataPos()<c.bottomVisiblePos()+u()},clipBottom:function(){for(var e=0,n=0,r=0,i=c.bottomDataPos()-c.bottomVisiblePos()-u(),o=t.length-1;o>=0&&(r=t[o].element.outerHeight(!0),!(n+r>i));o--)s.cache.add(t[o]),n+=r,e++;e>0&&(t.eof=!1,t.remove(t.length-e,t.length),t.next-=e,c.adjustPadding())},shouldLoadTop:function(){return!t.bof&&c.topDataPos()>c.topVisiblePos()-u()},clipTop:function(){for(var e=0,n=0,r=0,i=c.topVisiblePos()-c.topDataPos()-u(),o=0;o<t.length&&(r=t[o].element.outerHeight(!0),!(n+r>i));o++)l.cache.add(t[o]),n+=r,e++;e>0&&(l.height(l.height()+n),t.bof=!1,t.remove(0,e),t.first+=e)},adjustPadding:function(){if(t.length){var e=l.cache.reduce(function(e,n){return e+(n.index<t.first?n.height:0)},0),n=s.cache.reduce(function(e,n){return e+(n.index>=t.next?n.height:0)},0),r=t.reduce(function(e,t){return e+t.element.outerHeight(!0)},0),i=(r+e+n)/(t.maxIndex-t.minIndex+1),o=null!==t.minIndexUser&&t.minIndex>t.minIndexUser,a=null!==t.maxIndexUser&&t.maxIndex<t.maxIndexUser,u=o?(t.minIndex-t.minIndexUser)*i:0,c=a?(t.maxIndexUser-t.maxIndex)*i:0;l.height(e+u),s.height(n+c)}},adjustScrollTopAfterMinIndexSet:function(e){if(null!==t.minIndexUser&&t.minIndex>t.minIndexUser){var n=l.height()-e;c.scrollTop(c.scrollTop()+n)}},adjustScrollTopAfterPrepend:function(e){if(e.prepended.length){var n=t.effectiveHeight(e.prepended),r=l.height()-n;r>=0?l.height(r):(l.height(0),c.scrollTop(c.scrollTop()-r))}},resetTopPadding:function(){l.height(0),l.cache.clear()},resetBottomPadding:function(){s.height(0),s.cache.clear()},removeItem:function(e){return l.cache.remove(e),s.cache.remove(e),t.remove(e)}}),c}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(5),o=function(e){return e&&e.__esModule?e:{default:e}}(i)},function(e,t,n){"use strict";function r(){var e=Object.create(Array.prototype);return angular.extend(e,{add:function(t){for(var n=e.length-1;n>=0;n--)if(e[n].index===t.scope.$index)return void(e[n].height=t.element.outerHeight());e.push({index:t.scope.$index,height:t.element.outerHeight()}),e.sort(function(e,t){return e.index<t.index?-1:e.index>t.index?1:0})},remove:function(t){for(var n=e.length-1;n>=0;n--)if(e[n].index===t.scope.$index){e.splice(n,1);break}for(var r=e.length-1;r>=0;r--)e[r].index>t.scope.$index&&e[r].index--},clear:function(){e.length=0}}),e}function i(e){var t=void 0;switch(e.tagName.toLowerCase()){case"dl":throw new Error("ui-scroll directive does not support <"+e.tagName+"> as a repeating tag: "+e.outerHTML);case"tr":t=angular.element("<table><tr><td><div></div></td></tr></table>").find("tr");break;case"li":t=angular.element("<li></li>");break;default:t=angular.element("<div></div>")}return t.cache=new r,t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i},,function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(3),o=r(i),a=n(2),u=r(a),l=n(1),s=r(l),c=n(4),f=r(c),d=n(0),p=r(d);angular.module("ui.scroll",[]).service("jqLiteExtras",function(){return new o.default}).run(["jqLiteExtras",function(e){return window.jQuery?null:e.registerFor(angular.element)}]).directive("uiScrollViewport",function(){return{restrict:"A",controller:["$scope","$element",function(e,t){var n=this;return this.container=t,this.viewport=t,this.scope=e,angular.forEach(t.children(),function(e){"tbody"===e.tagName.toLowerCase()&&(n.viewport=angular.element(e))}),this}]}}).directive("uiScroll",["$log","$injector","$rootScope","$timeout","$q","$parse",function(e,t,n,r,i,o){function a(e,a,l,c,d){function h(t,n){var r=o(t)(e);return isNaN(r)?n:r}function m(e,t,n){var r=Object.getOwnPropertyDescriptor(e,t);r&&(r.set||r.get)||Object.defineProperty(e,t,{set:function(e){if(X[t]=e,W[n]=e,!F.length){var r=q.topDataPos();q.adjustPadding(),"minIndex"===t&&q.adjustScrollTopAfterMinIndexSet(r)}},get:function(){return X[t]}})}function g(t){return t&&t!==D||e.$$destroyed}function v(){q.bind("resize",V),q.bind("scroll",V)}function b(){q.unbind("resize",V),q.unbind("scroll",V)}function x(){q.resetTopPadding(),q.resetBottomPadding(),arguments.length&&(U=arguments[0]),W.reset(U),j()}function y(e){return e.element.height()&&e.element[0].offsetParent}function w(e){y(e)&&(W.forEach(function(e){angular.isFunction(e.unregisterVisibilityWatcher)&&(e.unregisterVisibilityWatcher(),delete e.unregisterVisibilityWatcher)}),F.length||r(function(){return j()}))}function E(e,t){P(e,t,q.insertElement),y(e)||(e.unregisterVisibilityWatcher=e.scope.$watch(function(){return w(e)})),e.element.addClass("ng-hide")}function P(e,t,n){var r=null,i=t>0?W[t-1].element:void 0;if(d(function(t,o){r=n(t,i),e.element=t,e.scope=o,o[C]=e.item}),z.transform){var o=e.scope.uiScrollTdInitializer;o&&o.linking?z.transform(e.scope,e.element):e.scope.uiScrollTdInitializer={onLink:function(){return z.transform(e.scope,e.element)},scope:e.scope}}return r}function $(){var e=[],t=[],n=[],r=[];return W.forEach(function(i,o){switch(i.op){case"prepend":t.unshift(i);break;case"append":E(i,o),i.op="none",r.push(i);break;case"insert":e=e.concat(P(i,o,q.insertElementAnimated)),i.op="none",r.push(i);break;case"remove":n.push(i)}}),n.forEach(function(t){return e=e.concat(q.removeItem(t))}),t.length&&t.forEach(function(e){E(e),e.op="none"}),W.forEach(function(e,t){return e.scope.$index=W.first+t}),{prepended:t,removed:n,inserted:r,animated:e}}function I(e,t){t.animated.length?i.all(t.animated).then(function(){q.adjustPadding(),j(e)}):q.adjustPadding()}function T(e,t){q.shouldLoadBottom()?(!t||W.effectiveHeight(t.inserted)>0)&&1===F.push(!0)&&(z.loading(!0),O(e)):q.shouldLoadTop()&&(!t||W.effectiveHeight(t.prepended)>0||F[0])&&1===F.push(!1)&&(z.loading(!0),O(e))}function j(t){t||(F=[],t=++D);var n=$();!e.$$phase&&e.$digest(),n.inserted.forEach(function(e){return e.element.removeClass("ng-hide")}),n.prepended.forEach(function(e){return e.element.removeClass("ng-hide")}),g(t)||(I(t,n),T(t),F.length||z.calculateProperties())}function S(t){var n=$();!e.$$phase&&e.$digest(),n.inserted.forEach(function(e){return e.element.removeClass("ng-hide")}),n.prepended.forEach(function(e){return e.element.removeClass("ng-hide")}),q.adjustScrollTopAfterPrepend(n),g(t)||(I(t,n),T(t,n),F.shift(),F.length?O(t):(z.loading(!1),v(),z.calculateProperties()))}function O(e){F[0]?W.length&&!q.shouldLoadBottom()?S(e):Y(function(t){g(e)||(t.length<M&&(W.eof=!0),t.length>0&&(q.clipTop(),W.append(t)),S(e))}):W.length&&!q.shouldLoadTop()?S(e):G(function(t){g(e)||(t.length<M&&(W.bof=!0),t.length>0&&(W.length&&q.clipBottom(),W.prepend(t)),S(e))})}function V(){n.$$phase||z.isLoading||z.disabled||(T(D),F.length?b():(z.calculateProperties(),!e.$$phase&&e.$digest()))}function k(e){if(!z.disabled){var t=q[0].scrollTop,n=q[0].scrollHeight-q[0].clientHeight;(0===t&&!W.bof||t===n&&!W.eof)&&e.preventDefault()}}var A=l.uiScroll.match(/^\s*(\w+)\s+in\s+([(\w|\$)\.]+)\s*$/);if(!A)throw new Error("Expected uiScroll in form of '_item_ in _datasource_' but got '"+l.uiScroll+"'");var L=null,C=A[1],_=A[2],H=c[0],M=Math.max(3,h(l.bufferSize,10)),B=Math.max(.3,h(l.padding,.5)),U=h(l.startIndex,1),D=0,F=[],N=new u.default(t,i),W=new s.default(N,M),q=new f.default(N,W,a,H,n,B),z=new p.default(q,W,j,x,l,o,a,e);H&&(H.adapter=z);var R=function(){return angular.isObject(L)&&angular.isFunction(L.get)};if(L=o(_)(e),!R()&&(L=t.get(_),!R()))throw new Error(_+" is not a valid datasource");var X={};m(L,"minIndex","minIndexUser"),m(L,"maxIndex","maxIndexUser");var Y=2!==L.get.length?function(e){return L.get(W.next,M,e)}:function(e){L.get({index:W.next,append:W.length?W[W.length-1].item:void 0,count:M},e)},G=2!==L.get.length?function(e){return L.get(W.first-M,M,e)}:function(e){L.get({index:W.first-M,prepend:W.length?W[0].item:void 0,count:M},e)};d(function(e,t){q.createPaddingElements(e[0]),t.$destroy(),e.remove()}),e.$on("$destroy",function(){b(),q.unbind("mousewheel",k)}),q.bind("mousewheel",k),r(function(){q.applyContainerStyle(),x()})}return{require:["?^uiScrollViewport"],restrict:"A",transclude:"element",priority:1e3,terminal:!0,link:a}}])}]); | ||
!function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=7)}([function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){var n=e.match(/^(.+)(\s+on\s+)(.+)?/);if(n&&4===n.length){window.console.log('Angular ui-scroll adapter assignment warning. "Controller On" syntax has been deprecated since ui-scroll v1.6.1.');for(var r=n[3],i=n[1],o=t;o.length;){var a=o.scope(),u=(o.attr("ng-controller")||"").match(/(\w(?:\w|\d)*)(?:\s+as\s+(\w(?:\w|\d)*))?/);if(u&&u[1]===r)return{target:a,source:i};o=o.parent()}throw new Error('Angular ui-scroll adapter assignment error. Failed to locate target controller "'+r+'" to inject "'+i+'"')}}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(){function e(t,n,i,o,a,u,l,s){r(this,e),this.viewport=t,this.buffer=n,this.adjustBuffer=i,this.reload=o,this.isLoading=!1,this.disabled=!1;var c=t.getScope();this.startScope=c.$parent?c:s,this.publicContext={},this.assignAdapter(a.adapter,u,l),this.generatePublicContext(a,u)}return o(e,[{key:"assignAdapter",value:function(e,t,n){if(e&&(e=e.replace(/^\s+|\s+$/gm,""))){var r=i(e,n),o=void 0;try{r?(t(r.source).assign(r.target,{}),o=t(r.source)(r.target)):(t(e).assign(this.startScope,{}),o=t(e)(this.startScope))}catch(t){throw t.message="Angular ui-scroll Adapter assignment exception.\nCan't parse \""+e+'" expression.\n'+t.message,t}angular.extend(o,this.publicContext),this.publicContext=o}}},{key:"generatePublicContext",value:function(e,t){for(var n=this,r=["reload","applyUpdates","append","prepend","isBOF","isEOF","isEmpty"],i=r.length-1;i>=0;i--)this.publicContext[r[i]]=this[r[i]].bind(this);for(var o=["isLoading","topVisible","topVisibleElement","topVisibleScope","bottomVisible","bottomVisibleElement","bottomVisibleScope"],a=o.length-1;a>=0;a--)!function(r){var i=void 0,a=e[o[r]];Object.defineProperty(n,o[r],{get:function(){return i},set:function(e){i=e,n.publicContext[o[r]]=e,a&&t(a).assign(n.startScope,e)}})}(a);Object.defineProperty(this.publicContext,"disabled",{get:function(){return n.disabled},set:function(e){return(n.disabled=e)?null:n.adjustBuffer()}})}},{key:"loading",value:function(e){this.isLoading=e}},{key:"isBOF",value:function(){return this.buffer.bof}},{key:"isEOF",value:function(){return this.buffer.eof}},{key:"isEmpty",value:function(){return!this.buffer.length}},{key:"applyUpdates",value:function(e,t){var n=this;if(angular.isFunction(e))this.buffer.slice(0).forEach(function(t){n.applyUpdate(t,e(t.item,t.scope,t.element))});else{if(e%1!=0)throw new Error("applyUpdates - "+e+" is not a valid index");var r=e-this.buffer.first;r>=0&&r<this.buffer.length&&this.applyUpdate(this.buffer[r],t)}this.adjustBuffer()}},{key:"append",value:function(e){this.buffer.append(e),this.adjustBuffer(),this.viewport.clipTop(),this.viewport.clipBottom()}},{key:"prepend",value:function(e){this.buffer.prepend(e),this.adjustBuffer(),this.viewport.clipTop(),this.viewport.clipBottom()}},{key:"calculateProperties",value:function(){for(var e=null,t=0,n=!1,r=!1,i=this.buffer.length,o=0;o<i;o++){var a=this.buffer[o],u=a.element.offset().top;if(e!==u){var l=a.element.outerHeight(!0),s=this.viewport.topDataPos()+t+l;!n&&s>this.viewport.topVisiblePos()&&(n=!0,this.topVisible=a.item,this.topVisibleElement=a.element,this.topVisibleScope=a.scope),!r&&(s>=this.viewport.bottomVisiblePos()||o===i-1&&this.isEOF())&&(r=!0,this.bottomVisible=a.item,this.bottomVisibleElement=a.element,this.bottomVisibleScope=a.scope),t+=l}if(e=u,n&&r)break}}},{key:"applyUpdate",value:function(e,t){var n=this;if(angular.isArray(t)){var r=void 0,i=this.buffer.indexOf(e)+1;t.reverse().forEach(function(t){t===e.item?(r=!0,i--):n.buffer.insert(i,t)}),r||(e.op="remove")}}}]),e}();t.default=a},function(e,t,n){"use strict";function r(e,t){var n=Object.create(Array.prototype);return angular.extend(n,{size:t,reset:function(e){n.remove(0,n.length),n.eof=!1,n.bof=!1,n.first=e,n.next=e,n.minIndex=e,n.maxIndex=e,n.minIndexUser=null,n.maxIndexUser=null},append:function(e){e.forEach(function(e){++n.next,n.insert("append",e)}),n.maxIndex=n.eof?n.next-1:Math.max(n.next-1,n.maxIndex)},prepend:function(e){e.reverse().forEach(function(e){--n.first,n.insert("prepend",e)}),n.minIndex=n.bof?n.minIndex=n.first:Math.min(n.first,n.minIndex)},insert:function(e,t){var r={item:t};if(e%1==0)r.op="insert",n.splice(e,0,r);else switch(r.op=e,e){case"append":n.push(r);break;case"prepend":n.unshift(r)}},remove:function(t,r){if(angular.isNumber(t)){for(var i=t;i<r;i++)e.removeElement(n[i]);return n.splice(t,r-t)}return n.splice(n.indexOf(t),1),e.removeElementAnimated(t)},effectiveHeight:function(e){if(!e.length)return 0;var t=Number.MAX_VALUE,n=Number.NEGATIVE_INFINITY;return e.forEach(function(e){e.element[0].offsetParent&&(t=Math.min(t,e.element.offset().top),n=Math.max(n,e.element.offset().top+e.element.outerHeight(!0)))}),Math.max(0,n-t)}}),n}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function(){function e(t,n){r(this,e),this.$animate=t.has&&t.has("$animate")?t.get("$animate"):null,this.isAngularVersionLessThen1_3=1===angular.version.major&&angular.version.minor<3,this.$q=n}return i(e,[{key:"insertElement",value:function(e,t){return t.after(e),[]}},{key:"removeElement",value:function(e){return e.element.remove(),e.scope.$destroy(),[]}},{key:"insertElementAnimated",value:function(e,t){if(!this.$animate)return this.insertElement(e,t);if(this.isAngularVersionLessThen1_3){var n=this.$q.defer();return this.$animate.enter(e,null,t,function(){return n.resolve()}),[n.promise]}return[this.$animate.enter(e,null,t)]}},{key:"removeElementAnimated",value:function(e){if(!this.$animate)return this.removeElement(e);if(this.isAngularVersionLessThen1_3){var t=this.$q.defer();return this.$animate.leave(e.element,function(){return e.scope.$destroy(),t.resolve()}),[t.promise]}return[this.$animate.leave(e.element).then(function(){return e.scope.$destroy()})]}}]),e}();t.default=o},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&u.return&&u.return()}finally{if(i)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(){function e(){r(this,e)}return o(e,[{key:"registerFor",value:function(e){function t(e,t,n){var r=e[0],o=i({top:["scrollTop","pageYOffset","scrollLeft"],left:["scrollLeft","pageXOffset","scrollTop"]}[t],3),a=o[0],u=o[1],s=o[2];return l(r)?angular.isDefined(n)?r.scrollTo(e[s].call(e),n):u in r?r[u]:r.document.documentElement[a]:(angular.isDefined(n)&&(r[a]=n),r[a])}function n(e,t){var n=void 0,r=void 0,a=void 0,s=void 0,c=void 0,f=void 0,d=void 0,h=void 0,p=void 0,m=void 0,g=void 0,v=void 0;if(l(e))return n=document.documentElement[{height:"clientHeight",width:"clientWidth"}[t]],{base:n,padding:0,border:0,margin:0};var b=i({width:[e.offsetWidth,"Left","Right"],height:[e.offsetHeight,"Top","Bottom"]}[t],3);return n=b[0],d=b[1],h=b[2],f=u(e),g=o(e,f["padding"+d])||0,v=o(e,f["padding"+h])||0,r=o(e,f["border"+d+"Width"])||0,a=o(e,f["border"+h+"Width"])||0,s=f["margin"+d],c=f["margin"+h],p=o(e,s)||0,m=o(e,c)||0,{base:n,padding:g+v,border:r+a,margin:p+m}}function r(e,t,r){var i=void 0,o=void 0,a=n(e,t);return a.base>0?{base:a.base-a.padding-a.border,outer:a.base,outerfull:a.base+a.margin}[r]:(i=u(e),o=i[t],(o<0||null===o)&&(o=e.style[t]||0),o=parseFloat(o)||0,{base:o-a.padding-a.border,outer:o,outerfull:o+a.padding+a.border+a.margin}[r])}var o=void 0,a=void 0,u=void 0,l=void 0;return a=angular.element.prototype.css,e.prototype.css=function(e,t){var n=this,r=n[0];if(r&&3!==r.nodeType&&8!==r.nodeType&&r.style)return a.call(n,e,t)},l=function(e){return e&&e.document&&e.location&&e.alert&&e.setInterval},window.getComputedStyle?(u=function(e){return window.getComputedStyle(e,null)},o=function(e,t){return parseFloat(t)}):(u=function(e){return e.currentStyle},o=function(e,t){var n=void 0,r=void 0,i=void 0,o=void 0,a=void 0,u=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source;return new RegExp("^("+u+")(?!px)[a-z%]+$","i").test(t)?(a=e.style,n=a.left,i=e.runtimeStyle,o=i&&i.left,i&&(i.left=a.left),a.left=t,r=a.pixelLeft,a.left=n,o&&(i.left=o),r):parseFloat(t)}),angular.forEach({before:function(e){var t,n,r,i,o,a,u;if(u=this,n=u[0],o=u.parent(),t=o.contents(),t[0]===n)return o.prepend(e);for(r=i=1,a=t.length-1;1<=a?i<=a:i>=a;r=1<=a?++i:--i)if(t[r]===n)return void angular.element(t[r-1]).after(e);throw new Error("invalid DOM structure "+n.outerHTML)},height:function(e){var t;return t=this,angular.isDefined(e)?(angular.isNumber(e)&&(e+="px"),a.call(t,"height",e)):r(this[0],"height","base")},outerHeight:function(e){return r(this[0],"height",e?"outerfull":"outer")},outerWidth:function(e){return r(this[0],"width",e?"outerfull":"outer")},offset:function(e){var t=void 0,n=void 0,r=this,i={top:0,left:0},o=r[0],a=o&&o.ownerDocument;if(arguments.length){if(void 0===e)return r;throw new Error("offset setter method is not implemented")}if(a)return t=a.documentElement,null!=o.getBoundingClientRect&&(i=o.getBoundingClientRect()),n=a.defaultView||a.parentWindow,{top:i.top+(n.pageYOffset||t.scrollTop)-(t.clientTop||0),left:i.left+(n.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}},scrollTop:function(e){return t(this,"top",e)},scrollLeft:function(e){return t(this,"left",e)}},function(t,n){if(!e.prototype[n])return e.prototype[n]=t})}}]),e}();t.default=a},function(e,t,n){"use strict";function r(e,t,n,r,i,a){function u(){return c.outerHeight()*a}var l=null,s=null,c=r&&r.viewport?r.viewport:angular.element(window),f=r&&r.container?r.container:void 0,d=r&&r.scope?r.scope:i;return c.css({"overflow-anchor":"none","overflow-y":"auto",display:"block"}),angular.extend(c,{getScope:function(){return d},createPaddingElements:function(e){l=new o.default(e),s=new o.default(e),n.before(l),n.after(s)},applyContainerStyle:function(){f&&f!==c&&c.css("height",window.getComputedStyle(f[0]).height)},bottomDataPos:function(){var e=c[0].scrollHeight;return(e=null!=e?e:c[0].document.documentElement.scrollHeight)-s.height()},topDataPos:function(){return l.height()},bottomVisiblePos:function(){return c.scrollTop()+c.outerHeight()},topVisiblePos:function(){return c.scrollTop()},insertElement:function(t,n){return e.insertElement(t,n||l)},insertElementAnimated:function(t,n){return e.insertElementAnimated(t,n||l)},shouldLoadBottom:function(){return!t.eof&&c.bottomDataPos()<c.bottomVisiblePos()+u()},clipBottom:function(){for(var e=0,n=0,r=0,i=c.bottomDataPos()-c.bottomVisiblePos()-u(),o=t.length-1;o>=0&&(r=t[o].element.outerHeight(!0),!(n+r>i));o--)s.cache.add(t[o]),n+=r,e++;e>0&&(t.eof=!1,t.remove(t.length-e,t.length),t.next-=e,c.adjustPaddings())},shouldLoadTop:function(){return!t.bof&&c.topDataPos()>c.topVisiblePos()-u()},clipTop:function(){for(var e=0,n=0,r=0,i=c.topVisiblePos()-c.topDataPos()-u(),o=0;o<t.length&&(r=t[o].element.outerHeight(!0),!(n+r>i));o++)l.cache.add(t[o]),n+=r,e++;e>0&&(l.height(l.height()+n),t.bof=!1,t.remove(0,e),t.first+=e)},adjustPaddings:function(){if(t.length){var e=l.cache.reduce(function(e,n){return e+(n.index<t.first?n.height:0)},0),n=s.cache.reduce(function(e,n){return e+(n.index>=t.next?n.height:0)},0),r=t.reduce(function(e,t){return e+t.element.outerHeight(!0)},0),i=(r+e+n)/(t.maxIndex-t.minIndex+1),o=null!==t.minIndexUser&&t.minIndex>t.minIndexUser,a=null!==t.maxIndexUser&&t.maxIndex<t.maxIndexUser,u=o?(t.minIndex-t.minIndexUser)*i:0,c=a?(t.maxIndexUser-t.maxIndex)*i:0;l.height(e+u),s.height(n+c)}},onAfterMinIndexSet:function(e){if(null!==t.minIndexUser&&t.minIndex>t.minIndexUser){var n=l.height()-e;c.scrollTop(c.scrollTop()+n),n-=c.scrollTop(),n>0&&(s.height(s.height()+n),c.scrollTop(c.scrollTop()+n))}},onAfterPrepend:function(e){if(e.prepended.length){var n=t.effectiveHeight(e.prepended),r=l.height()-n;r>=0?l.height(r):(l.height(0),c.scrollTop(c.scrollTop()-r))}},resetTopPadding:function(){l.height(0),l.cache.clear()},resetBottomPadding:function(){s.height(0),s.cache.clear()},removeItem:function(e){return l.cache.remove(e),s.cache.remove(e),t.remove(e)}}),c}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(5),o=function(e){return e&&e.__esModule?e:{default:e}}(i)},function(e,t,n){"use strict";function r(){var e=Object.create(Array.prototype);return angular.extend(e,{add:function(t){for(var n=e.length-1;n>=0;n--)if(e[n].index===t.scope.$index)return void(e[n].height=t.element.outerHeight());e.push({index:t.scope.$index,height:t.element.outerHeight()}),e.sort(function(e,t){return e.index<t.index?-1:e.index>t.index?1:0})},remove:function(t){for(var n=e.length-1;n>=0;n--)if(e[n].index===t.scope.$index){e.splice(n,1);break}for(var r=e.length-1;r>=0;r--)e[r].index>t.scope.$index&&e[r].index--},clear:function(){e.length=0}}),e}function i(e){var t=void 0;if(e.nodeType!==Node.ELEMENT_NODE)throw new Error("ui-scroll directive requires an Element node for templating the view");switch(e.tagName.toLowerCase()){case"dl":throw new Error("ui-scroll directive does not support <"+e.tagName+"> as a repeating tag: "+e.outerHTML);case"tr":t=angular.element("<table><tr><td><div></div></td></tr></table>").find("tr");break;case"li":t=angular.element("<li></li>");break;default:t=angular.element("<div></div>")}return t.cache=new r,t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i},,function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(3),o=r(i),a=n(2),u=r(a),l=n(1),s=r(l),c=n(4),f=r(c),d=n(0),h=r(d);angular.module("ui.scroll",[]).service("jqLiteExtras",function(){return new o.default}).run(["jqLiteExtras",function(e){return window.jQuery?null:e.registerFor(angular.element)}]).directive("uiScrollViewport",function(){return{restrict:"A",controller:["$scope","$element",function(e,t){var n=this;return this.container=t,this.viewport=t,this.scope=e,angular.forEach(t.children(),function(e){"tbody"===e.tagName.toLowerCase()&&(n.viewport=angular.element(e))}),this}]}}).directive("uiScroll",["$log","$injector","$rootScope","$timeout","$q","$parse",function(e,t,n,r,i,o){function a(e,a,l,c,d){function p(t,n){var r=o(t)(e);return isNaN(r)?n:r}function m(){G.length&&(angular.forEach(G,function(e){return e()}),G=[])}function g(e,t){var n=void 0;e.hasOwnProperty(t)&&!z.length&&(n=e[t],delete e[t],G.push(function(){return e[t]=n}))}function v(e,t,n){var r=Object.getOwnPropertyDescriptor(e,t);if(!r||!r.set&&!r.get){var i=void 0;g(e,t),Object.defineProperty(e,t,{set:function(e){i=e,z[n]=e;var r=R.topDataPos();R.adjustPaddings(),"minIndex"===t&&R.onAfterMinIndexSet(r)},get:function(){return i}})}}function b(t){return t&&t!==N||e.$$destroyed}function x(){R.bind("resize",A),R.bind("scroll",A)}function y(){R.unbind("resize",A),R.unbind("scroll",A)}function w(){R.resetTopPadding(),R.resetBottomPadding(),arguments.length&&(F=arguments[0]),z.reset(F),V()}function E(e){return e.element.height()&&e.element[0].offsetParent}function $(e){E(e)&&(z.forEach(function(e){angular.isFunction(e.unregisterVisibilityWatcher)&&(e.unregisterVisibilityWatcher(),delete e.unregisterVisibilityWatcher)}),W.length||r(function(){return V()}))}function P(e,t){T(e,t,R.insertElement),E(e)||(e.unregisterVisibilityWatcher=e.scope.$watch(function(){return $(e)})),e.element.addClass("ng-hide")}function T(e,t,n){var r=null,i=t>0?z[t-1].element:void 0;if(d(function(t,o){r=n(t,i),e.element=t,e.scope=o,o[M]=e.item}),X.transform){var o=e.scope.uiScrollTdInitializer;o&&o.linking?X.transform(e.scope,e.element):e.scope.uiScrollTdInitializer={onLink:function(){return X.transform(e.scope,e.element)},scope:e.scope}}return r}function I(){var e=[],t=[],n=[],r=[];return z.forEach(function(i,o){switch(i.op){case"prepend":t.unshift(i);break;case"append":P(i,o),i.op="none",r.push(i);break;case"insert":e=e.concat(T(i,o,R.insertElementAnimated)),i.op="none",r.push(i);break;case"remove":n.push(i)}}),n.forEach(function(t){return e=e.concat(R.removeItem(t))}),t.length&&t.forEach(function(e){P(e),e.op="none"}),z.forEach(function(e,t){return e.scope.$index=z.first+t}),{prepended:t,removed:n,inserted:r,animated:e}}function O(e,t){t.animated.length?i.all(t.animated).then(function(){R.adjustPaddings(),V(e)}):R.adjustPaddings()}function j(e,t){R.shouldLoadBottom()?(!t||z.effectiveHeight(t.inserted)>0)&&1===W.push(!0)&&(X.loading(!0),S(e)):R.shouldLoadTop()&&(!t||z.effectiveHeight(t.prepended)>0||W[0])&&1===W.push(!1)&&(X.loading(!0),S(e))}function V(t){t||(W=[],t=++N);var n=I();!e.$$phase&&!e.$root.$$phase&&e.$digest(),n.inserted.forEach(function(e){return e.element.removeClass("ng-hide")}),n.prepended.forEach(function(e){return e.element.removeClass("ng-hide")}),b(t)||(O(t,n),j(t),W.length||X.calculateProperties())}function k(t){var n=I();!e.$$phase&&!e.$root.$$phase&&e.$digest(),n.inserted.forEach(function(e){return e.element.removeClass("ng-hide")}),n.prepended.forEach(function(e){return e.element.removeClass("ng-hide")}),R.onAfterPrepend(n),b(t)||(O(t,n),m(),j(t,n),W.shift(),W.length?S(t):(X.loading(!1),x(),X.calculateProperties()))}function S(e){W[0]?z.length&&!R.shouldLoadBottom()?k(e):Q(function(t){b(e)||(t.length<U&&(z.eof=!0),t.length>0&&(R.clipTop(),z.append(t)),k(e))}):z.length&&!R.shouldLoadTop()?k(e):J(function(t){b(e)||(t.length<U&&(z.bof=!0),t.length>0&&(z.length&&R.clipBottom(),z.prepend(t)),k(e))})}function A(){n.$$phase||X.isLoading||X.disabled||(j(N),W.length?y():(X.calculateProperties(),!e.$$phase&&e.$digest()))}function L(e){if(!X.disabled){var t=R[0].scrollTop,n=R[0].scrollHeight-R[0].clientHeight;(0===t&&!z.bof||t===n&&!z.eof)&&e.preventDefault()}}var _=l.uiScroll.match(/^\s*(\w+)\s+in\s+([(\w|\$)\.]+)\s*$/);if(!_)throw new Error("Expected uiScroll in form of '_item_ in _datasource_' but got '"+l.uiScroll+"'");var C=null,M=_[1],H=_[2],B=c[0],U=Math.max(3,p(l.bufferSize,10)),D=Math.max(.3,p(l.padding,.5)),F=p(l.startIndex,1),N=0,W=[],q=new u.default(t,i),z=new s.default(q,U),R=new f.default(q,z,a,B,n,D),X=new h.default(R,z,V,w,l,o,a,e);B&&(B.adapter=X);var Y=function(){return angular.isObject(C)&&angular.isFunction(C.get)};if(C=o(H)(e),!Y()&&(C=t.get(H),!Y()))throw new Error(H+" is not a valid datasource");var G=[];v(C,"minIndex","minIndexUser"),v(C,"maxIndex","maxIndexUser");var Q=2!==C.get.length?function(e){return C.get(z.next,U,e)}:function(e){C.get({index:z.next,append:z.length?z[z.length-1].item:void 0,count:U},e)},J=2!==C.get.length?function(e){return C.get(z.first-U,U,e)}:function(e){C.get({index:z.first-U,prepend:z.length?z[0].item:void 0,count:U},e)};d(function(e,t){R.createPaddingElements(e[0]),t.$destroy(),e.remove()}),e.$on("$destroy",function(){y(),R.unbind("mousewheel",L)}),R.bind("mousewheel",L),r(function(){R.applyContainerStyle(),w()})}return{require:["?^uiScrollViewport"],restrict:"A",transclude:"element",priority:1e3,terminal:!0,link:a}}])}]); | ||
//# sourceMappingURL=ui-scroll.min.js.map |
{ | ||
"name": "angular-ui-scroll", | ||
"description": "AngularJS infinite scrolling module", | ||
"version": "1.7.0-rc.2", | ||
"version": "1.7.0-rc.3", | ||
"src": "./src/", | ||
@@ -6,0 +6,0 @@ "public": "./dist/", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1494498
105
18142