angular-ui-scroll
Advanced tools
Comparing version 1.6.1 to 1.6.2
@@ -1,9 +0,29 @@ | ||
angular.module('application', ['ui.scroll']).factory('datasource', [ | ||
'$log', '$timeout', function(console, $timeout) { | ||
var get, max, min; | ||
min = -50; | ||
max = 100; | ||
angular.module('application', ['ui.scroll']) | ||
get = function(index, count, success) { | ||
$timeout(function() { | ||
.run(function($rootScope) { | ||
$rootScope.doReload = function () { | ||
$rootScope.$broadcast('DO_RELOAD'); | ||
}; | ||
}) | ||
.controller('MainCtrl', function($scope) { | ||
$scope.hello = 'Hello Main Controller!'; | ||
var counter = 0; | ||
var reloadListener = $scope.$on('DO_RELOAD', function() { | ||
if ($scope.adapter) { | ||
counter = 0; | ||
$scope.adapter.reload(); | ||
} | ||
}); | ||
$scope.$on("$destroy", function() { | ||
reloadListener(); | ||
}); | ||
var min = -1000, max = 1000, delay = 0; | ||
$scope.datasource = { | ||
get: function(index, count, success) { | ||
setTimeout(function() { | ||
var result = []; | ||
@@ -14,17 +34,12 @@ var start = Math.max(min, index); | ||
for (var i = start; i <= end; i++) { | ||
var j = i > 0 ? i : (-1) * i; | ||
result.push({ | ||
text: "item #" + i, | ||
height: 20 + (j%2) * 10 | ||
}); | ||
height = 50 + (counter++ * 2); | ||
result.push({ index: i, height: height }); | ||
} | ||
} | ||
success(result); | ||
}, 50); | ||
}; | ||
console.log('Got ' + result.length + ' items [' + start + '..' + end + ']'); | ||
success(result); | ||
}, delay); | ||
} | ||
}; | ||
return { | ||
get: get | ||
}; | ||
} | ||
]); | ||
}); |
/*! | ||
* angular-ui-scroll (uncompressed) | ||
* https://github.com/angular-ui/ui-scroll | ||
* Version: 1.6.1 -- 2017-03-03T05:28:34.208Z | ||
* Version: 1.6.2 -- 2017-07-06T23:27:28.920Z | ||
* License: MIT | ||
@@ -15,10 +15,10 @@ */ | ||
/******/ // Check if module is in cache | ||
/******/ if(installedModules[moduleId]) | ||
/******/ if(installedModules[moduleId]) { | ||
/******/ return installedModules[moduleId].exports; | ||
/******/ | ||
/******/ } | ||
/******/ // Create a new module (and put it into the cache) | ||
/******/ var module = installedModules[moduleId] = { | ||
/******/ exports: {}, | ||
/******/ id: moduleId, | ||
/******/ loaded: false | ||
/******/ i: moduleId, | ||
/******/ l: false, | ||
/******/ exports: {} | ||
/******/ }; | ||
@@ -30,3 +30,3 @@ /******/ | ||
/******/ // Flag the module as loaded | ||
/******/ module.loaded = true; | ||
/******/ module.l = true; | ||
/******/ | ||
@@ -44,2 +44,28 @@ /******/ // Return the exports of the module | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
/******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ if(!__webpack_require__.o(exports, name)) { | ||
/******/ Object.defineProperty(exports, name, { | ||
/******/ configurable: false, | ||
/******/ enumerable: true, | ||
/******/ get: getter | ||
/******/ }); | ||
/******/ } | ||
/******/ }; | ||
/******/ | ||
/******/ // getDefaultExport function for compatibility with non-harmony modules | ||
/******/ __webpack_require__.n = function(module) { | ||
/******/ var getter = module && module.__esModule ? | ||
/******/ function getDefault() { return module['default']; } : | ||
/******/ function getModuleExports() { return module; }; | ||
/******/ __webpack_require__.d(getter, 'a', getter); | ||
/******/ return getter; | ||
/******/ }; | ||
/******/ | ||
/******/ // Object.prototype.hasOwnProperty.call | ||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; | ||
/******/ | ||
/******/ // __webpack_public_path__ | ||
@@ -49,310 +75,325 @@ /******/ __webpack_require__.p = ""; | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(0); | ||
/******/ return __webpack_require__(__webpack_require__.s = 6); | ||
/******/ }) | ||
/************************************************************************/ | ||
/******/ ([ | ||
/* 0 */ | ||
/***/ function(module, exports) { | ||
/******/ ({ | ||
'use strict'; | ||
angular.module('ui.scroll.grid', []).directive('uiScrollTh', ['$log', '$timeout', function (console, $timeout) { | ||
function GridAdapter(controller) { | ||
this.getLayout = function () { | ||
return controller.getLayout(); | ||
}; | ||
this.applyLayout = function (layout) { | ||
return controller.applyLayout(layout); | ||
}; | ||
this.columnFromPoint = function (x, y) { | ||
return controller.columnFromPoint(x, y); | ||
}; | ||
Object.defineProperty(this, 'columns', { get: function get() { | ||
return controller.getColumns(); | ||
} }); | ||
} | ||
function ColumnAdapter(controller, column) { | ||
this.css = function () /* attr, value */{ | ||
var attr = arguments[0]; | ||
var value = arguments[1]; | ||
if (arguments.length == 1) { | ||
return column.header.css(attr); | ||
} | ||
if (arguments.length == 2) { | ||
column.header.css(attr, value); | ||
controller.forEachRow(function (row) { | ||
return row[column.id].css(attr, value); | ||
}); | ||
column.css[attr] = value; | ||
} | ||
}; | ||
this.moveBefore = function (index) { | ||
return controller.moveBefore(column, index); | ||
}; | ||
this.exchangeWith = function (index) { | ||
return controller.exchangeWith(column, index); | ||
}; | ||
Object.defineProperty(this, 'columnId', { get: function get() { | ||
return column.id; | ||
} }); | ||
} | ||
function ColumnController(controller, columns, header) { | ||
this.header = header; | ||
this.css = {}; | ||
this.mapTo = columns.length; | ||
this.id = columns.length; | ||
// controller api methods | ||
this.applyLayout = function (layout) { | ||
this.css = angular.extend({}, layout.css); | ||
this.mapTo = layout.mapTo; | ||
applyCss(this.header, this.css); | ||
}; | ||
this.moveBefore = function (target) { | ||
var _this = this; | ||
if (target) { | ||
moveBefore(header, target.header); | ||
controller.forEachRow(function (row) { | ||
return moveBefore(row[_this.id], row[target.id]); | ||
}); | ||
} else { | ||
moveLast(header); | ||
controller.forEachRow(function (row) { | ||
return moveLast(row[_this.id]); | ||
}); | ||
} | ||
}; | ||
this.columnFromPoint = function (x, y) { | ||
var _this2 = this; | ||
if (insidePoint(header, x, y)) { | ||
return this; | ||
} | ||
var result = null; | ||
controller.forEachRow(function (row) { | ||
return result = insidePoint(row[_this2.id], x, y) ? _this2 : result; | ||
}); | ||
return result; | ||
}; | ||
this.applyCss = function (target) { | ||
applyCss(target, this.css); | ||
}; | ||
// function definitions | ||
function insidePoint(element, x, y) { | ||
var offset = element.offset(); | ||
if (x < offset.left || offset.left + element.outerWidth(true) < x) return false; | ||
if (y < offset.top || offset.top + element.outerHeight(true) < y) return false; | ||
return true; | ||
} | ||
function moveBefore(element, target) { | ||
element.detach(); | ||
target.before(element); | ||
} | ||
function moveLast(element) { | ||
var parent = element.parent(); | ||
element.detach(); | ||
parent.append(element); | ||
} | ||
function applyCss(target, css) { | ||
target.removeAttr('style'); | ||
for (var attr in css) { | ||
if (css.hasOwnProperty(attr)) { | ||
target.css(attr, css[attr]); | ||
} | ||
} | ||
} | ||
} | ||
function GridController(scrollViewport) { | ||
var _this3 = this; | ||
var columns = []; | ||
var rowMap = new Map(); | ||
$timeout(function () { | ||
scrollViewport.adapter.publicContext.gridAdapter = new GridAdapter(_this3); | ||
scrollViewport.adapter.transform = function (scope, item) { | ||
return transform(rowMap.get(scope), item); | ||
}; | ||
}); | ||
this.registerColumn = function (header) { | ||
columns.push(new ColumnController(this, columns, header)); | ||
}; | ||
this.registerCell = function (scope, cell) { | ||
var row = rowMap.get(scope); | ||
if (!row) { | ||
row = []; | ||
rowMap.set(scope, row); | ||
} | ||
if (row.length >= columns.length) { | ||
return false; | ||
} | ||
row.push(cell); | ||
return true; | ||
}; | ||
this.unregisterCell = function (scope, cell) { | ||
var row = rowMap.get(scope); | ||
var i = row.indexOf(cell); | ||
row.splice(i, 1); | ||
if (!row.length) { | ||
rowMap.delete(scope); | ||
} | ||
}; | ||
this.forEachRow = function (callback) { | ||
rowMap.forEach(callback); | ||
}; | ||
this.getColumns = function () { | ||
var _this4 = this; | ||
var result = []; | ||
columns.slice().sort(function (a, b) { | ||
return a.mapTo - b.mapTo; | ||
}).forEach(function (column) { | ||
return result.push(new ColumnAdapter(_this4, column)); | ||
}); | ||
return result; | ||
}; | ||
this.getLayout = function () { | ||
var result = []; | ||
columns.forEach(function (column, index) { | ||
return result.push({ | ||
index: index, | ||
css: angular.extend({}, column.css), | ||
mapTo: column.mapTo | ||
}); | ||
}); | ||
return result; | ||
}; | ||
this.applyLayout = function (layouts) { | ||
if (!layouts || layouts.length != columns.length) { | ||
throw new Error('Failed to apply layout - number of layouts should match number of columns'); | ||
} | ||
layouts.forEach(function (layout, index) { | ||
return columns[index].applyLayout(layout); | ||
}); | ||
transform(columns.map(function (column) { | ||
return column.header; | ||
})); | ||
rowMap.forEach(function (row) { | ||
return transform(row); | ||
}); | ||
}; | ||
this.moveBefore = function (selected, target) { | ||
var index = target; | ||
if (target % 1 !== 0) { | ||
index = target ? columns[target.columnId].mapTo : columns.length; | ||
} | ||
if (index < 0 || index > columns.length) { | ||
return; // throw an error? | ||
} | ||
var mapTo = selected.mapTo, | ||
next = null; | ||
index -= mapTo < index ? 1 : 0; | ||
columns.forEach(function (c) { | ||
c.mapTo -= c.mapTo > mapTo ? 1 : 0; | ||
c.mapTo += c.mapTo >= index ? 1 : 0; | ||
next = c.mapTo === index + 1 ? c : next; | ||
}); | ||
selected.mapTo = index; | ||
selected.moveBefore(next); | ||
}; | ||
this.exchangeWith = function (selected, index) { | ||
if (index < 0 || index >= columns.length) { | ||
return; | ||
} | ||
columns.find(function (c) { | ||
return c.mapTo === index; | ||
}).mapTo = selected.mapTo; | ||
selected.mapTo = index; | ||
}; | ||
this.columnFromPoint = function (x, y) { | ||
var column = columns.find(function (col) { | ||
return col.columnFromPoint(x, y); | ||
}); | ||
return column ? new ColumnAdapter(this, column) : undefined; | ||
}; | ||
// function definitions | ||
function transform(row) { | ||
var parent = row[0].parent(); | ||
var visible = []; | ||
row.forEach(function (cell, index) { | ||
columns[index].applyCss(cell); | ||
visible[columns[index].mapTo] = row[index]; | ||
row[index].detach(); | ||
}); | ||
visible.forEach(function (cell) { | ||
return parent.append(cell); | ||
}); | ||
} | ||
} | ||
return { | ||
require: ['^^uiScrollViewport'], | ||
restrict: 'A', | ||
link: function link($scope, element, $attr, controllers) { | ||
controllers[0].gridController = controllers[0].gridController || new GridController(controllers[0]); | ||
controllers[0].gridController.registerColumn(element); | ||
} | ||
}; | ||
}]).directive('uiScrollTd', function () { | ||
return { | ||
require: ['?^^uiScrollViewport'], | ||
restrict: 'A', | ||
link: function link($scope, element, $attr, controllers) { | ||
if (controllers[0]) { | ||
(function () { | ||
var gridController = controllers[0].gridController; | ||
if (gridController.registerCell($scope, element)) { | ||
$scope.$on('$destroy', function () { | ||
return gridController.unregisterCell($scope, element); | ||
}); | ||
} | ||
})(); | ||
} | ||
} | ||
}; | ||
}); | ||
/***/ 6: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
/***/ } | ||
/******/ ]); | ||
"use strict"; | ||
angular.module('ui.scroll.grid', []).directive('uiScrollTh', ['$log', '$timeout', function (console, $timeout) { | ||
function GridAdapter(controller) { | ||
this.getLayout = function () { | ||
return controller.getLayout(); | ||
}; | ||
this.applyLayout = function (layout) { | ||
return controller.applyLayout(layout); | ||
}; | ||
this.columnFromPoint = function (x, y) { | ||
return controller.columnFromPoint(x, y); | ||
}; | ||
Object.defineProperty(this, 'columns', { get: function get() { | ||
return controller.getColumns(); | ||
} }); | ||
} | ||
function ColumnAdapter(controller, column) { | ||
this.css = function () /* attr, value */{ | ||
var attr = arguments[0]; | ||
var value = arguments[1]; | ||
if (arguments.length == 1) { | ||
return column.header.css(attr); | ||
} | ||
if (arguments.length == 2) { | ||
column.header.css(attr, value); | ||
controller.forEachRow(function (row) { | ||
return row[column.id].css(attr, value); | ||
}); | ||
column.css[attr] = value; | ||
} | ||
}; | ||
this.moveBefore = function (index) { | ||
return controller.moveBefore(column, index); | ||
}; | ||
this.exchangeWith = function (index) { | ||
return controller.exchangeWith(column, index); | ||
}; | ||
Object.defineProperty(this, 'columnId', { get: function get() { | ||
return column.id; | ||
} }); | ||
} | ||
function ColumnController(controller, columns, header) { | ||
this.header = header; | ||
this.css = {}; | ||
this.mapTo = columns.length; | ||
this.id = columns.length; | ||
// controller api methods | ||
this.applyLayout = function (layout) { | ||
this.css = angular.extend({}, layout.css); | ||
this.mapTo = layout.mapTo; | ||
applyCss(this.header, this.css); | ||
}; | ||
this.moveBefore = function (target) { | ||
var _this = this; | ||
if (target) { | ||
moveBefore(header, target.header); | ||
controller.forEachRow(function (row) { | ||
return moveBefore(row[_this.id], row[target.id]); | ||
}); | ||
} else { | ||
moveLast(header); | ||
controller.forEachRow(function (row) { | ||
return moveLast(row[_this.id]); | ||
}); | ||
} | ||
}; | ||
this.columnFromPoint = function (x, y) { | ||
var _this2 = this; | ||
if (insidePoint(header, x, y)) { | ||
return this; | ||
} | ||
var result = null; | ||
controller.forEachRow(function (row) { | ||
return result = insidePoint(row[_this2.id], x, y) ? _this2 : result; | ||
}); | ||
return result; | ||
}; | ||
this.applyCss = function (target) { | ||
applyCss(target, this.css); | ||
}; | ||
// function definitions | ||
function insidePoint(element, x, y) { | ||
var offset = element.offset(); | ||
if (x < offset.left || offset.left + element.outerWidth(true) < x) return false; | ||
if (y < offset.top || offset.top + element.outerHeight(true) < y) return false; | ||
return true; | ||
} | ||
function moveBefore(element, target) { | ||
element.detach(); | ||
target.before(element); | ||
} | ||
function moveLast(element) { | ||
var parent = element.parent(); | ||
element.detach(); | ||
parent.append(element); | ||
} | ||
function applyCss(target, css) { | ||
target.removeAttr('style'); | ||
for (var attr in css) { | ||
if (css.hasOwnProperty(attr)) { | ||
target.css(attr, css[attr]); | ||
} | ||
} | ||
} | ||
} | ||
function GridController(scrollViewport) { | ||
var _this3 = this; | ||
var columns = []; | ||
var rowMap = new Map(); | ||
$timeout(function () { | ||
scrollViewport.adapter.publicContext.gridAdapter = new GridAdapter(_this3); | ||
scrollViewport.adapter.transform = function (scope, item) { | ||
return transform(rowMap.get(scope), item); | ||
}; | ||
}); | ||
this.registerColumn = function (header) { | ||
columns.push(new ColumnController(this, columns, header)); | ||
}; | ||
this.registerCell = function (scope, cell) { | ||
var row = rowMap.get(scope); | ||
if (!row) { | ||
row = []; | ||
rowMap.set(scope, row); | ||
} | ||
if (row.length >= columns.length) { | ||
return false; | ||
} | ||
row.push(cell); | ||
return true; | ||
}; | ||
this.unregisterCell = function (scope, cell) { | ||
var row = rowMap.get(scope); | ||
var i = row.indexOf(cell); | ||
row.splice(i, 1); | ||
if (!row.length) { | ||
rowMap.delete(scope); | ||
} | ||
}; | ||
this.forEachRow = function (callback) { | ||
rowMap.forEach(callback); | ||
}; | ||
this.getColumns = function () { | ||
var _this4 = this; | ||
var result = []; | ||
columns.slice().sort(function (a, b) { | ||
return a.mapTo - b.mapTo; | ||
}).forEach(function (column) { | ||
return result.push(new ColumnAdapter(_this4, column)); | ||
}); | ||
return result; | ||
}; | ||
this.getLayout = function () { | ||
var result = []; | ||
columns.forEach(function (column, index) { | ||
return result.push({ | ||
index: index, | ||
css: angular.extend({}, column.css), | ||
mapTo: column.mapTo | ||
}); | ||
}); | ||
return result; | ||
}; | ||
this.applyLayout = function (layouts) { | ||
if (!layouts || layouts.length != columns.length) { | ||
throw new Error('Failed to apply layout - number of layouts should match number of columns'); | ||
} | ||
layouts.forEach(function (layout, index) { | ||
return columns[index].applyLayout(layout); | ||
}); | ||
transform(columns.map(function (column) { | ||
return column.header; | ||
})); | ||
rowMap.forEach(function (row) { | ||
return transform(row); | ||
}); | ||
}; | ||
this.moveBefore = function (selected, target) { | ||
var index = target; | ||
if (target % 1 !== 0) { | ||
index = target ? columns[target.columnId].mapTo : columns.length; | ||
} | ||
if (index < 0 || index > columns.length) { | ||
return; // throw an error? | ||
} | ||
var mapTo = selected.mapTo, | ||
next = null; | ||
index -= mapTo < index ? 1 : 0; | ||
columns.forEach(function (c) { | ||
c.mapTo -= c.mapTo > mapTo ? 1 : 0; | ||
c.mapTo += c.mapTo >= index ? 1 : 0; | ||
next = c.mapTo === index + 1 ? c : next; | ||
}); | ||
selected.mapTo = index; | ||
selected.moveBefore(next); | ||
}; | ||
this.exchangeWith = function (selected, index) { | ||
if (index < 0 || index >= columns.length) { | ||
return; | ||
} | ||
columns.find(function (c) { | ||
return c.mapTo === index; | ||
}).mapTo = selected.mapTo; | ||
selected.mapTo = index; | ||
}; | ||
this.columnFromPoint = function (x, y) { | ||
var column = columns.find(function (col) { | ||
return col.columnFromPoint(x, y); | ||
}); | ||
return column ? new ColumnAdapter(this, column) : undefined; | ||
}; | ||
// function definitions | ||
function transform(row) { | ||
var parent = row[0].parent(); | ||
var visible = []; | ||
row.forEach(function (cell, index) { | ||
columns[index].applyCss(cell); | ||
visible[columns[index].mapTo] = row[index]; | ||
row[index].detach(); | ||
}); | ||
visible.forEach(function (cell) { | ||
return parent.append(cell); | ||
}); | ||
} | ||
} | ||
return { | ||
require: ['^^uiScrollViewport'], | ||
restrict: 'A', | ||
link: function link($scope, element, $attr, controllers) { | ||
controllers[0].gridController = controllers[0].gridController || new GridController(controllers[0]); | ||
controllers[0].gridController.registerColumn(element); | ||
} | ||
}; | ||
}]).directive('uiScrollTd', function () { | ||
return { | ||
require: ['?^^uiScrollViewport'], | ||
restrict: 'A', | ||
link: function link($scope, element, $attr, controllers) { | ||
if (!controllers[0]) { | ||
return; | ||
} | ||
var scope = $scope; | ||
var tdInitializer = $scope.uiScrollTdInitializer; | ||
if (!tdInitializer) { | ||
tdInitializer = $scope.uiScrollTdInitializer = { | ||
linking: true | ||
}; | ||
} | ||
if (!tdInitializer.linking) { | ||
scope = tdInitializer.scope; | ||
} | ||
var gridController = controllers[0].gridController; | ||
if (gridController.registerCell(scope, element)) { | ||
$scope.$on('$destroy', function () { | ||
return gridController.unregisterCell(scope, element); | ||
}); | ||
} | ||
if (!tdInitializer.linking) { | ||
tdInitializer.onLink(); | ||
} | ||
} | ||
}; | ||
}); | ||
/***/ }) | ||
/******/ }); | ||
//# sourceMappingURL=ui-scroll-grid.js.map |
/*! | ||
* angular-ui-scroll (compressed) | ||
* https://github.com/angular-ui/ui-scroll | ||
* Version: 1.6.1 -- 2017-03-03T05:28:34.249Z | ||
* Version: 1.6.2 -- 2017-07-06T23:27:28.966Z | ||
* License: MIT | ||
*/ | ||
!function(t){function n(o){if(r[o])return r[o].exports;var e=r[o]={exports:{},id:o,loaded:!1};return t[o].call(e.exports,e,e.exports,n),e.loaded=!0,e.exports}var r={};return n.m=t,n.c=r,n.p="",n(0)}([function(t,n){"use strict";angular.module("ui.scroll.grid",[]).directive("uiScrollTh",["$log","$timeout",function(t,n){function r(t){this.getLayout=function(){return t.getLayout()},this.applyLayout=function(n){return t.applyLayout(n)},this.columnFromPoint=function(n,r){return t.columnFromPoint(n,r)},Object.defineProperty(this,"columns",{get:function(){return t.getColumns()}})}function o(t,n){this.css=function(){var r=arguments[0],o=arguments[1];return 1==arguments.length?n.header.css(r):void(2==arguments.length&&(n.header.css(r,o),t.forEachRow(function(t){return t[n.id].css(r,o)}),n.css[r]=o))},this.moveBefore=function(r){return t.moveBefore(n,r)},this.exchangeWith=function(r){return t.exchangeWith(n,r)},Object.defineProperty(this,"columnId",{get:function(){return n.id}})}function e(t,n,r){function o(t,n,r){var o=t.offset();return!(n<o.left||o.left+t.outerWidth(!0)<n)&&!(r<o.top||o.top+t.outerHeight(!0)<r)}function e(t,n){t.detach(),n.before(t)}function i(t){var n=t.parent();t.detach(),n.append(t)}function u(t,n){t.removeAttr("style");for(var r in n)n.hasOwnProperty(r)&&t.css(r,n[r])}this.header=r,this.css={},this.mapTo=n.length,this.id=n.length,this.applyLayout=function(t){this.css=angular.extend({},t.css),this.mapTo=t.mapTo,u(this.header,this.css)},this.moveBefore=function(n){var o=this;n?(e(r,n.header),t.forEachRow(function(t){return e(t[o.id],t[n.id])})):(i(r),t.forEachRow(function(t){return i(t[o.id])}))},this.columnFromPoint=function(n,e){var i=this;if(o(r,n,e))return this;var u=null;return t.forEachRow(function(t){return u=o(t[i.id],n,e)?i:u}),u},this.applyCss=function(t){u(t,this.css)}}function i(t){function i(t){var n=t[0].parent(),r=[];t.forEach(function(n,o){c[o].applyCss(n),r[c[o].mapTo]=t[o],t[o].detach()}),r.forEach(function(t){return n.append(t)})}var u=this,c=[],a=new Map;n(function(){t.adapter.publicContext.gridAdapter=new r(u),t.adapter.transform=function(t,n){return i(a.get(t),n)}}),this.registerColumn=function(t){c.push(new e(this,c,t))},this.registerCell=function(t,n){var r=a.get(t);return r||(r=[],a.set(t,r)),!(r.length>=c.length)&&(r.push(n),!0)},this.unregisterCell=function(t,n){var r=a.get(t),o=r.indexOf(n);r.splice(o,1),r.length||a.delete(t)},this.forEachRow=function(t){a.forEach(t)},this.getColumns=function(){var t=this,n=[];return c.slice().sort(function(t,n){return t.mapTo-n.mapTo}).forEach(function(r){return n.push(new o(t,r))}),n},this.getLayout=function(){var t=[];return c.forEach(function(n,r){return t.push({index:r,css:angular.extend({},n.css),mapTo:n.mapTo})}),t},this.applyLayout=function(t){if(!t||t.length!=c.length)throw new Error("Failed to apply layout - number of layouts should match number of columns");t.forEach(function(t,n){return c[n].applyLayout(t)}),i(c.map(function(t){return t.header})),a.forEach(function(t){return i(t)})},this.moveBefore=function(t,n){var r=n;if(n%1!==0&&(r=n?c[n.columnId].mapTo:c.length),!(r<0||r>c.length)){var o=t.mapTo,e=null;r-=o<r?1:0,c.forEach(function(t){t.mapTo-=t.mapTo>o?1:0,t.mapTo+=t.mapTo>=r?1:0,e=t.mapTo===r+1?t:e}),t.mapTo=r,t.moveBefore(e)}},this.exchangeWith=function(t,n){n<0||n>=c.length||(c.find(function(t){return t.mapTo===n}).mapTo=t.mapTo,t.mapTo=n)},this.columnFromPoint=function(t,n){var r=c.find(function(r){return r.columnFromPoint(t,n)});return r?new o(this,r):void 0}}return{require:["^^uiScrollViewport"],restrict:"A",link:function(t,n,r,o){o[0].gridController=o[0].gridController||new i(o[0]),o[0].gridController.registerColumn(n)}}}]).directive("uiScrollTd",function(){return{require:["?^^uiScrollViewport"],restrict:"A",link:function(t,n,r,o){o[0]&&!function(){var r=o[0].gridController;r.registerCell(t,n)&&t.$on("$destroy",function(){return r.unregisterCell(t,n)})}()}}})}]); | ||
!function(t){function n(e){if(r[e])return r[e].exports;var o=r[e]={i:e,l:!1,exports:{}};return t[e].call(o.exports,o,o.exports,n),o.l=!0,o.exports}var r={};n.m=t,n.c=r,n.i=function(t){return t},n.d=function(t,r,e){n.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:e})},n.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(r,"a",r),r},n.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},n.p="",n(n.s=6)}({6:function(t,n,r){"use strict";angular.module("ui.scroll.grid",[]).directive("uiScrollTh",["$log","$timeout",function(t,n){function r(t){this.getLayout=function(){return t.getLayout()},this.applyLayout=function(n){return t.applyLayout(n)},this.columnFromPoint=function(n,r){return t.columnFromPoint(n,r)},Object.defineProperty(this,"columns",{get:function(){return t.getColumns()}})}function e(t,n){this.css=function(){var r=arguments[0],e=arguments[1];if(1==arguments.length)return n.header.css(r);2==arguments.length&&(n.header.css(r,e),t.forEachRow(function(t){return t[n.id].css(r,e)}),n.css[r]=e)},this.moveBefore=function(r){return t.moveBefore(n,r)},this.exchangeWith=function(r){return t.exchangeWith(n,r)},Object.defineProperty(this,"columnId",{get:function(){return n.id}})}function o(t,n,r){function e(t,n,r){var e=t.offset();return!(n<e.left||e.left+t.outerWidth(!0)<n)&&!(r<e.top||e.top+t.outerHeight(!0)<r)}function o(t,n){t.detach(),n.before(t)}function i(t){var n=t.parent();t.detach(),n.append(t)}function u(t,n){t.removeAttr("style");for(var r in n)n.hasOwnProperty(r)&&t.css(r,n[r])}this.header=r,this.css={},this.mapTo=n.length,this.id=n.length,this.applyLayout=function(t){this.css=angular.extend({},t.css),this.mapTo=t.mapTo,u(this.header,this.css)},this.moveBefore=function(n){var e=this;n?(o(r,n.header),t.forEachRow(function(t){return o(t[e.id],t[n.id])})):(i(r),t.forEachRow(function(t){return i(t[e.id])}))},this.columnFromPoint=function(n,o){var i=this;if(e(r,n,o))return this;var u=null;return t.forEachRow(function(t){return u=e(t[i.id],n,o)?i:u}),u},this.applyCss=function(t){u(t,this.css)}}function i(t){function i(t){var n=t[0].parent(),r=[];t.forEach(function(n,e){c[e].applyCss(n),r[c[e].mapTo]=t[e],t[e].detach()}),r.forEach(function(t){return n.append(t)})}var u=this,c=[],a=new Map;n(function(){t.adapter.publicContext.gridAdapter=new r(u),t.adapter.transform=function(t,n){return i(a.get(t))}}),this.registerColumn=function(t){c.push(new o(this,c,t))},this.registerCell=function(t,n){var r=a.get(t);return r||(r=[],a.set(t,r)),!(r.length>=c.length)&&(r.push(n),!0)},this.unregisterCell=function(t,n){var r=a.get(t),e=r.indexOf(n);r.splice(e,1),r.length||a.delete(t)},this.forEachRow=function(t){a.forEach(t)},this.getColumns=function(){var t=this,n=[];return c.slice().sort(function(t,n){return t.mapTo-n.mapTo}).forEach(function(r){return n.push(new e(t,r))}),n},this.getLayout=function(){var t=[];return c.forEach(function(n,r){return t.push({index:r,css:angular.extend({},n.css),mapTo:n.mapTo})}),t},this.applyLayout=function(t){if(!t||t.length!=c.length)throw new Error("Failed to apply layout - number of layouts should match number of columns");t.forEach(function(t,n){return c[n].applyLayout(t)}),i(c.map(function(t){return t.header})),a.forEach(function(t){return i(t)})},this.moveBefore=function(t,n){var r=n;if(n%1!=0&&(r=n?c[n.columnId].mapTo:c.length),!(r<0||r>c.length)){var e=t.mapTo,o=null;r-=e<r?1:0,c.forEach(function(t){t.mapTo-=t.mapTo>e?1:0,t.mapTo+=t.mapTo>=r?1:0,o=t.mapTo===r+1?t:o}),t.mapTo=r,t.moveBefore(o)}},this.exchangeWith=function(t,n){n<0||n>=c.length||(c.find(function(t){return t.mapTo===n}).mapTo=t.mapTo,t.mapTo=n)},this.columnFromPoint=function(t,n){var r=c.find(function(r){return r.columnFromPoint(t,n)});return r?new e(this,r):void 0}}return{require:["^^uiScrollViewport"],restrict:"A",link:function(t,n,r,e){e[0].gridController=e[0].gridController||new i(e[0]),e[0].gridController.registerColumn(n)}}}]).directive("uiScrollTd",function(){return{require:["?^^uiScrollViewport"],restrict:"A",link:function(t,n,r,e){if(e[0]){var o=t,i=t.uiScrollTdInitializer;i||(i=t.uiScrollTdInitializer={linking:!0}),i.linking||(o=i.scope);var u=e[0].gridController;u.registerCell(o,n)&&t.$on("$destroy",function(){return u.unregisterCell(o,n)}),i.linking||i.onLink()}}}})}}); | ||
//# sourceMappingURL=ui-scroll-grid.min.js.map |
/*! | ||
* angular-ui-scroll (uncompressed) | ||
* https://github.com/angular-ui/ui-scroll | ||
* Version: 1.6.1 -- 2017-03-06T07:25:29.944Z | ||
* Version: 1.6.2 -- 2017-07-06T23:27:28.920Z | ||
* License: MIT | ||
@@ -15,10 +15,10 @@ */ | ||
/******/ // Check if module is in cache | ||
/******/ if(installedModules[moduleId]) | ||
/******/ if(installedModules[moduleId]) { | ||
/******/ return installedModules[moduleId].exports; | ||
/******/ | ||
/******/ } | ||
/******/ // Create a new module (and put it into the cache) | ||
/******/ var module = installedModules[moduleId] = { | ||
/******/ exports: {}, | ||
/******/ id: moduleId, | ||
/******/ loaded: false | ||
/******/ i: moduleId, | ||
/******/ l: false, | ||
/******/ exports: {} | ||
/******/ }; | ||
@@ -30,3 +30,3 @@ /******/ | ||
/******/ // Flag the module as loaded | ||
/******/ module.loaded = true; | ||
/******/ module.l = true; | ||
/******/ | ||
@@ -44,2 +44,28 @@ /******/ // Return the exports of the module | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
/******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ if(!__webpack_require__.o(exports, name)) { | ||
/******/ Object.defineProperty(exports, name, { | ||
/******/ configurable: false, | ||
/******/ enumerable: true, | ||
/******/ get: getter | ||
/******/ }); | ||
/******/ } | ||
/******/ }; | ||
/******/ | ||
/******/ // getDefaultExport function for compatibility with non-harmony modules | ||
/******/ __webpack_require__.n = function(module) { | ||
/******/ var getter = module && module.__esModule ? | ||
/******/ function getDefault() { return module['default']; } : | ||
/******/ function getModuleExports() { return module; }; | ||
/******/ __webpack_require__.d(getter, 'a', getter); | ||
/******/ return getter; | ||
/******/ }; | ||
/******/ | ||
/******/ // Object.prototype.hasOwnProperty.call | ||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; | ||
/******/ | ||
/******/ // __webpack_public_path__ | ||
@@ -49,3 +75,3 @@ /******/ __webpack_require__.p = ""; | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(0); | ||
/******/ return __webpack_require__(__webpack_require__.s = 7); | ||
/******/ }) | ||
@@ -55,1489 +81,1530 @@ /************************************************************************/ | ||
/* 0 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
/***/ (function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var _jqLiteExtras = __webpack_require__(1); | ||
var _jqLiteExtras2 = _interopRequireDefault(_jqLiteExtras); | ||
var _elementRoutines = __webpack_require__(2); | ||
var _elementRoutines2 = _interopRequireDefault(_elementRoutines); | ||
var _buffer = __webpack_require__(3); | ||
var _buffer2 = _interopRequireDefault(_buffer); | ||
var _viewport = __webpack_require__(4); | ||
var _viewport2 = _interopRequireDefault(_viewport); | ||
var _adapter = __webpack_require__(6); | ||
var _adapter2 = _interopRequireDefault(_adapter); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
angular.module('ui.scroll', []).service('jqLiteExtras', function () { | ||
return new _jqLiteExtras2.default(); | ||
}).run(['jqLiteExtras', function (jqLiteExtras) { | ||
return !window.jQuery ? jqLiteExtras.registerFor(angular.element) : null; | ||
}]).directive('uiScrollViewport', function () { | ||
return { | ||
restrict: 'A', | ||
controller: ['$scope', '$element', function (scope, element) { | ||
var _this = this; | ||
this.container = element; | ||
this.viewport = element; | ||
this.scope = scope; | ||
angular.forEach(element.children(), function (child) { | ||
if (child.tagName.toLowerCase() === 'tbody') { | ||
_this.viewport = angular.element(child); | ||
} | ||
}); | ||
return this; | ||
}] | ||
}; | ||
}).directive('uiScroll', ['$log', '$injector', '$rootScope', '$timeout', '$q', '$parse', function (console, $injector, $rootScope, $timeout, $q, $parse) { | ||
return { | ||
require: ['?^uiScrollViewport'], | ||
restrict: 'A', | ||
transclude: 'element', | ||
priority: 1000, | ||
terminal: true, | ||
link: link | ||
}; | ||
function link($scope, element, $attr, controllers, linker) { | ||
var match = $attr.uiScroll.match(/^\s*(\w+)\s+in\s+([(\w|\$)\.]+)\s*$/); | ||
if (!match) { | ||
throw new Error('Expected uiScroll in form of \'_item_ in _datasource_\' but got \'' + $attr.uiScroll + '\''); | ||
} | ||
function parseNumericAttr(value, defaultValue) { | ||
var result = $parse(value)($scope); | ||
return isNaN(result) ? defaultValue : result; | ||
} | ||
var BUFFER_MIN = 3; | ||
var BUFFER_DEFAULT = 10; | ||
var PADDING_MIN = 0.3; | ||
var PADDING_DEFAULT = 0.5; | ||
var datasource = null; | ||
var itemName = match[1]; | ||
var datasourceName = match[2]; | ||
var viewportController = controllers[0]; | ||
var bufferSize = Math.max(BUFFER_MIN, parseNumericAttr($attr.bufferSize, BUFFER_DEFAULT)); | ||
var padding = Math.max(PADDING_MIN, parseNumericAttr($attr.padding, PADDING_DEFAULT)); | ||
var startIndex = parseNumericAttr($attr.startIndex, 1); | ||
var ridActual = 0; // current data revision id | ||
var pending = []; | ||
var elementRoutines = new _elementRoutines2.default($injector, $q); | ||
var buffer = new _buffer2.default(elementRoutines, bufferSize); | ||
var viewport = new _viewport2.default(elementRoutines, buffer, element, viewportController, $rootScope, padding); | ||
var adapter = new _adapter2.default(viewport, buffer, adjustBuffer, reload, $attr, $parse, element, $scope); | ||
if (viewportController) { | ||
viewportController.adapter = adapter; | ||
} | ||
var isDatasourceValid = function isDatasourceValid() { | ||
return angular.isObject(datasource) && angular.isFunction(datasource.get); | ||
}; | ||
datasource = $parse(datasourceName)($scope); // try to get datasource on scope | ||
if (!isDatasourceValid()) { | ||
datasource = $injector.get(datasourceName); // try to inject datasource as service | ||
if (!isDatasourceValid()) { | ||
throw new Error(datasourceName + ' is not a valid datasource'); | ||
} | ||
} | ||
var indexStore = {}; | ||
function defineProperty(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; | ||
$timeout(function () { | ||
buffer[propUserName] = value; | ||
if (!pending.length) { | ||
var topPaddingHeightOld = viewport.topDataPos(); | ||
viewport.adjustPadding(); | ||
if (propName === 'minIndex') { | ||
viewport.adjustScrollTopAfterMinIndexSet(topPaddingHeightOld); | ||
} | ||
} | ||
}); | ||
}, | ||
get: function get() { | ||
return indexStore[propName]; | ||
} | ||
}); | ||
} | ||
} | ||
defineProperty(datasource, 'minIndex', 'minIndexUser'); | ||
defineProperty(datasource, 'maxIndex', 'maxIndexUser'); | ||
var fetchNext = datasource.get.length !== 2 ? function (success) { | ||
return datasource.get(buffer.next, bufferSize, success); | ||
} : function (success) { | ||
datasource.get({ | ||
index: buffer.next, | ||
append: buffer.length ? buffer[buffer.length - 1].item : void 0, | ||
count: bufferSize | ||
}, success); | ||
}; | ||
var fetchPrevious = datasource.get.length !== 2 ? function (success) { | ||
return datasource.get(buffer.first - bufferSize, bufferSize, success); | ||
} : function (success) { | ||
datasource.get({ | ||
index: buffer.first - bufferSize, | ||
prepend: buffer.length ? buffer[0].item : void 0, | ||
count: bufferSize | ||
}, success); | ||
}; | ||
/** | ||
* Build padding elements | ||
* | ||
* Calling linker is the only way I found to get access to the tag name of the template | ||
* to prevent the directive scope from pollution a new scope is created and destroyed | ||
* right after the builder creation is completed | ||
*/ | ||
linker(function (clone, scope) { | ||
viewport.createPaddingElements(clone[0]); | ||
// we do not include the clone in the DOM. It means that the nested directives will not | ||
// be able to reach the parent directives, but in this case it is intentional because we | ||
// created the clone to access the template tag name | ||
scope.$destroy(); | ||
clone.remove(); | ||
}); | ||
$scope.$on('$destroy', function () { | ||
unbindEvents(); | ||
viewport.unbind('mousewheel', wheelHandler); | ||
}); | ||
viewport.bind('mousewheel', wheelHandler); | ||
$timeout(function () { | ||
viewport.applyContainerStyle(); | ||
reload(); | ||
}); | ||
/* Private function definitions */ | ||
function isInvalid(rid) { | ||
return rid && rid !== ridActual || $scope.$$destroyed; | ||
} | ||
function bindEvents() { | ||
viewport.bind('resize', resizeAndScrollHandler); | ||
viewport.bind('scroll', resizeAndScrollHandler); | ||
} | ||
function unbindEvents() { | ||
viewport.unbind('resize', resizeAndScrollHandler); | ||
viewport.unbind('scroll', resizeAndScrollHandler); | ||
} | ||
function reload() { | ||
viewport.resetTopPadding(); | ||
viewport.resetBottomPadding(); | ||
if (arguments.length) { | ||
startIndex = arguments[0]; | ||
} | ||
buffer.reset(startIndex); | ||
adjustBuffer(); | ||
} | ||
function isElementVisible(wrapper) { | ||
return wrapper.element.height() && wrapper.element[0].offsetParent; | ||
} | ||
function visibilityWatcher(wrapper) { | ||
if (isElementVisible(wrapper)) { | ||
buffer.forEach(function (item) { | ||
if (angular.isFunction(item.unregisterVisibilityWatcher)) { | ||
item.unregisterVisibilityWatcher(); | ||
delete item.unregisterVisibilityWatcher; | ||
} | ||
}); | ||
if (!pending.length) { | ||
adjustBuffer(); | ||
} | ||
} | ||
} | ||
function insertWrapperContent(wrapper, insertAfter) { | ||
createElement(wrapper, insertAfter, viewport.insertElement); | ||
if (!isElementVisible(wrapper)) { | ||
wrapper.unregisterVisibilityWatcher = wrapper.scope.$watch(function () { | ||
return visibilityWatcher(wrapper); | ||
}); | ||
} | ||
wrapper.element.addClass('ng-hide'); // hide inserted elements before data binding | ||
} | ||
function createElement(wrapper, insertAfter, insertElement) { | ||
var promises = null; | ||
var sibling = insertAfter > 0 ? buffer[insertAfter - 1].element : undefined; | ||
linker(function (clone, scope) { | ||
promises = insertElement(clone, sibling); | ||
wrapper.element = clone; | ||
wrapper.scope = scope; | ||
scope[itemName] = wrapper.item; | ||
}); | ||
if (adapter.transform) adapter.transform(wrapper.scope, wrapper.element); | ||
return promises; | ||
} | ||
function updateDOM() { | ||
var promises = []; | ||
var toBePrepended = []; | ||
var toBeRemoved = []; | ||
var inserted = []; | ||
buffer.forEach(function (wrapper, i) { | ||
switch (wrapper.op) { | ||
case 'prepend': | ||
toBePrepended.unshift(wrapper); | ||
break; | ||
case 'append': | ||
insertWrapperContent(wrapper, i); | ||
wrapper.op = 'none'; | ||
inserted.push(wrapper); | ||
break; | ||
case 'insert': | ||
promises = promises.concat(createElement(wrapper, i, viewport.insertElementAnimated)); | ||
wrapper.op = 'none'; | ||
inserted.push(wrapper); | ||
break; | ||
case 'remove': | ||
toBeRemoved.push(wrapper); | ||
} | ||
}); | ||
toBeRemoved.forEach(function (wrapper) { | ||
return promises = promises.concat(buffer.remove(wrapper)); | ||
}); | ||
if (toBePrepended.length) toBePrepended.forEach(function (wrapper) { | ||
insertWrapperContent(wrapper); | ||
wrapper.op = 'none'; | ||
}); | ||
buffer.forEach(function (item, i) { | ||
return item.scope.$index = buffer.first + i; | ||
}); | ||
return { | ||
prepended: toBePrepended, | ||
removed: toBeRemoved, | ||
inserted: inserted, | ||
animated: promises | ||
}; | ||
} | ||
function updatePaddings(rid, updates) { | ||
// schedule another adjustBuffer after animation completion | ||
if (updates.animated.length) { | ||
$q.all(updates.animated).then(function () { | ||
viewport.adjustPadding(); | ||
adjustBuffer(rid); | ||
}); | ||
} else { | ||
viewport.adjustPadding(); | ||
} | ||
} | ||
function enqueueFetch(rid, updates) { | ||
if (viewport.shouldLoadBottom()) { | ||
if (!updates || buffer.effectiveHeight(updates.inserted) > 0) { | ||
// this means that at least one item appended in the last batch has height > 0 | ||
if (pending.push(true) === 1) { | ||
fetch(rid); | ||
adapter.loading(true); | ||
} | ||
} | ||
} else if (viewport.shouldLoadTop()) { | ||
if (!updates || buffer.effectiveHeight(updates.prepended) > 0 || pending[0]) { | ||
// this means that at least one item appended in the last batch has height > 0 | ||
// pending[0] = true means that previous fetch was appending. We need to force at least one prepend | ||
// BTW there will always be at least 1 element in the pending array because bottom is fetched first | ||
if (pending.push(false) === 1) { | ||
fetch(rid); | ||
adapter.loading(true); | ||
} | ||
} | ||
} | ||
} | ||
function adjustBuffer(rid) { | ||
if (!rid) { | ||
// dismiss pending requests | ||
pending = []; | ||
rid = ++ridActual; | ||
} | ||
var updates = updateDOM(); | ||
// We need the item bindings to be processed before we can do adjustment | ||
$timeout(function () { | ||
// show elements after data binging has been done | ||
updates.inserted.forEach(function (w) { | ||
return w.element.removeClass('ng-hide'); | ||
}); | ||
updates.prepended.forEach(function (w) { | ||
return w.element.removeClass('ng-hide'); | ||
}); | ||
if (isInvalid(rid)) { | ||
return; | ||
} | ||
updatePaddings(rid, updates); | ||
enqueueFetch(rid); | ||
if (!pending.length) { | ||
adapter.calculateProperties(); | ||
} | ||
}); | ||
} | ||
function adjustBufferAfterFetch(rid) { | ||
var updates = updateDOM(); | ||
// We need the item bindings to be processed before we can do adjustment | ||
$timeout(function () { | ||
// show elements after data binging has been done | ||
updates.inserted.forEach(function (w) { | ||
return w.element.removeClass('ng-hide'); | ||
}); | ||
updates.prepended.forEach(function (w) { | ||
return w.element.removeClass('ng-hide'); | ||
}); | ||
viewport.adjustScrollTopAfterPrepend(updates); | ||
if (isInvalid(rid)) { | ||
return; | ||
} | ||
updatePaddings(rid, updates); | ||
enqueueFetch(rid, updates); | ||
pending.shift(); | ||
if (pending.length) fetch(rid);else { | ||
adapter.loading(false); | ||
bindEvents(); | ||
adapter.calculateProperties(); | ||
} | ||
}); | ||
} | ||
function fetch(rid) { | ||
if (pending[0]) { | ||
// scrolling down | ||
if (buffer.length && !viewport.shouldLoadBottom()) { | ||
adjustBufferAfterFetch(rid); | ||
} else { | ||
fetchNext(function (result) { | ||
if (isInvalid(rid)) { | ||
return; | ||
} | ||
if (result.length < bufferSize) { | ||
buffer.eof = true; | ||
} | ||
if (result.length > 0) { | ||
viewport.clipTop(); | ||
buffer.append(result); | ||
} | ||
adjustBufferAfterFetch(rid); | ||
}); | ||
} | ||
} else { | ||
// scrolling up | ||
if (buffer.length && !viewport.shouldLoadTop()) { | ||
adjustBufferAfterFetch(rid); | ||
} else { | ||
fetchPrevious(function (result) { | ||
if (isInvalid(rid)) { | ||
return; | ||
} | ||
if (result.length < bufferSize) { | ||
buffer.bof = true; | ||
// log 'bof is reached' | ||
} | ||
if (result.length > 0) { | ||
if (buffer.length) { | ||
viewport.clipBottom(); | ||
} | ||
buffer.prepend(result); | ||
} | ||
adjustBufferAfterFetch(rid); | ||
}); | ||
} | ||
} | ||
} | ||
function resizeAndScrollHandler() { | ||
if (!$rootScope.$$phase && !adapter.isLoading && !adapter.disabled) { | ||
enqueueFetch(ridActual); | ||
if (pending.length) { | ||
unbindEvents(); | ||
} else { | ||
adapter.calculateProperties(); | ||
$scope.$apply(); | ||
} | ||
} | ||
} | ||
function wheelHandler(event) { | ||
if (!adapter.disabled) { | ||
var scrollTop = viewport[0].scrollTop; | ||
var yMax = viewport[0].scrollHeight - viewport[0].clientHeight; | ||
if (scrollTop === 0 && !buffer.bof || scrollTop === yMax && !buffer.eof) { | ||
event.preventDefault(); | ||
} | ||
} | ||
} | ||
} | ||
}]); | ||
"use strict"; | ||
/***/ }, | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function getCtrlOnData(attr, element) { | ||
var onSyntax = attr.match(/^(.+)(\s+on\s+)(.+)?/); | ||
if (onSyntax && onSyntax.length === 4) { | ||
window.console.log('Angular ui-scroll adapter assignment warning. "Controller On" syntax has been deprecated since ui-scroll v1.6.1.'); | ||
var ctrl = onSyntax[3]; | ||
var tail = onSyntax[1]; | ||
var candidate = element; | ||
while (candidate.length) { | ||
var candidateScope = candidate.scope(); // doesn't work when debugInfoEnabled flag = true | ||
var candidateName = (candidate.attr('ng-controller') || '').match(/(\w(?:\w|\d)*)(?:\s+as\s+(\w(?:\w|\d)*))?/); | ||
if (candidateName && candidateName[1] === ctrl) { | ||
return { | ||
target: candidateScope, | ||
source: tail | ||
}; | ||
} | ||
candidate = candidate.parent(); | ||
} | ||
throw new Error('Angular ui-scroll adapter assignment error. Failed to locate target controller "' + ctrl + '" to inject "' + tail + '"'); | ||
} | ||
} | ||
var Adapter = function () { | ||
function Adapter(viewport, buffer, adjustBuffer, reload, $attr, $parse, element, $scope) { | ||
_classCallCheck(this, Adapter); | ||
this.viewport = viewport; | ||
this.buffer = buffer; | ||
this.adjustBuffer = adjustBuffer; | ||
this.reload = reload; | ||
this.isLoading = false; | ||
this.disabled = false; | ||
var viewportScope = viewport.getScope(); | ||
this.startScope = viewportScope.$parent ? viewportScope : $scope; | ||
this.publicContext = {}; | ||
this.assignAdapter($attr.adapter, $parse, element); | ||
this.generatePublicContext($attr, $parse); | ||
} | ||
_createClass(Adapter, [{ | ||
key: 'assignAdapter', | ||
value: function assignAdapter(adapterAttr, $parse, element) { | ||
if (!adapterAttr || !(adapterAttr = adapterAttr.replace(/^\s+|\s+$/gm, ''))) { | ||
return; | ||
} | ||
var ctrlOnData = getCtrlOnData(adapterAttr, element); | ||
var adapterOnScope = void 0; | ||
try { | ||
if (ctrlOnData) { | ||
// "Controller On", deprecated since v1.6.1 | ||
$parse(ctrlOnData.source).assign(ctrlOnData.target, {}); | ||
adapterOnScope = $parse(ctrlOnData.source)(ctrlOnData.target); | ||
} else { | ||
$parse(adapterAttr).assign(this.startScope, {}); | ||
adapterOnScope = $parse(adapterAttr)(this.startScope); | ||
} | ||
} catch (error) { | ||
error.message = 'Angular ui-scroll Adapter assignment exception.\n' + ('Can\'t parse "' + adapterAttr + '" expression.\n') + error.message; | ||
throw error; | ||
} | ||
angular.extend(adapterOnScope, this.publicContext); | ||
this.publicContext = adapterOnScope; | ||
} | ||
}, { | ||
key: 'generatePublicContext', | ||
value: function generatePublicContext($attr, $parse) { | ||
var _this = this; | ||
// these methods will be accessible out of ui-scroll via user defined adapter | ||
var publicMethods = ['reload', 'applyUpdates', 'append', 'prepend', 'isBOF', 'isEOF', 'isEmpty']; | ||
for (var i = publicMethods.length - 1; i >= 0; i--) { | ||
this.publicContext[publicMethods[i]] = this[publicMethods[i]].bind(this); | ||
} | ||
// these read-only props will be accessible out of ui-scroll via user defined adapter | ||
var publicProps = ['isLoading', 'topVisible', 'topVisibleElement', 'topVisibleScope', 'bottomVisible', 'bottomVisibleElement', 'bottomVisibleScope']; | ||
var _loop = function _loop(_i) { | ||
var property = void 0, | ||
attr = $attr[publicProps[_i]]; | ||
Object.defineProperty(_this, publicProps[_i], { | ||
get: function get() { | ||
return property; | ||
}, | ||
set: function set(value) { | ||
property = value; | ||
_this.publicContext[publicProps[_i]] = value; | ||
if (attr) { | ||
$parse(attr).assign(_this.startScope, value); | ||
} | ||
} | ||
}); | ||
}; | ||
for (var _i = publicProps.length - 1; _i >= 0; _i--) { | ||
_loop(_i); | ||
} | ||
// non-read-only public property | ||
Object.defineProperty(this.publicContext, 'disabled', { | ||
get: function get() { | ||
return _this.disabled; | ||
}, | ||
set: function set(value) { | ||
return !(_this.disabled = value) ? _this.adjustBuffer() : null; | ||
} | ||
}); | ||
} | ||
}, { | ||
key: 'loading', | ||
value: function loading(value) { | ||
this['isLoading'] = value; | ||
} | ||
}, { | ||
key: 'isBOF', | ||
value: function isBOF() { | ||
return this.buffer.bof; | ||
} | ||
}, { | ||
key: 'isEOF', | ||
value: function isEOF() { | ||
return this.buffer.eof; | ||
} | ||
}, { | ||
key: 'isEmpty', | ||
value: function isEmpty() { | ||
return !this.buffer.length; | ||
} | ||
}, { | ||
key: 'applyUpdates', | ||
value: function applyUpdates(arg1, arg2) { | ||
var _this2 = this; | ||
if (angular.isFunction(arg1)) { | ||
// arg1 is the updater function, arg2 is ignored | ||
this.buffer.slice(0).forEach(function (wrapper) { | ||
// we need to do it on the buffer clone, because buffer content | ||
// may change as we iterate through | ||
_this2.applyUpdate(wrapper, arg1(wrapper.item, wrapper.scope, wrapper.element)); | ||
}); | ||
} else { | ||
// arg1 is item index, arg2 is the newItems array | ||
if (arg1 % 1 !== 0) { | ||
// checking if it is an integer | ||
throw new Error('applyUpdates - ' + arg1 + ' is not a valid index'); | ||
} | ||
var index = arg1 - this.buffer.first; | ||
if (index >= 0 && index < this.buffer.length) { | ||
this.applyUpdate(this.buffer[index], arg2); | ||
} | ||
} | ||
this.adjustBuffer(); | ||
} | ||
}, { | ||
key: 'append', | ||
value: function append(newItems) { | ||
this.buffer.append(newItems); | ||
this.adjustBuffer(); | ||
} | ||
}, { | ||
key: 'prepend', | ||
value: function prepend(newItems) { | ||
this.buffer.prepend(newItems); | ||
this.adjustBuffer(); | ||
} | ||
}, { | ||
key: 'calculateProperties', | ||
value: function calculateProperties() { | ||
var rowTop = null, | ||
topHeight = 0; | ||
var topDone = false, | ||
bottomDone = false; | ||
var length = this.buffer.length; | ||
for (var i = 0; i < length; i++) { | ||
var item = this.buffer[i]; | ||
var itemTop = item.element.offset().top; | ||
if (rowTop !== itemTop) { | ||
// a new row condition | ||
var itemHeight = item.element.outerHeight(true); | ||
var top = this.viewport.topDataPos() + topHeight + itemHeight; | ||
if (!topDone && top > this.viewport.topVisiblePos()) { | ||
topDone = true; | ||
this['topVisible'] = item.item; | ||
this['topVisibleElement'] = item.element; | ||
this['topVisibleScope'] = item.scope; | ||
} | ||
if (!bottomDone && (top >= this.viewport.bottomVisiblePos() || i === length - 1 && this.isEOF())) { | ||
bottomDone = true; | ||
this['bottomVisible'] = item.item; | ||
this['bottomVisibleElement'] = item.element; | ||
this['bottomVisibleScope'] = item.scope; | ||
} | ||
topHeight += itemHeight; | ||
} | ||
rowTop = itemTop; | ||
if (topDone && bottomDone) { | ||
break; | ||
} | ||
} | ||
} | ||
}, { | ||
key: 'applyUpdate', | ||
value: function applyUpdate(wrapper, newItems) { | ||
var _this3 = this; | ||
if (!angular.isArray(newItems)) { | ||
return; | ||
} | ||
var keepIt = void 0; | ||
var pos = this.buffer.indexOf(wrapper) + 1; | ||
newItems.reverse().forEach(function (newItem) { | ||
if (newItem === wrapper.item) { | ||
keepIt = true; | ||
pos--; | ||
} else { | ||
_this3.buffer.insert(pos, newItem); | ||
} | ||
}); | ||
if (!keepIt) { | ||
wrapper.op = 'remove'; | ||
} | ||
} | ||
}]); | ||
return Adapter; | ||
}(); | ||
exports.default = Adapter; | ||
/***/ }), | ||
/* 1 */ | ||
/***/ function(module, exports) { | ||
/***/ (function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
/*! | ||
globals: angular, window | ||
List of used element methods available in JQuery but not in JQuery Lite | ||
element.before(elem) | ||
element.height() | ||
element.outerHeight(true) | ||
element.height(value) = only for Top/Bottom padding elements | ||
element.scrollTop() | ||
element.scrollTop(value) | ||
*/ | ||
var JQLiteExtras = function () { | ||
function JQLiteExtras() { | ||
_classCallCheck(this, JQLiteExtras); | ||
} | ||
_createClass(JQLiteExtras, [{ | ||
key: 'registerFor', | ||
value: function registerFor(element) { | ||
var convertToPx = void 0, | ||
css = void 0, | ||
getStyle = void 0, | ||
isWindow = void 0; | ||
// angular implementation blows up if elem is the window | ||
css = angular.element.prototype.css; | ||
element.prototype.css = function (name, value) { | ||
var self = this; | ||
var elem = self[0]; | ||
if (!(!elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style)) { | ||
return css.call(self, name, value); | ||
} | ||
}; | ||
// as defined in angularjs v1.0.5 | ||
isWindow = function isWindow(obj) { | ||
return obj && obj.document && obj.location && obj.alert && obj.setInterval; | ||
}; | ||
function scrollTo(self, direction, value) { | ||
var elem = self[0]; | ||
var _top$left$direction = _slicedToArray({ | ||
top: ['scrollTop', 'pageYOffset', 'scrollLeft'], | ||
left: ['scrollLeft', 'pageXOffset', 'scrollTop'] | ||
}[direction], 3), | ||
method = _top$left$direction[0], | ||
prop = _top$left$direction[1], | ||
preserve = _top$left$direction[2]; | ||
if (isWindow(elem)) { | ||
if (angular.isDefined(value)) { | ||
return elem.scrollTo(self[preserve].call(self), value); | ||
} | ||
return prop in elem ? elem[prop] : elem.document.documentElement[method]; | ||
} else { | ||
if (angular.isDefined(value)) { | ||
elem[method] = value; | ||
} | ||
return elem[method]; | ||
} | ||
} | ||
if (window.getComputedStyle) { | ||
getStyle = function getStyle(elem) { | ||
return window.getComputedStyle(elem, null); | ||
}; | ||
convertToPx = function convertToPx(elem, value) { | ||
return parseFloat(value); | ||
}; | ||
} else { | ||
getStyle = function getStyle(elem) { | ||
return elem.currentStyle; | ||
}; | ||
convertToPx = function convertToPx(elem, value) { | ||
var left = void 0, | ||
result = void 0, | ||
rs = void 0, | ||
rsLeft = void 0, | ||
style = void 0; | ||
var core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source; | ||
var rnumnonpx = new RegExp('^(' + core_pnum + ')(?!px)[a-z%]+$', 'i'); | ||
if (!rnumnonpx.test(value)) { | ||
return parseFloat(value); | ||
} | ||
// ported from JQuery | ||
style = elem.style; | ||
left = style.left; | ||
rs = elem.runtimeStyle; | ||
rsLeft = rs && rs.left; | ||
if (rs) { | ||
rs.left = style.left; | ||
} | ||
// put in the new values to get a computed style out | ||
style.left = value; | ||
result = style.pixelLeft; | ||
style.left = left; | ||
if (rsLeft) { | ||
rs.left = rsLeft; | ||
} | ||
return result; | ||
}; | ||
} | ||
function getMeasurements(elem, measure) { | ||
var base = void 0, | ||
borderA = void 0, | ||
borderB = void 0, | ||
computedMarginA = void 0, | ||
computedMarginB = void 0, | ||
computedStyle = void 0, | ||
dirA = void 0, | ||
dirB = void 0, | ||
marginA = void 0, | ||
marginB = void 0, | ||
paddingA = void 0, | ||
paddingB = void 0; | ||
if (isWindow(elem)) { | ||
base = document.documentElement[{ height: 'clientHeight', width: 'clientWidth' }[measure]]; | ||
return { | ||
base: base, | ||
padding: 0, | ||
border: 0, | ||
margin: 0 | ||
}; | ||
} | ||
// Start with offset property | ||
var _width$height$measure = _slicedToArray({ | ||
width: [elem.offsetWidth, 'Left', 'Right'], | ||
height: [elem.offsetHeight, 'Top', 'Bottom'] | ||
}[measure], 3); | ||
base = _width$height$measure[0]; | ||
dirA = _width$height$measure[1]; | ||
dirB = _width$height$measure[2]; | ||
computedStyle = getStyle(elem); | ||
paddingA = convertToPx(elem, computedStyle['padding' + dirA]) || 0; | ||
paddingB = convertToPx(elem, computedStyle['padding' + dirB]) || 0; | ||
borderA = convertToPx(elem, computedStyle['border' + dirA + 'Width']) || 0; | ||
borderB = convertToPx(elem, computedStyle['border' + dirB + 'Width']) || 0; | ||
computedMarginA = computedStyle['margin' + dirA]; | ||
computedMarginB = computedStyle['margin' + dirB]; | ||
// I do not care for width for now, so this hack is irrelevant | ||
// if ( !supportsPercentMargin ) | ||
// computedMarginA = hackPercentMargin( elem, computedStyle, computedMarginA ) | ||
// computedMarginB = hackPercentMargin( elem, computedStyle, computedMarginB ) | ||
marginA = convertToPx(elem, computedMarginA) || 0; | ||
marginB = convertToPx(elem, computedMarginB) || 0; | ||
return { | ||
base: base, | ||
padding: paddingA + paddingB, | ||
border: borderA + borderB, | ||
margin: marginA + marginB | ||
}; | ||
} | ||
function getWidthHeight(elem, direction, measure) { | ||
var computedStyle = void 0, | ||
result = void 0; | ||
var measurements = getMeasurements(elem, direction); | ||
if (measurements.base > 0) { | ||
return { | ||
base: measurements.base - measurements.padding - measurements.border, | ||
outer: measurements.base, | ||
outerfull: measurements.base + measurements.margin | ||
}[measure]; | ||
} | ||
// Fall back to computed then uncomputed css if necessary | ||
computedStyle = getStyle(elem); | ||
result = computedStyle[direction]; | ||
if (result < 0 || result === null) { | ||
result = elem.style[direction] || 0; | ||
} | ||
// Normalize "", auto, and prepare for extra | ||
result = parseFloat(result) || 0; | ||
return { | ||
base: result - measurements.padding - measurements.border, | ||
outer: result, | ||
outerfull: result + measurements.padding + measurements.border + measurements.margin | ||
}[measure]; | ||
} | ||
// define missing methods | ||
return angular.forEach({ | ||
before: function before(newElem) { | ||
var children, elem, i, j, parent, ref, self; | ||
self = this; | ||
elem = self[0]; | ||
parent = self.parent(); | ||
children = parent.contents(); | ||
if (children[0] === elem) { | ||
return parent.prepend(newElem); | ||
} else { | ||
for (i = j = 1, ref = children.length - 1; 1 <= ref ? j <= ref : j >= ref; i = 1 <= ref ? ++j : --j) { | ||
if (children[i] === elem) { | ||
angular.element(children[i - 1]).after(newElem); | ||
return; | ||
} | ||
} | ||
throw new Error('invalid DOM structure ' + elem.outerHTML); | ||
} | ||
}, | ||
height: function height(value) { | ||
var self; | ||
self = this; | ||
if (angular.isDefined(value)) { | ||
if (angular.isNumber(value)) { | ||
value = value + 'px'; | ||
} | ||
return css.call(self, 'height', value); | ||
} else { | ||
return getWidthHeight(this[0], 'height', 'base'); | ||
} | ||
}, | ||
outerHeight: function outerHeight(option) { | ||
return getWidthHeight(this[0], 'height', option ? 'outerfull' : 'outer'); | ||
}, | ||
outerWidth: function outerWidth(option) { | ||
return getWidthHeight(this[0], 'width', option ? 'outerfull' : 'outer'); | ||
}, | ||
/* | ||
The offset setter method is not implemented | ||
*/ | ||
offset: function offset(value) { | ||
var docElem = void 0, | ||
win = void 0; | ||
var self = this; | ||
var box = { | ||
top: 0, | ||
left: 0 | ||
}; | ||
var elem = self[0]; | ||
var doc = elem && elem.ownerDocument; | ||
if (arguments.length) { | ||
if (value === undefined) { | ||
return self; | ||
} | ||
// TODO: implement setter | ||
throw new Error('offset setter method is not implemented'); | ||
} | ||
if (!doc) { | ||
return; | ||
} | ||
docElem = doc.documentElement; | ||
// TODO: Make sure it's not a disconnected DOM node | ||
if (elem.getBoundingClientRect != null) { | ||
box = elem.getBoundingClientRect(); | ||
} | ||
win = doc.defaultView || doc.parentWindow; | ||
return { | ||
top: box.top + (win.pageYOffset || docElem.scrollTop) - (docElem.clientTop || 0), | ||
left: box.left + (win.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || 0) | ||
}; | ||
}, | ||
scrollTop: function scrollTop(value) { | ||
return scrollTo(this, 'top', value); | ||
}, | ||
scrollLeft: function scrollLeft(value) { | ||
return scrollTo(this, 'left', value); | ||
} | ||
}, function (value, key) { | ||
if (!element.prototype[key]) { | ||
return element.prototype[key] = value; | ||
} | ||
}); | ||
} | ||
}]); | ||
return JQLiteExtras; | ||
}(); | ||
exports.default = JQLiteExtras; | ||
"use strict"; | ||
/***/ }, | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = ScrollBuffer; | ||
function ScrollBuffer(elementRoutines, bufferSize) { | ||
var buffer = Object.create(Array.prototype); | ||
angular.extend(buffer, { | ||
size: bufferSize, | ||
reset: function reset(startIndex) { | ||
buffer.remove(0, buffer.length); | ||
buffer.eof = false; | ||
buffer.bof = false; | ||
buffer.first = startIndex; | ||
buffer.next = startIndex; | ||
buffer.minIndex = startIndex; | ||
buffer.maxIndex = startIndex; | ||
buffer.minIndexUser = null; | ||
buffer.maxIndexUser = null; | ||
}, | ||
append: function append(items) { | ||
items.forEach(function (item) { | ||
++buffer.next; | ||
buffer.insert('append', item); | ||
}); | ||
buffer.maxIndex = buffer.eof ? buffer.next - 1 : Math.max(buffer.next - 1, buffer.maxIndex); | ||
}, | ||
prepend: function prepend(items) { | ||
items.reverse().forEach(function (item) { | ||
--buffer.first; | ||
buffer.insert('prepend', item); | ||
}); | ||
buffer.minIndex = buffer.bof ? buffer.minIndex = buffer.first : Math.min(buffer.first, buffer.minIndex); | ||
}, | ||
/** | ||
* inserts wrapped element in the buffer | ||
* the first argument is either operation keyword (see below) or a number for operation 'insert' | ||
* for insert the number is the index for the buffer element the new one have to be inserted after | ||
* operations: 'append', 'prepend', 'insert', 'remove', 'update', 'none' | ||
*/ | ||
insert: function insert(operation, item) { | ||
var wrapper = { | ||
item: item | ||
}; | ||
if (operation % 1 === 0) { | ||
// it is an insert | ||
wrapper.op = 'insert'; | ||
buffer.splice(operation, 0, wrapper); | ||
} else { | ||
wrapper.op = operation; | ||
switch (operation) { | ||
case 'append': | ||
buffer.push(wrapper); | ||
break; | ||
case 'prepend': | ||
buffer.unshift(wrapper); | ||
break; | ||
} | ||
} | ||
}, | ||
// removes elements from buffer | ||
remove: function remove(arg1, arg2) { | ||
if (angular.isNumber(arg1)) { | ||
// removes items from arg1 (including) through arg2 (excluding) | ||
for (var i = arg1; i < arg2; i++) { | ||
elementRoutines.removeElement(buffer[i]); | ||
} | ||
return buffer.splice(arg1, arg2 - arg1); | ||
} | ||
// removes single item(wrapper) from the buffer | ||
buffer.splice(buffer.indexOf(arg1), 1); | ||
return elementRoutines.removeElementAnimated(arg1); | ||
}, | ||
effectiveHeight: function effectiveHeight(elements) { | ||
if (!elements.length) { | ||
return 0; | ||
} | ||
var top = Number.MAX_VALUE; | ||
var bottom = Number.MIN_VALUE; | ||
elements.forEach(function (wrapper) { | ||
if (wrapper.element[0].offsetParent) { | ||
// element style is not display:none | ||
top = Math.min(top, wrapper.element.offset().top); | ||
bottom = Math.max(bottom, wrapper.element.offset().top + wrapper.element.outerHeight(true)); | ||
} | ||
}); | ||
return Math.max(0, bottom - top); | ||
} | ||
}); | ||
return buffer; | ||
} | ||
/***/ }), | ||
/* 2 */ | ||
/***/ function(module, exports) { | ||
/***/ (function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var ElementRoutines = function () { | ||
function ElementRoutines($injector, $q) { | ||
_classCallCheck(this, ElementRoutines); | ||
this.$animate = $injector.has && $injector.has('$animate') ? $injector.get('$animate') : null; | ||
this.isAngularVersionLessThen1_3 = angular.version.major === 1 && angular.version.minor < 3; | ||
this.$q = $q; | ||
} | ||
_createClass(ElementRoutines, [{ | ||
key: 'insertElement', | ||
value: function insertElement(newElement, previousElement) { | ||
previousElement.after(newElement); | ||
return []; | ||
} | ||
}, { | ||
key: 'removeElement', | ||
value: function removeElement(wrapper) { | ||
wrapper.element.remove(); | ||
wrapper.scope.$destroy(); | ||
return []; | ||
} | ||
}, { | ||
key: 'insertElementAnimated', | ||
value: function insertElementAnimated(newElement, previousElement) { | ||
var _this = this; | ||
if (!this.$animate) { | ||
return this.insertElement(newElement, previousElement); | ||
} | ||
if (this.isAngularVersionLessThen1_3) { | ||
var _ret = function () { | ||
var deferred = _this.$q.defer(); | ||
// no need for parent - previous element is never null | ||
_this.$animate.enter(newElement, null, previousElement, function () { | ||
return deferred.resolve(); | ||
}); | ||
return { | ||
v: [deferred.promise] | ||
}; | ||
}(); | ||
if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === "object") return _ret.v; | ||
} | ||
// no need for parent - previous element is never null | ||
return [this.$animate.enter(newElement, null, previousElement)]; | ||
} | ||
}, { | ||
key: 'removeElementAnimated', | ||
value: function removeElementAnimated(wrapper) { | ||
var _this2 = this; | ||
if (!this.$animate) { | ||
return this.removeElement(wrapper); | ||
} | ||
if (this.isAngularVersionLessThen1_3) { | ||
var _ret2 = function () { | ||
var deferred = _this2.$q.defer(); | ||
_this2.$animate.leave(wrapper.element, function () { | ||
wrapper.scope.$destroy(); | ||
return deferred.resolve(); | ||
}); | ||
return { | ||
v: [deferred.promise] | ||
}; | ||
}(); | ||
if ((typeof _ret2 === 'undefined' ? 'undefined' : _typeof(_ret2)) === "object") return _ret2.v; | ||
} | ||
return [this.$animate.leave(wrapper.element).then(function () { | ||
return wrapper.scope.$destroy(); | ||
})]; | ||
} | ||
}]); | ||
return ElementRoutines; | ||
}(); | ||
exports.default = ElementRoutines; | ||
"use strict"; | ||
/***/ }, | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var ElementRoutines = function () { | ||
function ElementRoutines($injector, $q) { | ||
_classCallCheck(this, ElementRoutines); | ||
this.$animate = $injector.has && $injector.has('$animate') ? $injector.get('$animate') : null; | ||
this.isAngularVersionLessThen1_3 = angular.version.major === 1 && angular.version.minor < 3; | ||
this.$q = $q; | ||
} | ||
_createClass(ElementRoutines, [{ | ||
key: 'insertElement', | ||
value: function insertElement(newElement, previousElement) { | ||
previousElement.after(newElement); | ||
return []; | ||
} | ||
}, { | ||
key: 'removeElement', | ||
value: function removeElement(wrapper) { | ||
wrapper.element.remove(); | ||
wrapper.scope.$destroy(); | ||
return []; | ||
} | ||
}, { | ||
key: 'insertElementAnimated', | ||
value: function insertElementAnimated(newElement, previousElement) { | ||
if (!this.$animate) { | ||
return this.insertElement(newElement, previousElement); | ||
} | ||
if (this.isAngularVersionLessThen1_3) { | ||
var deferred = this.$q.defer(); | ||
// no need for parent - previous element is never null | ||
this.$animate.enter(newElement, null, previousElement, function () { | ||
return deferred.resolve(); | ||
}); | ||
return [deferred.promise]; | ||
} | ||
// no need for parent - previous element is never null | ||
return [this.$animate.enter(newElement, null, previousElement)]; | ||
} | ||
}, { | ||
key: 'removeElementAnimated', | ||
value: function removeElementAnimated(wrapper) { | ||
if (!this.$animate) { | ||
return this.removeElement(wrapper); | ||
} | ||
if (this.isAngularVersionLessThen1_3) { | ||
var deferred = this.$q.defer(); | ||
this.$animate.leave(wrapper.element, function () { | ||
wrapper.scope.$destroy(); | ||
return deferred.resolve(); | ||
}); | ||
return [deferred.promise]; | ||
} | ||
return [this.$animate.leave(wrapper.element).then(function () { | ||
return wrapper.scope.$destroy(); | ||
})]; | ||
} | ||
}]); | ||
return ElementRoutines; | ||
}(); | ||
exports.default = ElementRoutines; | ||
/***/ }), | ||
/* 3 */ | ||
/***/ function(module, exports) { | ||
/***/ (function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = ScrollBuffer; | ||
function ScrollBuffer(elementRoutines, bufferSize) { | ||
var buffer = Object.create(Array.prototype); | ||
angular.extend(buffer, { | ||
size: bufferSize, | ||
reset: function reset(startIndex) { | ||
buffer.remove(0, buffer.length); | ||
buffer.eof = false; | ||
buffer.bof = false; | ||
buffer.first = startIndex; | ||
buffer.next = startIndex; | ||
buffer.minIndex = startIndex; | ||
buffer.maxIndex = startIndex; | ||
buffer.minIndexUser = null; | ||
buffer.maxIndexUser = null; | ||
}, | ||
append: function append(items) { | ||
items.forEach(function (item) { | ||
++buffer.next; | ||
buffer.insert('append', item); | ||
}); | ||
buffer.maxIndex = buffer.eof ? buffer.next - 1 : Math.max(buffer.next - 1, buffer.maxIndex); | ||
}, | ||
prepend: function prepend(items) { | ||
items.reverse().forEach(function (item) { | ||
--buffer.first; | ||
buffer.insert('prepend', item); | ||
}); | ||
buffer.minIndex = buffer.bof ? buffer.minIndex = buffer.first : Math.min(buffer.first, buffer.minIndex); | ||
}, | ||
/** | ||
* inserts wrapped element in the buffer | ||
* the first argument is either operation keyword (see below) or a number for operation 'insert' | ||
* for insert the number is the index for the buffer element the new one have to be inserted after | ||
* operations: 'append', 'prepend', 'insert', 'remove', 'update', 'none' | ||
*/ | ||
insert: function insert(operation, item) { | ||
var wrapper = { | ||
item: item | ||
}; | ||
if (operation % 1 === 0) { | ||
// it is an insert | ||
wrapper.op = 'insert'; | ||
buffer.splice(operation, 0, wrapper); | ||
} else { | ||
wrapper.op = operation; | ||
switch (operation) { | ||
case 'append': | ||
buffer.push(wrapper); | ||
break; | ||
case 'prepend': | ||
buffer.unshift(wrapper); | ||
break; | ||
} | ||
} | ||
}, | ||
// removes elements from buffer | ||
remove: function remove(arg1, arg2) { | ||
if (angular.isNumber(arg1)) { | ||
// removes items from arg1 (including) through arg2 (excluding) | ||
for (var i = arg1; i < arg2; i++) { | ||
elementRoutines.removeElement(buffer[i]); | ||
} | ||
return buffer.splice(arg1, arg2 - arg1); | ||
} | ||
// removes single item(wrapper) from the buffer | ||
buffer.splice(buffer.indexOf(arg1), 1); | ||
return elementRoutines.removeElementAnimated(arg1); | ||
}, | ||
effectiveHeight: function effectiveHeight(elements) { | ||
if (!elements.length) { | ||
return 0; | ||
} | ||
var top = Number.MAX_VALUE; | ||
var bottom = Number.MIN_VALUE; | ||
elements.forEach(function (wrapper) { | ||
if (wrapper.element[0].offsetParent) { | ||
// element style is not display:none | ||
top = Math.min(top, wrapper.element.offset().top); | ||
bottom = Math.max(bottom, wrapper.element.offset().top + wrapper.element.outerHeight(true)); | ||
} | ||
}); | ||
return Math.max(0, bottom - top); | ||
} | ||
}); | ||
return buffer; | ||
} | ||
"use strict"; | ||
/***/ }, | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
/*! | ||
globals: angular, window | ||
List of used element methods available in JQuery but not in JQuery Lite | ||
element.before(elem) | ||
element.height() | ||
element.outerHeight(true) | ||
element.height(value) = only for Top/Bottom padding elements | ||
element.scrollTop() | ||
element.scrollTop(value) | ||
*/ | ||
var JQLiteExtras = function () { | ||
function JQLiteExtras() { | ||
_classCallCheck(this, JQLiteExtras); | ||
} | ||
_createClass(JQLiteExtras, [{ | ||
key: 'registerFor', | ||
value: function registerFor(element) { | ||
var convertToPx = void 0, | ||
css = void 0, | ||
getStyle = void 0, | ||
isWindow = void 0; | ||
// angular implementation blows up if elem is the window | ||
css = angular.element.prototype.css; | ||
element.prototype.css = function (name, value) { | ||
var self = this; | ||
var elem = self[0]; | ||
if (!(!elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style)) { | ||
return css.call(self, name, value); | ||
} | ||
}; | ||
// as defined in angularjs v1.0.5 | ||
isWindow = function isWindow(obj) { | ||
return obj && obj.document && obj.location && obj.alert && obj.setInterval; | ||
}; | ||
function scrollTo(self, direction, value) { | ||
var elem = self[0]; | ||
var _top$left$direction = _slicedToArray({ | ||
top: ['scrollTop', 'pageYOffset', 'scrollLeft'], | ||
left: ['scrollLeft', 'pageXOffset', 'scrollTop'] | ||
}[direction], 3), | ||
method = _top$left$direction[0], | ||
prop = _top$left$direction[1], | ||
preserve = _top$left$direction[2]; | ||
if (isWindow(elem)) { | ||
if (angular.isDefined(value)) { | ||
return elem.scrollTo(self[preserve].call(self), value); | ||
} | ||
return prop in elem ? elem[prop] : elem.document.documentElement[method]; | ||
} else { | ||
if (angular.isDefined(value)) { | ||
elem[method] = value; | ||
} | ||
return elem[method]; | ||
} | ||
} | ||
if (window.getComputedStyle) { | ||
getStyle = function getStyle(elem) { | ||
return window.getComputedStyle(elem, null); | ||
}; | ||
convertToPx = function convertToPx(elem, value) { | ||
return parseFloat(value); | ||
}; | ||
} else { | ||
getStyle = function getStyle(elem) { | ||
return elem.currentStyle; | ||
}; | ||
convertToPx = function convertToPx(elem, value) { | ||
var left = void 0, | ||
result = void 0, | ||
rs = void 0, | ||
rsLeft = void 0, | ||
style = void 0; | ||
var core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source; | ||
var rnumnonpx = new RegExp('^(' + core_pnum + ')(?!px)[a-z%]+$', 'i'); | ||
if (!rnumnonpx.test(value)) { | ||
return parseFloat(value); | ||
} | ||
// ported from JQuery | ||
style = elem.style; | ||
left = style.left; | ||
rs = elem.runtimeStyle; | ||
rsLeft = rs && rs.left; | ||
if (rs) { | ||
rs.left = style.left; | ||
} | ||
// put in the new values to get a computed style out | ||
style.left = value; | ||
result = style.pixelLeft; | ||
style.left = left; | ||
if (rsLeft) { | ||
rs.left = rsLeft; | ||
} | ||
return result; | ||
}; | ||
} | ||
function getMeasurements(elem, measure) { | ||
var base = void 0, | ||
borderA = void 0, | ||
borderB = void 0, | ||
computedMarginA = void 0, | ||
computedMarginB = void 0, | ||
computedStyle = void 0, | ||
dirA = void 0, | ||
dirB = void 0, | ||
marginA = void 0, | ||
marginB = void 0, | ||
paddingA = void 0, | ||
paddingB = void 0; | ||
if (isWindow(elem)) { | ||
base = document.documentElement[{ height: 'clientHeight', width: 'clientWidth' }[measure]]; | ||
return { | ||
base: base, | ||
padding: 0, | ||
border: 0, | ||
margin: 0 | ||
}; | ||
} | ||
// Start with offset property | ||
var _width$height$measure = _slicedToArray({ | ||
width: [elem.offsetWidth, 'Left', 'Right'], | ||
height: [elem.offsetHeight, 'Top', 'Bottom'] | ||
}[measure], 3); | ||
base = _width$height$measure[0]; | ||
dirA = _width$height$measure[1]; | ||
dirB = _width$height$measure[2]; | ||
computedStyle = getStyle(elem); | ||
paddingA = convertToPx(elem, computedStyle['padding' + dirA]) || 0; | ||
paddingB = convertToPx(elem, computedStyle['padding' + dirB]) || 0; | ||
borderA = convertToPx(elem, computedStyle['border' + dirA + 'Width']) || 0; | ||
borderB = convertToPx(elem, computedStyle['border' + dirB + 'Width']) || 0; | ||
computedMarginA = computedStyle['margin' + dirA]; | ||
computedMarginB = computedStyle['margin' + dirB]; | ||
// I do not care for width for now, so this hack is irrelevant | ||
// if ( !supportsPercentMargin ) | ||
// computedMarginA = hackPercentMargin( elem, computedStyle, computedMarginA ) | ||
// computedMarginB = hackPercentMargin( elem, computedStyle, computedMarginB ) | ||
marginA = convertToPx(elem, computedMarginA) || 0; | ||
marginB = convertToPx(elem, computedMarginB) || 0; | ||
return { | ||
base: base, | ||
padding: paddingA + paddingB, | ||
border: borderA + borderB, | ||
margin: marginA + marginB | ||
}; | ||
} | ||
function getWidthHeight(elem, direction, measure) { | ||
var computedStyle = void 0, | ||
result = void 0; | ||
var measurements = getMeasurements(elem, direction); | ||
if (measurements.base > 0) { | ||
return { | ||
base: measurements.base - measurements.padding - measurements.border, | ||
outer: measurements.base, | ||
outerfull: measurements.base + measurements.margin | ||
}[measure]; | ||
} | ||
// Fall back to computed then uncomputed css if necessary | ||
computedStyle = getStyle(elem); | ||
result = computedStyle[direction]; | ||
if (result < 0 || result === null) { | ||
result = elem.style[direction] || 0; | ||
} | ||
// Normalize "", auto, and prepare for extra | ||
result = parseFloat(result) || 0; | ||
return { | ||
base: result - measurements.padding - measurements.border, | ||
outer: result, | ||
outerfull: result + measurements.padding + measurements.border + measurements.margin | ||
}[measure]; | ||
} | ||
// define missing methods | ||
return angular.forEach({ | ||
before: function before(newElem) { | ||
var children, elem, i, j, parent, ref, self; | ||
self = this; | ||
elem = self[0]; | ||
parent = self.parent(); | ||
children = parent.contents(); | ||
if (children[0] === elem) { | ||
return parent.prepend(newElem); | ||
} else { | ||
for (i = j = 1, ref = children.length - 1; 1 <= ref ? j <= ref : j >= ref; i = 1 <= ref ? ++j : --j) { | ||
if (children[i] === elem) { | ||
angular.element(children[i - 1]).after(newElem); | ||
return; | ||
} | ||
} | ||
throw new Error('invalid DOM structure ' + elem.outerHTML); | ||
} | ||
}, | ||
height: function height(value) { | ||
var self; | ||
self = this; | ||
if (angular.isDefined(value)) { | ||
if (angular.isNumber(value)) { | ||
value = value + 'px'; | ||
} | ||
return css.call(self, 'height', value); | ||
} else { | ||
return getWidthHeight(this[0], 'height', 'base'); | ||
} | ||
}, | ||
outerHeight: function outerHeight(option) { | ||
return getWidthHeight(this[0], 'height', option ? 'outerfull' : 'outer'); | ||
}, | ||
outerWidth: function outerWidth(option) { | ||
return getWidthHeight(this[0], 'width', option ? 'outerfull' : 'outer'); | ||
}, | ||
/* | ||
The offset setter method is not implemented | ||
*/ | ||
offset: function offset(value) { | ||
var docElem = void 0, | ||
win = void 0; | ||
var self = this; | ||
var box = { | ||
top: 0, | ||
left: 0 | ||
}; | ||
var elem = self[0]; | ||
var doc = elem && elem.ownerDocument; | ||
if (arguments.length) { | ||
if (value === undefined) { | ||
return self; | ||
} | ||
// TODO: implement setter | ||
throw new Error('offset setter method is not implemented'); | ||
} | ||
if (!doc) { | ||
return; | ||
} | ||
docElem = doc.documentElement; | ||
// TODO: Make sure it's not a disconnected DOM node | ||
if (elem.getBoundingClientRect != null) { | ||
box = elem.getBoundingClientRect(); | ||
} | ||
win = doc.defaultView || doc.parentWindow; | ||
return { | ||
top: box.top + (win.pageYOffset || docElem.scrollTop) - (docElem.clientTop || 0), | ||
left: box.left + (win.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || 0) | ||
}; | ||
}, | ||
scrollTop: function scrollTop(value) { | ||
return scrollTo(this, 'top', value); | ||
}, | ||
scrollLeft: function scrollLeft(value) { | ||
return scrollTo(this, 'left', value); | ||
} | ||
}, function (value, key) { | ||
if (!element.prototype[key]) { | ||
return element.prototype[key] = value; | ||
} | ||
}); | ||
} | ||
}]); | ||
return JQLiteExtras; | ||
}(); | ||
exports.default = JQLiteExtras; | ||
/***/ }), | ||
/* 4 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
/***/ (function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = Viewport; | ||
var _padding = __webpack_require__(5); | ||
var _padding2 = _interopRequireDefault(_padding); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function Viewport(elementRoutines, buffer, element, viewportController, $rootScope, padding) { | ||
var topPadding = null; | ||
var bottomPadding = null; | ||
var viewport = viewportController && viewportController.viewport ? viewportController.viewport : angular.element(window); | ||
var container = viewportController && viewportController.container ? viewportController.container : undefined; | ||
var scope = viewportController && viewportController.scope ? viewportController.scope : $rootScope; | ||
viewport.css({ | ||
'overflow-anchor': 'none', | ||
'overflow-y': 'auto', | ||
'display': 'block' | ||
}); | ||
function bufferPadding() { | ||
return viewport.outerHeight() * padding; // some extra space to initiate preload | ||
} | ||
angular.extend(viewport, { | ||
getScope: function getScope() { | ||
return scope; | ||
}, | ||
createPaddingElements: function createPaddingElements(template) { | ||
topPadding = new _padding2.default(template); | ||
bottomPadding = new _padding2.default(template); | ||
element.before(topPadding); | ||
element.after(bottomPadding); | ||
}, | ||
applyContainerStyle: function applyContainerStyle() { | ||
if (container && container !== viewport) { | ||
viewport.css('height', window.getComputedStyle(container[0]).height); | ||
} | ||
}, | ||
bottomDataPos: function bottomDataPos() { | ||
var scrollHeight = viewport[0].scrollHeight; | ||
scrollHeight = scrollHeight != null ? scrollHeight : viewport[0].document.documentElement.scrollHeight; | ||
return scrollHeight - bottomPadding.height(); | ||
}, | ||
topDataPos: function topDataPos() { | ||
return topPadding.height(); | ||
}, | ||
bottomVisiblePos: function bottomVisiblePos() { | ||
return viewport.scrollTop() + viewport.outerHeight(); | ||
}, | ||
topVisiblePos: function topVisiblePos() { | ||
return viewport.scrollTop(); | ||
}, | ||
insertElement: function insertElement(e, sibling) { | ||
return elementRoutines.insertElement(e, sibling || topPadding); | ||
}, | ||
insertElementAnimated: function insertElementAnimated(e, sibling) { | ||
return elementRoutines.insertElementAnimated(e, sibling || topPadding); | ||
}, | ||
shouldLoadBottom: function shouldLoadBottom() { | ||
return !buffer.eof && viewport.bottomDataPos() < viewport.bottomVisiblePos() + bufferPadding(); | ||
}, | ||
clipBottom: function clipBottom() { | ||
// clip the invisible items off the bottom | ||
var overage = 0; | ||
var overageHeight = 0; | ||
var itemHeight = 0; | ||
var emptySpaceHeight = viewport.bottomDataPos() - viewport.bottomVisiblePos() - bufferPadding(); | ||
for (var i = buffer.length - 1; i >= 0; i--) { | ||
itemHeight = buffer[i].element.outerHeight(true); | ||
if (overageHeight + itemHeight > emptySpaceHeight) { | ||
break; | ||
} | ||
bottomPadding.cache.add(buffer[i]); | ||
overageHeight += itemHeight; | ||
overage++; | ||
} | ||
if (overage > 0) { | ||
buffer.eof = false; | ||
buffer.remove(buffer.length - overage, buffer.length); | ||
buffer.next -= overage; | ||
viewport.adjustPadding(); | ||
} | ||
}, | ||
shouldLoadTop: function shouldLoadTop() { | ||
return !buffer.bof && viewport.topDataPos() > viewport.topVisiblePos() - bufferPadding(); | ||
}, | ||
clipTop: function clipTop() { | ||
// clip the invisible items off the top | ||
var overage = 0; | ||
var overageHeight = 0; | ||
var itemHeight = 0; | ||
var emptySpaceHeight = viewport.topVisiblePos() - viewport.topDataPos() - bufferPadding(); | ||
for (var i = 0; i < buffer.length; i++) { | ||
itemHeight = buffer[i].element.outerHeight(true); | ||
if (overageHeight + itemHeight > emptySpaceHeight) { | ||
break; | ||
} | ||
topPadding.cache.add(buffer[i]); | ||
overageHeight += itemHeight; | ||
overage++; | ||
} | ||
if (overage > 0) { | ||
// we need to adjust top padding element before items are removed from top | ||
// to avoid strange behaviour of scroll bar during remove top items when we are at the very bottom | ||
topPadding.height(topPadding.height() + overageHeight); | ||
buffer.bof = false; | ||
buffer.remove(0, overage); | ||
buffer.first += overage; | ||
} | ||
}, | ||
adjustPadding: function adjustPadding() { | ||
if (!buffer.length) { | ||
return; | ||
} | ||
// precise heights calculation, items that were in buffer once | ||
var topPaddingHeight = topPadding.cache.reduce(function (summ, item) { | ||
return summ + (item.index < buffer.first ? item.height : 0); | ||
}, 0); | ||
var bottomPaddingHeight = bottomPadding.cache.reduce(function (summ, item) { | ||
return summ + (item.index >= buffer.next ? item.height : 0); | ||
}, 0); | ||
// average item height based on buffer data | ||
var visibleItemsHeight = buffer.reduce(function (summ, item) { | ||
return summ + item.element.outerHeight(true); | ||
}, 0); | ||
var averageItemHeight = (visibleItemsHeight + topPaddingHeight + bottomPaddingHeight) / (buffer.maxIndex - buffer.minIndex + 1); | ||
// average heights calculation, items that have never been reached | ||
var adjustTopPadding = buffer.minIndexUser !== null && buffer.minIndex > buffer.minIndexUser; | ||
var adjustBottomPadding = buffer.maxIndexUser !== null && buffer.maxIndex < buffer.maxIndexUser; | ||
var topPaddingHeightAdd = adjustTopPadding ? (buffer.minIndex - buffer.minIndexUser) * averageItemHeight : 0; | ||
var bottomPaddingHeightAdd = adjustBottomPadding ? (buffer.maxIndexUser - buffer.maxIndex) * averageItemHeight : 0; | ||
// paddings combine adjustment | ||
topPadding.height(topPaddingHeight + topPaddingHeightAdd); | ||
bottomPadding.height(bottomPaddingHeight + bottomPaddingHeightAdd); | ||
}, | ||
adjustScrollTopAfterMinIndexSet: function adjustScrollTopAfterMinIndexSet(topPaddingHeightOld) { | ||
// additional scrollTop adjustment in case of datasource.minIndex external set | ||
if (buffer.minIndexUser !== null && buffer.minIndex > buffer.minIndexUser) { | ||
var diff = topPadding.height() - topPaddingHeightOld; | ||
viewport.scrollTop(viewport.scrollTop() + diff); | ||
} | ||
}, | ||
adjustScrollTopAfterPrepend: function adjustScrollTopAfterPrepend(updates) { | ||
if (!updates.prepended.length) return; | ||
var height = buffer.effectiveHeight(updates.prepended); | ||
var paddingHeight = topPadding.height() - height; | ||
if (paddingHeight >= 0) { | ||
topPadding.height(paddingHeight); | ||
} else { | ||
topPadding.height(0); | ||
viewport.scrollTop(viewport.scrollTop() - paddingHeight); | ||
} | ||
}, | ||
resetTopPadding: function resetTopPadding() { | ||
topPadding.height(0); | ||
topPadding.cache.clear(); | ||
}, | ||
resetBottomPadding: function resetBottomPadding() { | ||
bottomPadding.height(0); | ||
bottomPadding.cache.clear(); | ||
} | ||
}); | ||
return viewport; | ||
} | ||
"use strict"; | ||
/***/ }, | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = Viewport; | ||
var _padding = __webpack_require__(5); | ||
var _padding2 = _interopRequireDefault(_padding); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function Viewport(elementRoutines, buffer, element, viewportController, $rootScope, padding) { | ||
var topPadding = null; | ||
var bottomPadding = null; | ||
var viewport = viewportController && viewportController.viewport ? viewportController.viewport : angular.element(window); | ||
var container = viewportController && viewportController.container ? viewportController.container : undefined; | ||
var scope = viewportController && viewportController.scope ? viewportController.scope : $rootScope; | ||
viewport.css({ | ||
'overflow-anchor': 'none', | ||
'overflow-y': 'auto', | ||
'display': 'block' | ||
}); | ||
function bufferPadding() { | ||
return viewport.outerHeight() * padding; // some extra space to initiate preload | ||
} | ||
angular.extend(viewport, { | ||
getScope: function getScope() { | ||
return scope; | ||
}, | ||
createPaddingElements: function createPaddingElements(template) { | ||
topPadding = new _padding2.default(template); | ||
bottomPadding = new _padding2.default(template); | ||
element.before(topPadding); | ||
element.after(bottomPadding); | ||
}, | ||
applyContainerStyle: function applyContainerStyle() { | ||
if (container && container !== viewport) { | ||
viewport.css('height', window.getComputedStyle(container[0]).height); | ||
} | ||
}, | ||
bottomDataPos: function bottomDataPos() { | ||
var scrollHeight = viewport[0].scrollHeight; | ||
scrollHeight = scrollHeight != null ? scrollHeight : viewport[0].document.documentElement.scrollHeight; | ||
return scrollHeight - bottomPadding.height(); | ||
}, | ||
topDataPos: function topDataPos() { | ||
return topPadding.height(); | ||
}, | ||
bottomVisiblePos: function bottomVisiblePos() { | ||
return viewport.scrollTop() + viewport.outerHeight(); | ||
}, | ||
topVisiblePos: function topVisiblePos() { | ||
return viewport.scrollTop(); | ||
}, | ||
insertElement: function insertElement(e, sibling) { | ||
return elementRoutines.insertElement(e, sibling || topPadding); | ||
}, | ||
insertElementAnimated: function insertElementAnimated(e, sibling) { | ||
return elementRoutines.insertElementAnimated(e, sibling || topPadding); | ||
}, | ||
shouldLoadBottom: function shouldLoadBottom() { | ||
return !buffer.eof && viewport.bottomDataPos() < viewport.bottomVisiblePos() + bufferPadding(); | ||
}, | ||
clipBottom: function clipBottom() { | ||
// clip the invisible items off the bottom | ||
var overage = 0; | ||
var overageHeight = 0; | ||
var itemHeight = 0; | ||
var emptySpaceHeight = viewport.bottomDataPos() - viewport.bottomVisiblePos() - bufferPadding(); | ||
for (var i = buffer.length - 1; i >= 0; i--) { | ||
itemHeight = buffer[i].element.outerHeight(true); | ||
if (overageHeight + itemHeight > emptySpaceHeight) { | ||
break; | ||
} | ||
bottomPadding.cache.add(buffer[i]); | ||
overageHeight += itemHeight; | ||
overage++; | ||
} | ||
if (overage > 0) { | ||
buffer.eof = false; | ||
buffer.remove(buffer.length - overage, buffer.length); | ||
buffer.next -= overage; | ||
viewport.adjustPadding(); | ||
} | ||
}, | ||
shouldLoadTop: function shouldLoadTop() { | ||
return !buffer.bof && viewport.topDataPos() > viewport.topVisiblePos() - bufferPadding(); | ||
}, | ||
clipTop: function clipTop() { | ||
// clip the invisible items off the top | ||
var overage = 0; | ||
var overageHeight = 0; | ||
var itemHeight = 0; | ||
var emptySpaceHeight = viewport.topVisiblePos() - viewport.topDataPos() - bufferPadding(); | ||
for (var i = 0; i < buffer.length; i++) { | ||
itemHeight = buffer[i].element.outerHeight(true); | ||
if (overageHeight + itemHeight > emptySpaceHeight) { | ||
break; | ||
} | ||
topPadding.cache.add(buffer[i]); | ||
overageHeight += itemHeight; | ||
overage++; | ||
} | ||
if (overage > 0) { | ||
// we need to adjust top padding element before items are removed from top | ||
// to avoid strange behaviour of scroll bar during remove top items when we are at the very bottom | ||
topPadding.height(topPadding.height() + overageHeight); | ||
buffer.bof = false; | ||
buffer.remove(0, overage); | ||
buffer.first += overage; | ||
} | ||
}, | ||
adjustPadding: function adjustPadding() { | ||
if (!buffer.length) { | ||
return; | ||
} | ||
// precise heights calculation, items that were in buffer once | ||
var topPaddingHeight = topPadding.cache.reduce(function (summ, item) { | ||
return summ + (item.index < buffer.first ? item.height : 0); | ||
}, 0); | ||
var bottomPaddingHeight = bottomPadding.cache.reduce(function (summ, item) { | ||
return summ + (item.index >= buffer.next ? item.height : 0); | ||
}, 0); | ||
// average item height based on buffer data | ||
var visibleItemsHeight = buffer.reduce(function (summ, item) { | ||
return summ + item.element.outerHeight(true); | ||
}, 0); | ||
var averageItemHeight = (visibleItemsHeight + topPaddingHeight + bottomPaddingHeight) / (buffer.maxIndex - buffer.minIndex + 1); | ||
// average heights calculation, items that have never been reached | ||
var adjustTopPadding = buffer.minIndexUser !== null && buffer.minIndex > buffer.minIndexUser; | ||
var adjustBottomPadding = buffer.maxIndexUser !== null && buffer.maxIndex < buffer.maxIndexUser; | ||
var topPaddingHeightAdd = adjustTopPadding ? (buffer.minIndex - buffer.minIndexUser) * averageItemHeight : 0; | ||
var bottomPaddingHeightAdd = adjustBottomPadding ? (buffer.maxIndexUser - buffer.maxIndex) * averageItemHeight : 0; | ||
// paddings combine adjustment | ||
topPadding.height(topPaddingHeight + topPaddingHeightAdd); | ||
bottomPadding.height(bottomPaddingHeight + bottomPaddingHeightAdd); | ||
}, | ||
adjustScrollTopAfterMinIndexSet: function adjustScrollTopAfterMinIndexSet(topPaddingHeightOld) { | ||
// additional scrollTop adjustment in case of datasource.minIndex external set | ||
if (buffer.minIndexUser !== null && buffer.minIndex > buffer.minIndexUser) { | ||
var diff = topPadding.height() - topPaddingHeightOld; | ||
viewport.scrollTop(viewport.scrollTop() + diff); | ||
} | ||
}, | ||
adjustScrollTopAfterPrepend: function adjustScrollTopAfterPrepend(updates) { | ||
if (!updates.prepended.length) return; | ||
var height = buffer.effectiveHeight(updates.prepended); | ||
var paddingHeight = topPadding.height() - height; | ||
if (paddingHeight >= 0) { | ||
topPadding.height(paddingHeight); | ||
} else { | ||
topPadding.height(0); | ||
viewport.scrollTop(viewport.scrollTop() - paddingHeight); | ||
} | ||
}, | ||
resetTopPadding: function resetTopPadding() { | ||
topPadding.height(0); | ||
topPadding.cache.clear(); | ||
}, | ||
resetBottomPadding: function resetBottomPadding() { | ||
bottomPadding.height(0); | ||
bottomPadding.cache.clear(); | ||
}, | ||
removeItem: function removeItem(item) { | ||
topPadding.cache.remove(item); | ||
bottomPadding.cache.remove(item); | ||
return buffer.remove(item); | ||
} | ||
}); | ||
return viewport; | ||
} | ||
/***/ }), | ||
/* 5 */ | ||
/***/ function(module, exports) { | ||
/***/ (function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = Padding; | ||
function Cache() { | ||
var cache = Object.create(Array.prototype); | ||
angular.extend(cache, { | ||
add: function add(item) { | ||
for (var i = cache.length - 1; i >= 0; i--) { | ||
if (cache[i].index === item.scope.$index) { | ||
cache[i].height = item.element.outerHeight(); | ||
return; | ||
} | ||
} | ||
cache.push({ | ||
index: item.scope.$index, | ||
height: item.element.outerHeight() | ||
}); | ||
}, | ||
clear: function clear() { | ||
cache.length = 0; | ||
} | ||
}); | ||
return cache; | ||
} | ||
function Padding(template) { | ||
var result = void 0; | ||
switch (template.tagName) { | ||
case 'dl': | ||
throw new Error('ui-scroll directive does not support <' + template.tagName + '> as a repeating tag: ' + template.outerHTML); | ||
case 'tr': | ||
var table = angular.element('<table><tr><td><div></div></td></tr></table>'); | ||
result = table.find('tr'); | ||
break; | ||
case 'li': | ||
result = angular.element('<li></li>'); | ||
break; | ||
default: | ||
result = angular.element('<div></div>'); | ||
} | ||
result.cache = new Cache(); | ||
return result; | ||
} | ||
"use strict"; | ||
/***/ }, | ||
/* 6 */ | ||
/***/ function(module, exports) { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function getCtrlOnData(attr, element) { | ||
var onSyntax = attr.match(/^(.+)(\s+on\s+)(.+)?/); | ||
if (onSyntax && onSyntax.length === 4) { | ||
window.console.log('Angular ui-scroll adapter assignment warning. "Controller On" syntax has been deprecated since ui-scroll v1.6.1.'); | ||
var ctrl = onSyntax[3]; | ||
var tail = onSyntax[1]; | ||
var candidate = element; | ||
while (candidate.length) { | ||
var candidateScope = candidate.scope(); // doesn't work when debugInfoEnabled flag = true | ||
var candidateName = (candidate.attr('ng-controller') || '').match(/(\w(?:\w|\d)*)(?:\s+as\s+(\w(?:\w|\d)*))?/); | ||
if (candidateName && candidateName[1] === ctrl) { | ||
return { | ||
target: candidateScope, | ||
source: tail | ||
}; | ||
} | ||
candidate = candidate.parent(); | ||
} | ||
throw new Error('Angular ui-scroll adapter assignment error. Failed to locate target controller "' + ctrl + '" to inject "' + tail + '"'); | ||
} | ||
} | ||
var Adapter = function () { | ||
function Adapter(viewport, buffer, adjustBuffer, reload, $attr, $parse, element, $scope) { | ||
_classCallCheck(this, Adapter); | ||
this.viewport = viewport; | ||
this.buffer = buffer; | ||
this.adjustBuffer = adjustBuffer; | ||
this.reload = reload; | ||
this.isLoading = false; | ||
this.disabled = false; | ||
var viewportScope = viewport.getScope(); | ||
this.startScope = viewportScope.$parent ? viewportScope : $scope; | ||
this.publicContext = {}; | ||
this.assignAdapter($attr.adapter, $parse, element); | ||
this.generatePublicContext($attr, $parse); | ||
} | ||
_createClass(Adapter, [{ | ||
key: 'assignAdapter', | ||
value: function assignAdapter(adapterAttr, $parse, element) { | ||
if (!adapterAttr || !(adapterAttr = adapterAttr.replace(/^\s+|\s+$/gm, ''))) { | ||
return; | ||
} | ||
var ctrlOnData = getCtrlOnData(adapterAttr, element); | ||
var adapterOnScope = void 0; | ||
try { | ||
if (ctrlOnData) { | ||
// "Controller On", deprecated since v1.6.1 | ||
$parse(ctrlOnData.source).assign(ctrlOnData.target, {}); | ||
adapterOnScope = $parse(ctrlOnData.source)(ctrlOnData.target); | ||
} else { | ||
$parse(adapterAttr).assign(this.startScope, {}); | ||
adapterOnScope = $parse(adapterAttr)(this.startScope); | ||
} | ||
} catch (error) { | ||
error.message = 'Angular ui-scroll Adapter assignment exception.\n' + ('Can\'t parse "' + adapterAttr + '" expression.\n') + error.message; | ||
throw error; | ||
} | ||
angular.extend(adapterOnScope, this.publicContext); | ||
this.publicContext = adapterOnScope; | ||
} | ||
}, { | ||
key: 'generatePublicContext', | ||
value: function generatePublicContext($attr, $parse) { | ||
var _this = this; | ||
// these methods will be accessible out of ui-scroll via user defined adapter | ||
var publicMethods = ['reload', 'applyUpdates', 'append', 'prepend', 'isBOF', 'isEOF', 'isEmpty']; | ||
for (var i = publicMethods.length - 1; i >= 0; i--) { | ||
this.publicContext[publicMethods[i]] = this[publicMethods[i]].bind(this); | ||
} | ||
// these read-only props will be accessible out of ui-scroll via user defined adapter | ||
var publicProps = ['isLoading', 'topVisible', 'topVisibleElement', 'topVisibleScope']; | ||
var _loop = function _loop(_i) { | ||
var property = void 0, | ||
attr = $attr[publicProps[_i]]; | ||
Object.defineProperty(_this, publicProps[_i], { | ||
get: function get() { | ||
return property; | ||
}, | ||
set: function set(value) { | ||
property = value; | ||
_this.publicContext[publicProps[_i]] = value; | ||
if (attr) { | ||
$parse(attr).assign(_this.startScope, value); | ||
} | ||
} | ||
}); | ||
}; | ||
for (var _i = publicProps.length - 1; _i >= 0; _i--) { | ||
_loop(_i); | ||
} | ||
// non-read-only public property | ||
Object.defineProperty(this.publicContext, 'disabled', { | ||
get: function get() { | ||
return _this.disabled; | ||
}, | ||
set: function set(value) { | ||
return !(_this.disabled = value) ? _this.adjustBuffer() : null; | ||
} | ||
}); | ||
} | ||
}, { | ||
key: 'loading', | ||
value: function loading(value) { | ||
this['isLoading'] = value; | ||
} | ||
}, { | ||
key: 'isBOF', | ||
value: function isBOF() { | ||
return this.buffer.bof; | ||
} | ||
}, { | ||
key: 'isEOF', | ||
value: function isEOF() { | ||
return this.buffer.eof; | ||
} | ||
}, { | ||
key: 'isEmpty', | ||
value: function isEmpty() { | ||
return !this.buffer.length; | ||
} | ||
}, { | ||
key: 'applyUpdates', | ||
value: function applyUpdates(arg1, arg2) { | ||
var _this2 = this; | ||
if (angular.isFunction(arg1)) { | ||
// arg1 is the updater function, arg2 is ignored | ||
this.buffer.slice(0).forEach(function (wrapper) { | ||
// we need to do it on the buffer clone, because buffer content | ||
// may change as we iterate through | ||
_this2.applyUpdate(wrapper, arg1(wrapper.item, wrapper.scope, wrapper.element)); | ||
}); | ||
} else { | ||
// arg1 is item index, arg2 is the newItems array | ||
if (arg1 % 1 !== 0) { | ||
// checking if it is an integer | ||
throw new Error('applyUpdates - ' + arg1 + ' is not a valid index'); | ||
} | ||
var index = arg1 - this.buffer.first; | ||
if (index >= 0 && index < this.buffer.length) { | ||
this.applyUpdate(this.buffer[index], arg2); | ||
} | ||
} | ||
this.adjustBuffer(); | ||
} | ||
}, { | ||
key: 'append', | ||
value: function append(newItems) { | ||
this.buffer.append(newItems); | ||
this.adjustBuffer(); | ||
} | ||
}, { | ||
key: 'prepend', | ||
value: function prepend(newItems) { | ||
this.buffer.prepend(newItems); | ||
this.adjustBuffer(); | ||
} | ||
}, { | ||
key: 'calculateProperties', | ||
value: function calculateProperties() { | ||
var item = void 0, | ||
itemHeight = void 0, | ||
itemTop = void 0, | ||
isNewRow = void 0, | ||
rowTop = null; | ||
var topHeight = 0; | ||
for (var i = 0; i < this.buffer.length; i++) { | ||
item = this.buffer[i]; | ||
itemTop = item.element.offset().top; | ||
isNewRow = rowTop !== itemTop; | ||
rowTop = itemTop; | ||
if (isNewRow) { | ||
itemHeight = item.element.outerHeight(true); | ||
} | ||
if (isNewRow && this.viewport.topDataPos() + topHeight + itemHeight <= this.viewport.topVisiblePos()) { | ||
topHeight += itemHeight; | ||
} else { | ||
if (isNewRow) { | ||
this['topVisible'] = item.item; | ||
this['topVisibleElement'] = item.element; | ||
this['topVisibleScope'] = item.scope; | ||
} | ||
break; | ||
} | ||
} | ||
} | ||
}, { | ||
key: 'applyUpdate', | ||
value: function applyUpdate(wrapper, newItems) { | ||
var _this3 = this; | ||
if (!angular.isArray(newItems)) { | ||
return; | ||
} | ||
var keepIt = void 0; | ||
var pos = this.buffer.indexOf(wrapper) + 1; | ||
newItems.reverse().forEach(function (newItem) { | ||
if (newItem === wrapper.item) { | ||
keepIt = true; | ||
pos--; | ||
} else { | ||
_this3.buffer.insert(pos, newItem); | ||
} | ||
}); | ||
if (!keepIt) { | ||
wrapper.op = 'remove'; | ||
} | ||
} | ||
}]); | ||
return Adapter; | ||
}(); | ||
exports.default = Adapter; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = Padding; | ||
function Cache() { | ||
var cache = Object.create(Array.prototype); | ||
/***/ } | ||
angular.extend(cache, { | ||
add: function add(item) { | ||
for (var i = cache.length - 1; i >= 0; i--) { | ||
if (cache[i].index === item.scope.$index) { | ||
cache[i].height = item.element.outerHeight(); | ||
return; | ||
} | ||
} | ||
cache.push({ | ||
index: item.scope.$index, | ||
height: item.element.outerHeight() | ||
}); | ||
cache.sort(function (a, b) { | ||
return a.index < b.index ? -1 : a.index > b.index ? 1 : 0; | ||
}); | ||
}, | ||
remove: function remove(item) { | ||
for (var i = cache.length - 1; i >= 0; i--) { | ||
if (cache[i].index === item.scope.$index) { | ||
cache.splice(i, 1); | ||
break; | ||
} | ||
} | ||
for (var _i = cache.length - 1; _i >= 0; _i--) { | ||
if (cache[_i].index > item.scope.$index) { | ||
cache[_i].index--; | ||
} | ||
} | ||
}, | ||
clear: function clear() { | ||
cache.length = 0; | ||
} | ||
}); | ||
return cache; | ||
} | ||
function Padding(template) { | ||
var result = void 0; | ||
switch (template.tagName.toLowerCase()) { | ||
case 'dl': | ||
throw new Error('ui-scroll directive does not support <' + template.tagName + '> as a repeating tag: ' + template.outerHTML); | ||
case 'tr': | ||
var table = angular.element('<table><tr><td><div></div></td></tr></table>'); | ||
result = table.find('tr'); | ||
break; | ||
case 'li': | ||
result = angular.element('<li></li>'); | ||
break; | ||
default: | ||
result = angular.element('<div></div>'); | ||
} | ||
result.cache = new Cache(); | ||
return result; | ||
} | ||
/***/ }), | ||
/* 6 */, | ||
/* 7 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var _jqLiteExtras = __webpack_require__(3); | ||
var _jqLiteExtras2 = _interopRequireDefault(_jqLiteExtras); | ||
var _elementRoutines = __webpack_require__(2); | ||
var _elementRoutines2 = _interopRequireDefault(_elementRoutines); | ||
var _buffer = __webpack_require__(1); | ||
var _buffer2 = _interopRequireDefault(_buffer); | ||
var _viewport = __webpack_require__(4); | ||
var _viewport2 = _interopRequireDefault(_viewport); | ||
var _adapter = __webpack_require__(0); | ||
var _adapter2 = _interopRequireDefault(_adapter); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
angular.module('ui.scroll', []).service('jqLiteExtras', function () { | ||
return new _jqLiteExtras2.default(); | ||
}).run(['jqLiteExtras', function (jqLiteExtras) { | ||
return !window.jQuery ? jqLiteExtras.registerFor(angular.element) : null; | ||
}]).directive('uiScrollViewport', function () { | ||
return { | ||
restrict: 'A', | ||
controller: ['$scope', '$element', function (scope, element) { | ||
var _this = this; | ||
this.container = element; | ||
this.viewport = element; | ||
this.scope = scope; | ||
angular.forEach(element.children(), function (child) { | ||
if (child.tagName.toLowerCase() === 'tbody') { | ||
_this.viewport = angular.element(child); | ||
} | ||
}); | ||
return this; | ||
}] | ||
}; | ||
}).directive('uiScroll', ['$log', '$injector', '$rootScope', '$timeout', '$q', '$parse', function (console, $injector, $rootScope, $timeout, $q, $parse) { | ||
return { | ||
require: ['?^uiScrollViewport'], | ||
restrict: 'A', | ||
transclude: 'element', | ||
priority: 1000, | ||
terminal: true, | ||
link: link | ||
}; | ||
function link($scope, element, $attr, controllers, linker) { | ||
var match = $attr.uiScroll.match(/^\s*(\w+)\s+in\s+([(\w|\$)\.]+)\s*$/); | ||
if (!match) { | ||
throw new Error('Expected uiScroll in form of \'_item_ in _datasource_\' but got \'' + $attr.uiScroll + '\''); | ||
} | ||
function parseNumericAttr(value, defaultValue) { | ||
var result = $parse(value)($scope); | ||
return isNaN(result) ? defaultValue : result; | ||
} | ||
var BUFFER_MIN = 3; | ||
var BUFFER_DEFAULT = 10; | ||
var PADDING_MIN = 0.3; | ||
var PADDING_DEFAULT = 0.5; | ||
var datasource = null; | ||
var itemName = match[1]; | ||
var datasourceName = match[2]; | ||
var viewportController = controllers[0]; | ||
var bufferSize = Math.max(BUFFER_MIN, parseNumericAttr($attr.bufferSize, BUFFER_DEFAULT)); | ||
var padding = Math.max(PADDING_MIN, parseNumericAttr($attr.padding, PADDING_DEFAULT)); | ||
var startIndex = parseNumericAttr($attr.startIndex, 1); | ||
var ridActual = 0; // current data revision id | ||
var pending = []; | ||
var elementRoutines = new _elementRoutines2.default($injector, $q); | ||
var buffer = new _buffer2.default(elementRoutines, bufferSize); | ||
var viewport = new _viewport2.default(elementRoutines, buffer, element, viewportController, $rootScope, padding); | ||
var adapter = new _adapter2.default(viewport, buffer, adjustBuffer, reload, $attr, $parse, element, $scope); | ||
if (viewportController) { | ||
viewportController.adapter = adapter; | ||
} | ||
var isDatasourceValid = function isDatasourceValid() { | ||
return angular.isObject(datasource) && angular.isFunction(datasource.get); | ||
}; | ||
datasource = $parse(datasourceName)($scope); // try to get datasource on scope | ||
if (!isDatasourceValid()) { | ||
datasource = $injector.get(datasourceName); // try to inject datasource as service | ||
if (!isDatasourceValid()) { | ||
throw new Error(datasourceName + ' is not a valid datasource'); | ||
} | ||
} | ||
var indexStore = {}; | ||
function defineProperty(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; | ||
$timeout(function () { | ||
buffer[propUserName] = value; | ||
if (!pending.length) { | ||
var topPaddingHeightOld = viewport.topDataPos(); | ||
viewport.adjustPadding(); | ||
if (propName === 'minIndex') { | ||
viewport.adjustScrollTopAfterMinIndexSet(topPaddingHeightOld); | ||
} | ||
} | ||
}); | ||
}, | ||
get: function get() { | ||
return indexStore[propName]; | ||
} | ||
}); | ||
} | ||
} | ||
defineProperty(datasource, 'minIndex', 'minIndexUser'); | ||
defineProperty(datasource, 'maxIndex', 'maxIndexUser'); | ||
var fetchNext = datasource.get.length !== 2 ? function (success) { | ||
return datasource.get(buffer.next, bufferSize, success); | ||
} : function (success) { | ||
datasource.get({ | ||
index: buffer.next, | ||
append: buffer.length ? buffer[buffer.length - 1].item : void 0, | ||
count: bufferSize | ||
}, success); | ||
}; | ||
var fetchPrevious = datasource.get.length !== 2 ? function (success) { | ||
return datasource.get(buffer.first - bufferSize, bufferSize, success); | ||
} : function (success) { | ||
datasource.get({ | ||
index: buffer.first - bufferSize, | ||
prepend: buffer.length ? buffer[0].item : void 0, | ||
count: bufferSize | ||
}, success); | ||
}; | ||
/** | ||
* Build padding elements | ||
* | ||
* Calling linker is the only way I found to get access to the tag name of the template | ||
* to prevent the directive scope from pollution a new scope is created and destroyed | ||
* right after the builder creation is completed | ||
*/ | ||
linker(function (clone, scope) { | ||
viewport.createPaddingElements(clone[0]); | ||
// we do not include the clone in the DOM. It means that the nested directives will not | ||
// be able to reach the parent directives, but in this case it is intentional because we | ||
// created the clone to access the template tag name | ||
scope.$destroy(); | ||
clone.remove(); | ||
}); | ||
$scope.$on('$destroy', function () { | ||
unbindEvents(); | ||
viewport.unbind('mousewheel', wheelHandler); | ||
}); | ||
viewport.bind('mousewheel', wheelHandler); | ||
$timeout(function () { | ||
viewport.applyContainerStyle(); | ||
reload(); | ||
}); | ||
/* Private function definitions */ | ||
function isInvalid(rid) { | ||
return rid && rid !== ridActual || $scope.$$destroyed; | ||
} | ||
function bindEvents() { | ||
viewport.bind('resize', resizeAndScrollHandler); | ||
viewport.bind('scroll', resizeAndScrollHandler); | ||
} | ||
function unbindEvents() { | ||
viewport.unbind('resize', resizeAndScrollHandler); | ||
viewport.unbind('scroll', resizeAndScrollHandler); | ||
} | ||
function reload() { | ||
viewport.resetTopPadding(); | ||
viewport.resetBottomPadding(); | ||
if (arguments.length) { | ||
startIndex = arguments[0]; | ||
} | ||
buffer.reset(startIndex); | ||
adjustBuffer(); | ||
} | ||
function isElementVisible(wrapper) { | ||
return wrapper.element.height() && wrapper.element[0].offsetParent; | ||
} | ||
function visibilityWatcher(wrapper) { | ||
if (isElementVisible(wrapper)) { | ||
buffer.forEach(function (item) { | ||
if (angular.isFunction(item.unregisterVisibilityWatcher)) { | ||
item.unregisterVisibilityWatcher(); | ||
delete item.unregisterVisibilityWatcher; | ||
} | ||
}); | ||
if (!pending.length) { | ||
$timeout(function () { | ||
return adjustBuffer(); | ||
}); | ||
} | ||
} | ||
} | ||
function insertWrapperContent(wrapper, insertAfter) { | ||
createElement(wrapper, insertAfter, viewport.insertElement); | ||
if (!isElementVisible(wrapper)) { | ||
wrapper.unregisterVisibilityWatcher = wrapper.scope.$watch(function () { | ||
return visibilityWatcher(wrapper); | ||
}); | ||
} | ||
wrapper.element.addClass('ng-hide'); // hide inserted elements before data binding | ||
} | ||
function createElement(wrapper, insertAfter, insertElement) { | ||
var promises = null; | ||
var sibling = insertAfter > 0 ? buffer[insertAfter - 1].element : undefined; | ||
linker(function (clone, scope) { | ||
promises = insertElement(clone, sibling); | ||
wrapper.element = clone; | ||
wrapper.scope = scope; | ||
scope[itemName] = wrapper.item; | ||
}); | ||
// ui-scroll-grid apply | ||
if (adapter.transform) { | ||
var tdInitializer = wrapper.scope.uiScrollTdInitializer; | ||
if (tdInitializer && tdInitializer.linking) { | ||
adapter.transform(wrapper.scope, wrapper.element); | ||
} else { | ||
wrapper.scope.uiScrollTdInitializer = { | ||
onLink: function onLink() { | ||
return adapter.transform(wrapper.scope, wrapper.element); | ||
}, | ||
scope: wrapper.scope | ||
}; | ||
} | ||
} | ||
return promises; | ||
} | ||
function updateDOM() { | ||
var promises = []; | ||
var toBePrepended = []; | ||
var toBeRemoved = []; | ||
var inserted = []; | ||
buffer.forEach(function (wrapper, i) { | ||
switch (wrapper.op) { | ||
case 'prepend': | ||
toBePrepended.unshift(wrapper); | ||
break; | ||
case 'append': | ||
insertWrapperContent(wrapper, i); | ||
wrapper.op = 'none'; | ||
inserted.push(wrapper); | ||
break; | ||
case 'insert': | ||
promises = promises.concat(createElement(wrapper, i, viewport.insertElementAnimated)); | ||
wrapper.op = 'none'; | ||
inserted.push(wrapper); | ||
break; | ||
case 'remove': | ||
toBeRemoved.push(wrapper); | ||
} | ||
}); | ||
toBeRemoved.forEach(function (wrapper) { | ||
return promises = promises.concat(viewport.removeItem(wrapper)); | ||
}); | ||
if (toBePrepended.length) toBePrepended.forEach(function (wrapper) { | ||
insertWrapperContent(wrapper); | ||
wrapper.op = 'none'; | ||
}); | ||
buffer.forEach(function (item, i) { | ||
return item.scope.$index = buffer.first + i; | ||
}); | ||
return { | ||
prepended: toBePrepended, | ||
removed: toBeRemoved, | ||
inserted: inserted, | ||
animated: promises | ||
}; | ||
} | ||
function updatePaddings(rid, updates) { | ||
// schedule another adjustBuffer after animation completion | ||
if (updates.animated.length) { | ||
$q.all(updates.animated).then(function () { | ||
viewport.adjustPadding(); | ||
adjustBuffer(rid); | ||
}); | ||
} else { | ||
viewport.adjustPadding(); | ||
} | ||
} | ||
function enqueueFetch(rid, updates) { | ||
if (viewport.shouldLoadBottom()) { | ||
if (!updates || buffer.effectiveHeight(updates.inserted) > 0) { | ||
// this means that at least one item appended in the last batch has height > 0 | ||
if (pending.push(true) === 1) { | ||
fetch(rid); | ||
adapter.loading(true); | ||
} | ||
} | ||
} else if (viewport.shouldLoadTop()) { | ||
if (!updates || buffer.effectiveHeight(updates.prepended) > 0 || pending[0]) { | ||
// this means that at least one item appended in the last batch has height > 0 | ||
// pending[0] = true means that previous fetch was appending. We need to force at least one prepend | ||
// BTW there will always be at least 1 element in the pending array because bottom is fetched first | ||
if (pending.push(false) === 1) { | ||
fetch(rid); | ||
adapter.loading(true); | ||
} | ||
} | ||
} | ||
} | ||
function adjustBuffer(rid) { | ||
if (!rid) { | ||
// dismiss pending requests | ||
pending = []; | ||
rid = ++ridActual; | ||
} | ||
var updates = updateDOM(); | ||
// We need the item bindings to be processed before we can do adjustment | ||
$scope.$apply(function () { | ||
return $timeout(function () { | ||
// show elements after data binging has been done | ||
updates.inserted.forEach(function (w) { | ||
return w.element.removeClass('ng-hide'); | ||
}); | ||
updates.prepended.forEach(function (w) { | ||
return w.element.removeClass('ng-hide'); | ||
}); | ||
if (isInvalid(rid)) { | ||
return; | ||
} | ||
updatePaddings(rid, updates); | ||
enqueueFetch(rid); | ||
if (!pending.length) { | ||
adapter.calculateProperties(); | ||
} | ||
}); | ||
}); | ||
} | ||
function adjustBufferAfterFetch(rid) { | ||
var updates = updateDOM(); | ||
// We need the item bindings to be processed before we can do adjustment | ||
$scope.$apply(function () { | ||
return $timeout(function () { | ||
// show elements after data binging has been done | ||
updates.inserted.forEach(function (w) { | ||
return w.element.removeClass('ng-hide'); | ||
}); | ||
updates.prepended.forEach(function (w) { | ||
return w.element.removeClass('ng-hide'); | ||
}); | ||
viewport.adjustScrollTopAfterPrepend(updates); | ||
if (isInvalid(rid)) { | ||
return; | ||
} | ||
updatePaddings(rid, updates); | ||
enqueueFetch(rid, updates); | ||
pending.shift(); | ||
if (pending.length) fetch(rid);else { | ||
adapter.loading(false); | ||
bindEvents(); | ||
adapter.calculateProperties(); | ||
} | ||
}); | ||
}); | ||
} | ||
function fetch(rid) { | ||
if (pending[0]) { | ||
// scrolling down | ||
if (buffer.length && !viewport.shouldLoadBottom()) { | ||
adjustBufferAfterFetch(rid); | ||
} else { | ||
fetchNext(function (result) { | ||
if (isInvalid(rid)) { | ||
return; | ||
} | ||
if (result.length < bufferSize) { | ||
buffer.eof = true; | ||
} | ||
if (result.length > 0) { | ||
viewport.clipTop(); | ||
buffer.append(result); | ||
} | ||
adjustBufferAfterFetch(rid); | ||
}); | ||
} | ||
} else { | ||
// scrolling up | ||
if (buffer.length && !viewport.shouldLoadTop()) { | ||
adjustBufferAfterFetch(rid); | ||
} else { | ||
fetchPrevious(function (result) { | ||
if (isInvalid(rid)) { | ||
return; | ||
} | ||
if (result.length < bufferSize) { | ||
buffer.bof = true; | ||
// log 'bof is reached' | ||
} | ||
if (result.length > 0) { | ||
if (buffer.length) { | ||
viewport.clipBottom(); | ||
} | ||
buffer.prepend(result); | ||
} | ||
adjustBufferAfterFetch(rid); | ||
}); | ||
} | ||
} | ||
} | ||
function resizeAndScrollHandler() { | ||
if (!$rootScope.$$phase && !adapter.isLoading && !adapter.disabled) { | ||
enqueueFetch(ridActual); | ||
if (pending.length) { | ||
unbindEvents(); | ||
} else { | ||
adapter.calculateProperties(); | ||
$scope.$apply(); | ||
} | ||
} | ||
} | ||
function wheelHandler(event) { | ||
if (!adapter.disabled) { | ||
var scrollTop = viewport[0].scrollTop; | ||
var yMax = viewport[0].scrollHeight - viewport[0].clientHeight; | ||
if (scrollTop === 0 && !buffer.bof || scrollTop === yMax && !buffer.eof) { | ||
event.preventDefault(); | ||
} | ||
} | ||
} | ||
} | ||
}]); | ||
/***/ }) | ||
/******/ ]); | ||
//# sourceMappingURL=ui-scroll.js.map |
/*! | ||
* angular-ui-scroll (compressed) | ||
* https://github.com/angular-ui/ui-scroll | ||
* Version: 1.6.1 -- 2017-03-06T07:25:30.385Z | ||
* Version: 1.6.2 -- 2017-07-06T23:27:28.966Z | ||
* License: MIT | ||
*/ | ||
!function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(1),o=r(i),a=n(2),u=r(a),l=n(3),s=r(l),c=n(4),f=r(c),d=n(6),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 g(e,t,n){var i=Object.getOwnPropertyDescriptor(e,t);i&&(i.set||i.get)||Object.defineProperty(e,t,{set:function(e){J[t]=e,r(function(){if(X[n]=e,!z.length){var r=Y.topDataPos();Y.adjustPadding(),"minIndex"===t&&Y.adjustScrollTopAfterMinIndexSet(r)}})},get:function(){return J[t]}})}function m(t){return t&&t!==q||e.$$destroyed}function v(){Y.bind("resize",A),Y.bind("scroll",A)}function b(){Y.unbind("resize",A),Y.unbind("scroll",A)}function y(){Y.resetTopPadding(),Y.resetBottomPadding(),arguments.length&&(W=arguments[0]),X.reset(W),T()}function x(e){return e.element.height()&&e.element[0].offsetParent}function w(e){x(e)&&(X.forEach(function(e){angular.isFunction(e.unregisterVisibilityWatcher)&&(e.unregisterVisibilityWatcher(),delete e.unregisterVisibilityWatcher)}),z.length||T())}function E(e,t){P(e,t,Y.insertElement),x(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?X[t-1].element:void 0;return d(function(t,o){r=n(t,i),e.element=t,e.scope=o,o[U]=e.item}),Q.transform&&Q.transform(e.scope,e.element),r}function $(){var e=[],t=[],n=[],r=[];return X.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,Y.insertElementAnimated)),i.op="none",r.push(i);break;case"remove":n.push(i)}}),n.forEach(function(t){return e=e.concat(X.remove(t))}),t.length&&t.forEach(function(e){E(e),e.op="none"}),X.forEach(function(e,t){return e.scope.$index=X.first+t}),{prepended:t,removed:n,inserted:r,animated:e}}function j(e,t){t.animated.length?i.all(t.animated).then(function(){Y.adjustPadding(),T(e)}):Y.adjustPadding()}function S(e,t){Y.shouldLoadBottom()?(!t||X.effectiveHeight(t.inserted)>0)&&1===z.push(!0)&&(O(e),Q.loading(!0)):Y.shouldLoadTop()&&(!t||X.effectiveHeight(t.prepended)>0||z[0])&&1===z.push(!1)&&(O(e),Q.loading(!0))}function T(e){e||(z=[],e=++q);var t=$();r(function(){t.inserted.forEach(function(e){return e.element.removeClass("ng-hide")}),t.prepended.forEach(function(e){return e.element.removeClass("ng-hide")}),m(e)||(j(e,t),S(e),z.length||Q.calculateProperties())})}function I(e){var t=$();r(function(){t.inserted.forEach(function(e){return e.element.removeClass("ng-hide")}),t.prepended.forEach(function(e){return e.element.removeClass("ng-hide")}),Y.adjustScrollTopAfterPrepend(t),m(e)||(j(e,t),S(e,t),z.shift(),z.length?O(e):(Q.loading(!1),v(),Q.calculateProperties()))})}function O(e){z[0]?X.length&&!Y.shouldLoadBottom()?I(e):K(function(t){m(e)||(t.length<F&&(X.eof=!0),t.length>0&&(Y.clipTop(),X.append(t)),I(e))}):X.length&&!Y.shouldLoadTop()?I(e):Z(function(t){m(e)||(t.length<F&&(X.bof=!0),t.length>0&&(X.length&&Y.clipBottom(),X.prepend(t)),I(e))})}function A(){n.$$phase||Q.isLoading||Q.disabled||(S(q),z.length?b():(Q.calculateProperties(),e.$apply()))}function k(e){if(!Q.disabled){var t=Y[0].scrollTop,n=Y[0].scrollHeight-Y[0].clientHeight;(0===t&&!X.bof||t===n&&!X.eof)&&e.preventDefault()}}var L=l.uiScroll.match(/^\s*(\w+)\s+in\s+([(\w|\$)\.]+)\s*$/);if(!L)throw new Error("Expected uiScroll in form of '_item_ in _datasource_' but got '"+l.uiScroll+"'");var C=3,V=10,_=.3,H=.5,M=null,U=L[1],B=L[2],D=c[0],F=Math.max(C,h(l.bufferSize,V)),N=Math.max(_,h(l.padding,H)),W=h(l.startIndex,1),q=0,z=[],R=new u.default(t,i),X=new s.default(R,F),Y=new f.default(R,X,a,D,n,N),Q=new p.default(Y,X,T,y,l,o,a,e);D&&(D.adapter=Q);var G=function(){return angular.isObject(M)&&angular.isFunction(M.get)};if(M=o(B)(e),!G()&&(M=t.get(B),!G()))throw new Error(B+" is not a valid datasource");var J={};g(M,"minIndex","minIndexUser"),g(M,"maxIndex","maxIndexUser");var K=2!==M.get.length?function(e){return M.get(X.next,F,e)}:function(e){M.get({index:X.next,append:X.length?X[X.length-1].item:void 0,count:F},e)},Z=2!==M.get.length?function(e){return M.get(X.first-F,F,e)}:function(e){M.get({index:X.first-F,prepend:X.length?X[0].item:void 0,count:F},e)};d(function(e,t){Y.createPaddingElements(e[0]),t.$destroy(),e.remove()}),e.$on("$destroy",function(){b(),Y.unbind("mousewheel",k)}),Y.bind("mousewheel",k),r(function(){Y.applyContainerStyle(),y()})}return{require:["?^uiScrollViewport"],restrict:"A",transclude:"element",priority:1e3,terminal:!0,link:a}}])},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=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")}}(),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(){n(this,e)}return i(e,[{key:"registerFor",value:function(e){function t(e,t,n){var i=e[0],o=r({top:["scrollTop","pageYOffset","scrollLeft"],left:["scrollLeft","pageXOffset","scrollTop"]}[t],3),a=o[0],u=o[1],s=o[2];return l(i)?angular.isDefined(n)?i.scrollTo(e[s].call(e),n):u in i?i[u]:i.document.documentElement[a]:(angular.isDefined(n)&&(i[a]=n),i[a])}function n(e,t){var n=void 0,i=void 0,a=void 0,s=void 0,c=void 0,f=void 0,d=void 0,p=void 0,h=void 0,g=void 0,m=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=r({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),m=o(e,f["padding"+d])||0,v=o(e,f["padding"+p])||0,i=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,g=o(e,c)||0,{base:n,padding:m+v,border:i+a,margin:h+g}}function i(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,l=new RegExp("^("+u+")(?!px)[a-z%]+$","i");return l.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)):i(this[0],"height","base")},outerHeight:function(e){return i(this[0],"height",e?"outerfull":"outer")},outerWidth:function(e){return i(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=o},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},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,r){n(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=r}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){var n=this;if(!this.$animate)return this.insertElement(e,t);if(this.isAngularVersionLessThen1_3){var i=function(){var r=n.$q.defer();return n.$animate.enter(e,null,t,function(){return r.resolve()}),{v:[r.promise]}}();if("object"===("undefined"==typeof i?"undefined":r(i)))return i.v}return[this.$animate.enter(e,null,t)]}},{key:"removeElementAnimated",value:function(e){var t=this;if(!this.$animate)return this.removeElement(e);if(this.isAngularVersionLessThen1_3){var n=function(){var n=t.$q.defer();return t.$animate.leave(e.element,function(){return e.scope.$destroy(),n.resolve()}),{v:[n.promise]}}();if("object"===("undefined"==typeof n?"undefined":r(n)))return n.v}return[this.$animate.leave(e.element).then(function(){return e.scope.$destroy()})]}}]),e}();t.default=o},function(e,t){"use strict";function n(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.MIN_VALUE;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=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n,r,i,o){function u(){return c.outerHeight()*o}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 a.default(e),s=new a.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,e-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()}}),c}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var o=n(5),a=r(o)},function(e,t){"use strict";function n(){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()})},clear:function(){e.length=0}}),e}function r(e){var t=void 0;switch(e.tagName){case"dl":throw new Error("ui-scroll directive does not support <"+e.tagName+"> as a repeating tag: "+e.outerHTML);case"tr":var r=angular.element("<table><tr><td><div></div></td></tr></table>");t=r.find("tr");break;case"li":t=angular.element("<li></li>");break;default:t=angular.element("<div></div>")}return t.cache=new n,t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(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 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,r,i,o,a,u,l,s){n(this,e),this.viewport=t,this.buffer=r,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 i(e,[{key:"assignAdapter",value:function(e,t,n){if(e&&(e=e.replace(/^\s+|\s+$/gm,""))){var i=r(e,n),o=void 0;try{i?(t(i.source).assign(i.target,{}),o=t(i.source)(i.target)):(t(e).assign(this.startScope,{}),o=t(e)(this.startScope))}catch(t){throw t.message="Angular ui-scroll Adapter assignment exception.\n"+("Can'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"],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)}})},u=o.length-1;u>=0;u--)a(u);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()}},{key:"prepend",value:function(e){this.buffer.prepend(e),this.adjustBuffer()}},{key:"calculateProperties",value:function(){for(var e=void 0,t=void 0,n=void 0,r=void 0,i=null,o=0,a=0;a<this.buffer.length;a++){if(e=this.buffer[a],n=e.element.offset().top,r=i!==n,i=n,r&&(t=e.element.outerHeight(!0)),!(r&&this.viewport.topDataPos()+o+t<=this.viewport.topVisiblePos())){r&&(this.topVisible=e.item,this.topVisibleElement=e.element,this.topVisibleScope=e.scope);break}o+=t}}},{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=o}]); | ||
!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()}},{key:"prepend",value:function(e){this.buffer.prepend(e),this.adjustBuffer()}},{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.MIN_VALUE;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 i=Object.getOwnPropertyDescriptor(e,t);i&&(i.set||i.get)||Object.defineProperty(e,t,{set:function(e){X[t]=e,r(function(){if(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&&(B=arguments[0]),W.reset(B),T()}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 T()}))}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 j(e,t){t.animated.length?i.all(t.animated).then(function(){q.adjustPadding(),T(e)}):q.adjustPadding()}function I(e,t){q.shouldLoadBottom()?(!t||W.effectiveHeight(t.inserted)>0)&&1===F.push(!0)&&(O(e),z.loading(!0)):q.shouldLoadTop()&&(!t||W.effectiveHeight(t.prepended)>0||F[0])&&1===F.push(!1)&&(O(e),z.loading(!0))}function T(t){t||(F=[],t=++D);var n=$();e.$apply(function(){return r(function(){n.inserted.forEach(function(e){return e.element.removeClass("ng-hide")}),n.prepended.forEach(function(e){return e.element.removeClass("ng-hide")}),g(t)||(j(t,n),I(t),F.length||z.calculateProperties())})})}function S(t){var n=$();e.$apply(function(){return r(function(){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)||(j(t,n),I(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<H&&(W.eof=!0),t.length>0&&(q.clipTop(),W.append(t)),S(e))}):W.length&&!q.shouldLoadTop()?S(e):Q(function(t){g(e)||(t.length<H&&(W.bof=!0),t.length>0&&(W.length&&q.clipBottom(),W.prepend(t)),S(e))})}function V(){n.$$phase||z.isLoading||z.disabled||(I(D),F.length?b():(z.calculateProperties(),e.$apply()))}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],M=c[0],H=Math.max(3,h(l.bufferSize,10)),U=Math.max(.3,h(l.padding,.5)),B=h(l.startIndex,1),D=0,F=[],N=new u.default(t,i),W=new s.default(N,H),q=new f.default(N,W,a,M,n,U),z=new p.default(q,W,T,x,l,o,a,e);M&&(M.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,H,e)}:function(e){L.get({index:W.next,append:W.length?W[W.length-1].item:void 0,count:H},e)},Q=2!==L.get.length?function(e){return L.get(W.first-H,H,e)}:function(e){L.get({index:W.first-H,prepend:W.length?W[0].item:void 0,count:H},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}}])}]); | ||
//# sourceMappingURL=ui-scroll.min.js.map |
{ | ||
"name": "angular-ui-scroll", | ||
"description": "AngularJS infinite scrolling module", | ||
"version": "1.6.1", | ||
"version": "1.6.2", | ||
"src": "./src/", | ||
@@ -41,10 +41,10 @@ "public": "./dist/", | ||
"grunt-karma": "^2.0.0", | ||
"grunt-webpack": "^1.0.18", | ||
"grunt-webpack": "^2.0.1", | ||
"jasmine-core": "^2.5.2", | ||
"karma": "^1.4.0", | ||
"karma-chrome-launcher": "^2.0.0", | ||
"karma-firefox-launcher": "^1.0.0", | ||
"karma-firefox-launcher": "^1.0.1", | ||
"karma-ie-launcher": "^1.0.0", | ||
"karma-jasmine": "^1.1.0", | ||
"webpack": "^1.14.0" | ||
"webpack": "^2.6.1" | ||
}, | ||
@@ -51,0 +51,0 @@ "keywords": [ |
@@ -18,3 +18,3 @@ ### UI Scroll - [AngularJS](http://angularjs.org/) directive to provide infinite scroll over a limited element buffer | ||
- [uiScroll directive](#uiscroll-directive) | ||
- [Parametrs](#parametrs) | ||
- [Parameters](#parameters) | ||
- [Datasource](#datasource) | ||
@@ -102,3 +102,3 @@ - [Adapter](#adapter) | ||
To install the package via npm use | ||
To install the package via __npm__ use | ||
@@ -109,3 +109,3 @@ ``` | ||
After installation, the ui-scroll distributive files will be available as | ||
After installation via npm, the ui-scroll distributive files will be available as | ||
@@ -117,2 +117,15 @@ ``` | ||
To install the package via __bower__ use | ||
``` | ||
bower install angular-ui-scroll | ||
``` | ||
After installation via bower, the ui-scroll distributive files will be available as | ||
``` | ||
<script src="bower_components/angular-ui-scroll/dist/ui-scroll.min.js"> | ||
<script src="bower_components/angular-ui-scroll/dist/ui-scroll-grid.min.js"> | ||
``` | ||
There are also uncompressed versions (ui-scroll.js, ui-scroll-grid.js) and sourcemaps for all of js-files. | ||
@@ -136,4 +149,3 @@ | ||
Also there is one more additional module in a separate file | ||
- __ui.scroll.jqlite__ module | ||
It is empty since it was deprecated in v1.6.0. | ||
- __ui.scroll.jqlite__ module (it is empty since it was deprecated in v1.6.0) | ||
@@ -219,3 +231,3 @@ | ||
###Adapter | ||
### Adapter | ||
@@ -227,5 +239,5 @@ The adapter object is an internal object created for every instance of the scroller. Properties and methods of the adapter can be used to manipulate and assess the scroller the adapter was created for. | ||
* `isLoading` - a boolean value (read only) indicating whether there are any pending load requests. | ||
* `topVisible` - a read only reference to the item currently in the topmost visible position. | ||
* `topVisibleElement` - a read only reference to the DOM element currently in the topmost visible position. | ||
* `topVisibleScope` - a read only reference to the scope created for the item currently in the topmost visible position. | ||
* `topVisible`/`bottomVisible` - a read only reference to the item currently in the topmost/bottommost visible position. | ||
* `topVisibleElement`/`bottomVisibleElement` - a read only reference to the DOM element currently in the topmost/bottommost visible position. | ||
* `topVisibleScope`/`bottomVisibleScope` - a read only reference to the scope created for the item currently in the topmost/bottommost visible position. | ||
* `disabled` - setting `disabled` to `true` disables scroller's scroll/resize events handlers. This can be useful if you have multiple scrollers within the same scrollViewport and you want to prevent some of them from responding to the events. | ||
@@ -322,3 +334,3 @@ | ||
###Usage | ||
### Usage | ||
@@ -466,7 +478,11 @@ ```html | ||
###v1.6.1 | ||
* Refactored Adapter assignments logic | ||
* Fixed Chrome Scroll Anchoring enforced feature [bug](https://github.com/angular-ui/ui-scroll/issues/138) | ||
### v1.6.2 | ||
* Added bottomVisible, bottomVisibleElement and bottomVisibleScope properties to the Adapter. | ||
* Fixed some issues [149](https://github.com/angular-ui/ui-scroll/issues/149), [150](https://github.com/angular-ui/ui-scroll/issues/150), [151](https://github.com/angular-ui/ui-scroll/issues/151), [158](https://github.com/angular-ui/ui-scroll/issues/158), [159](https://github.com/angular-ui/ui-scroll/issues/159), [160](https://github.com/angular-ui/ui-scroll/issues/160), [163](https://github.com/angular-ui/ui-scroll/issues/163) | ||
###v1.6.0 | ||
### v1.6.1 | ||
* Refactored Adapter assignments logic. | ||
* Fixed Chrome Scroll Anchoring enforced feature [bug](https://github.com/angular-ui/ui-scroll/issues/138). | ||
### v1.6.0 | ||
* Introduced ES6 modules in the source codes. | ||
@@ -478,11 +494,11 @@ * Improved build process with Webpack. | ||
###v1.5.2 | ||
### v1.5.2 | ||
* Refactored assignable expressions and attributes scope bindings. | ||
* Added new demos and tests. Fixed IE compatibility. | ||
###v1.5.1 | ||
### v1.5.1 | ||
* Refactored adjustments during elements append/prepend. | ||
* Bof/eof information is accessible out of the scroller. | ||
###v1.5.0 | ||
### v1.5.0 | ||
* Implemented uiScrollTh and uiScrollTd directives; uiScroll major refactoring. | ||
@@ -492,3 +508,3 @@ * Added "disabled" property to the adapter object to ignore user's scroll events. | ||
###v1.4.1 | ||
### v1.4.1 | ||
* Developed a new complex approach of padding elements height calculation (see [details](https://github.com/angular-ui/ui-scroll/pull/77)). | ||
@@ -499,8 +515,8 @@ * Added startIndex attribute. | ||
###v1.4.0 | ||
### v1.4.0 | ||
* Migrated sources from CoffeeScript to ES6. | ||
* Optimized scroll events handling, removed odd $digest cycles. | ||
* Examples (demo) refactoring. | ||
* Refactored sample demos. | ||
###v1.3.3 | ||
### v1.3.3 | ||
* Implemented new signature of the Datasource get(descriptor, success) method. | ||
@@ -510,7 +526,7 @@ * Implemented new signature of the Adapter reload(startIndex) method. | ||
###v1.3.2 | ||
### v1.3.2 | ||
* Implemented the logic for adjustBuffer triggering during invisible items became visible. | ||
###v1.3.1 | ||
* Changed the logic of viewport scroll/padding recalculation (to solve the problem [#8](https://github.com/angular-ui/ui-scroll/issues/8)). | ||
### v1.3.1 | ||
* Changed the logic of viewport scroll/padding recalculation. | ||
* Splitted test specifications. | ||
@@ -520,9 +536,9 @@ * Updated dev-dependencies (package.json). | ||
###v1.3.0 | ||
### v1.3.0 | ||
* Reorganized the repository structure. | ||
###v1.2.1 | ||
### v1.2.1 | ||
* Dismiss pending requests on applyUpdates(). | ||
###v1.2.0 | ||
### v1.2.0 | ||
* Changed the algorithm of list items building. | ||
@@ -532,11 +548,11 @@ * Integration with angular $animation. | ||
###v1.1.2 | ||
### v1.1.2 | ||
* Fixed inserting elements via applyUpdates error. | ||
###v1.1.1 | ||
### v1.1.1 | ||
* Fixed jqlite on $destroy error. | ||
###v1.1.0 | ||
### v1.1.0 | ||
* Introduced API to dynamically update scroller content. | ||
* Deep 'name' properties access via dot-notation in template. | ||
* Fixed the problem occurring if the scroller is $destroyed while there are requests pending: [#64](https://github.com/Hill30/NGScroller/issues/64). |
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
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
1317897
102
13085
544