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

angular-ui-scroll

Package Overview
Dependencies
Maintainers
2
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-ui-scroll - npm Package Compare versions

Comparing version 1.5.2 to 1.6.0

demo/insideComponent/insideComponent.html

2

demo/adapter/adapter.js

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

angular.module('application', ['ui.scroll', 'ui.scroll.jqlite']).controller('mainController', [
angular.module('application', ['ui.scroll']).controller('mainController', [
'$scope', '$log', '$timeout', function($scope, console, $timeout) {

@@ -3,0 +3,0 @@ var datasource, idList1, idList2;

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

angular.module('application', ['ui.scroll', 'ui.scroll.jqlite'])
angular.module('application', ['ui.scroll'])
.controller('mainController', [

@@ -3,0 +3,0 @@ '$scope', '$log', '$timeout', function ($scope, console, $timeout) {

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

angular.module('application', ['ui.scroll', 'ui.scroll.jqlite', 'ngAnimate']).controller('mainController', [
angular.module('application', ['ui.scroll', 'ngAnimate']).controller('mainController', [
'$scope', '$log', '$timeout', function($scope, console, $timeout) {

@@ -3,0 +3,0 @@ var datasource, idList;

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

var app = angular.module('application', ['ui.scroll', 'ui.scroll.jqlite']);
var app = angular.module('application', ['ui.scroll']);

@@ -3,0 +3,0 @@ app.factory('Server', [

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

angular.module('application', ['ui.scroll', 'ui.scroll.jqlite']).controller('mainController', [
angular.module('application', ['ui.scroll']).controller('mainController', [
'$scope', '$log', '$timeout', function($scope, console, $timeout) {

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

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

var app = angular.module('application', ['ui.scroll', 'ui.scroll.jqlite']);
var app = angular.module('application', ['ui.scroll']);

@@ -3,0 +3,0 @@ app.factory('Server', [

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

angular.module('application', ['ui.scroll', 'ui.scroll.jqlite']).controller('mainController', [
angular.module('application', ['ui.scroll']).controller('mainController', [
'$timeout', function($timeout) {

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

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

angular.module('application', ['ui.scroll', 'ui.scroll.jqlite']).factory('datasource', [
angular.module('application', ['ui.scroll']).factory('datasource', [
'$log', '$timeout', function(console, $timeout) {

@@ -3,0 +3,0 @@ var get, max, min;

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

angular.module('application', ['ui.scroll', 'ui.scroll.jqlite'])
angular.module('application', ['ui.scroll'])
.controller('mainController', [

@@ -3,0 +3,0 @@ '$scope', '$log', '$timeout', function ($scope, console, $timeout) {

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

angular.module('application', ['ui.scroll', 'ui.scroll.jqlite', 'ui.scroll.grid', 'dnd'])
angular.module('application', ['ui.scroll', 'ui.scroll.grid', 'dnd'])
.controller('gridController', [

@@ -3,0 +3,0 @@ '$scope', '$log', '$timeout', function ($scope, console, $timeout) {

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

angular.module('application', ['ui.scroll', 'ui.scroll.jqlite', 'ui.scroll.grid'])
angular.module('application', ['ui.scroll', 'ui.scroll.grid'])
.controller('gridController', [

@@ -3,0 +3,0 @@ '$scope', '$log', '$timeout', function ($scope, console, $timeout) {

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

angular.module('application', ['ui.scroll', 'ui.scroll.jqlite', 'ui.scroll.grid'])
angular.module('application', ['ui.scroll', 'ui.scroll.grid'])
.controller('gridController', [

@@ -3,0 +3,0 @@ '$scope', '$log', '$timeout', function ($scope, console, $timeout) {

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

angular.module('application', ['ui.scroll', 'ui.scroll.jqlite', 'ui.scroll.grid'])
angular.module('application', ['ui.scroll', 'ui.scroll.grid'])
.controller('gridController', [

@@ -3,0 +3,0 @@ '$scope', '$log', '$timeout', function ($scope, console, $timeout) {

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

angular.module('application', ['ui.scroll', 'ui.scroll.jqlite', 'ui.scroll.grid'])
angular.module('application', ['ui.scroll', 'ui.scroll.grid'])
.controller('gridController', [

@@ -3,0 +3,0 @@ '$scope', '$log', '$timeout', function ($scope, console, $timeout) {

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

angular.module('application', ['ui.scroll', 'ui.scroll.jqlite'])
angular.module('application', ['ui.scroll'])
.controller('mainController', ['$scope', function($scope) {

@@ -3,0 +3,0 @@ $scope.show = true;

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

angular.module('application', ['ui.scroll', 'ui.scroll.jqlite'])
angular.module('application', ['ui.scroll'])
.factory('datasource', ['$log', '$timeout',

@@ -3,0 +3,0 @@ function (console, $timeout) {

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

angular.module('application', ['ui.scroll', 'ui.scroll.jqlite'])
angular.module('application', ['ui.scroll'])
.controller('mainController', [

@@ -3,0 +3,0 @@ '$scope', '$log', '$timeout', function ($scope, console, $timeout) {

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

angular.module('application', ['ui.scroll', 'ui.scroll.jqlite'])
angular.module('application', ['ui.scroll'])
.factory('datasource', ['$log', '$timeout',

@@ -3,0 +3,0 @@ function (console, $timeout) {

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

angular.module('application', ['ui.scroll', 'ui.scroll.jqlite'])
angular.module('application', ['ui.scroll'])
.controller('mainController', [

@@ -3,0 +3,0 @@ '$scope', '$log', '$timeout', function ($scope, console, $timeout) {

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

angular.module('application', ['ui.scroll', 'ui.scroll.jqlite'])
angular.module('application', ['ui.scroll'])
.controller('mainController', [

@@ -3,0 +3,0 @@ '$scope', '$log', '$timeout', function ($scope, console, $timeout) {

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

angular.module('application', ['ui.scroll', 'ui.scroll.jqlite'])
angular.module('application', ['ui.scroll'])
.factory('datasource', [ '$log', '$timeout', '$rootScope', '$location',

@@ -3,0 +3,0 @@ function (console, $timeout, $rootScope, $location) {

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

angular.module('application', ['ui.scroll', 'ui.scroll.jqlite'])
angular.module('application', ['ui.scroll'])
.factory('datasource', ['$log', '$timeout', '$rootScope',

@@ -3,0 +3,0 @@ function (console, $timeout, $rootScope) {

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

angular.module('application', ['ui.scroll', 'ui.scroll.jqlite'])
angular.module('application', ['ui.scroll'])
.controller('mainController', [

@@ -3,0 +3,0 @@ '$scope', '$log', '$timeout', function ($scope, console, $timeout) {

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

angular.module('application', ['ui.scroll', 'ui.scroll.jqlite'])
angular.module('application', ['ui.scroll'])
.controller('mainController', [

@@ -3,0 +3,0 @@ '$scope', '$log', '$timeout', function ($scope, console, $timeout) {

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

angular.module('application', ['ui.scroll', 'ui.scroll.jqlite'])
angular.module('application', ['ui.scroll'])
.controller('mainController', [

@@ -3,0 +3,0 @@ '$scope', '$log', '$timeout', function ($scope, console, $timeout) {

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

angular.module('application', ['ui.scroll', 'ui.scroll.jqlite']).factory('datasource', [
angular.module('application', ['ui.scroll']).factory('datasource', [
'$log', '$timeout', function(console, $timeout) {

@@ -3,0 +3,0 @@ var get, max, min;

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

angular.module('application', ['ui.scroll', 'ui.scroll.jqlite'])
angular.module('application', ['ui.scroll'])
.factory('datasource', ['$log', '$timeout',

@@ -3,0 +3,0 @@ function (console, $timeout) {

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

angular.module('application', ['ui.scroll', 'ui.scroll.jqlite'])
angular.module('application', ['ui.scroll'])
.factory('datasource', ['$log', '$timeout',

@@ -3,0 +3,0 @@ function (console, $timeout) {

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

angular.module('application', ['ui.scroll', 'ui.scroll.jqlite'])
angular.module('application', ['ui.scroll'])
.factory('datasource', ['$log', '$timeout',

@@ -3,0 +3,0 @@ function (console, $timeout) {

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

angular.module('application', ['ui.scroll', 'ui.scroll.jqlite'])
angular.module('application', ['ui.scroll'])
.controller('mainController', [

@@ -3,0 +3,0 @@ '$scope', '$log', '$timeout', function ($scope, console, $timeout) {

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

angular.module('application', ['ui.scroll', 'ui.scroll.jqlite'])
angular.module('application', ['ui.scroll'])
.controller('mainController', [

@@ -3,0 +3,0 @@ '$scope', '$log', '$timeout', function ($scope, console, $timeout) {

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

angular.module('application', ['ui.scroll', 'ui.scroll.jqlite'])
angular.module('application', ['ui.scroll'])
.factory('datasource', ['$log', '$timeout',

@@ -3,0 +3,0 @@ function (console, $timeout) {

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

angular.module('application', ['ui.scroll', 'ui.scroll.jqlite'])
angular.module('application', ['ui.scroll'])
.factory('datasource', ['$log', '$timeout',

@@ -3,0 +3,0 @@ function (console, $timeout) {

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

angular.module('application', ['ui.scroll', 'ui.scroll.jqlite']).factory('datasource', [
angular.module('application', ['ui.scroll']).factory('datasource', [
'$log', '$timeout', function(console, $timeout) {

@@ -3,0 +3,0 @@ var get;

/*!
* angular-ui-scroll
* https://github.com/angular-ui/ui-scroll.git
* Version: 1.5.2 -- 2016-11-18T00:26:15.332Z
* angular-ui-scroll (uncompressed)
* https://github.com/angular-ui/ui-scroll
* Version: 1.6.0 -- 2017-02-04T09:24:37.966Z
* License: MIT
*/
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ 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
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports) {
(function () {
'use strict';
'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.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);
});
}
})();
}
}
};
});
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) {
controller.moveBefore(column, index);
};
this.exchangeWith = function (index) {
controller.exchangeWith(column, index);
};
Object.defineProperty(this, 'columnId', { get: function get() {
return column.id;
} });
}
function ColumnController(controller, columns, header) {
this.header = header;
this.cells = [];
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 = undefined;
controller.forEachRow(function (row) {
if (insidePoint(row[_this2.id], x, y)) result = _this2;
});
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, target) {
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(scope, scrollViewport) {
var _this3 = this;
var columns = [];
var rowMap = new Map();
$timeout(function () {
scrollViewport.adapter.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) {
columns[index].applyLayout(layout);
});
transform(columns.map(function (column) {
return column.header;
}));
rowMap.forEach(function (row) {
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 = undefined;
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) {
for (var i = 0; i < columns.length; i++) {
var column = columns[i].columnFromPoint(x, y);
if (column) break;
}
if (column) return new ColumnAdapter(this, column);
return 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, linker) {
controllers[0].gridController = controllers[0].gridController || new GridController($scope, controllers[0]);
controllers[0].gridController.registerColumn(element);
}
};
}]).directive('uiScrollTd', ['$log', function (console) {
return {
require: ['?^^uiScrollViewport'],
restrict: 'A',
link: function link($scope, element, $attr, controllers, linker) {
if (controllers[0]) {
(function () {
var gridController = controllers[0].gridController;
if (gridController.registerCell($scope, element)) {
$scope.$on('$destroy', function () {
return gridController.unregisterCell($scope, element);
});
}
})();
}
}
};
}]);
}());
/***/ }
/******/ ]);
//# sourceMappingURL=ui-scroll-grid.js.map
/*!
* angular-ui-scroll
* https://github.com/angular-ui/ui-scroll.git
* Version: 1.5.2 -- 2016-11-18T00:26:15.332Z
* angular-ui-scroll (compressed)
* https://github.com/angular-ui/ui-scroll
* Version: 1.6.0 -- 2017-02-04T09:24:38.215Z
* License: MIT
*/
!function(){"use strict";angular.module("ui.scroll.grid",[]).directive("uiScrollTh",["$log","$timeout",function(a,b){function c(a){this.getLayout=function(){return a.getLayout()},this.applyLayout=function(b){return a.applyLayout(b)},this.columnFromPoint=function(b,c){return a.columnFromPoint(b,c)},Object.defineProperty(this,"columns",{get:function(){return a.getColumns()}})}function d(a,b){this.css=function(){var c=arguments[0],d=arguments[1];return 1==arguments.length?b.header.css(c):void(2==arguments.length&&(b.header.css(c,d),a.forEachRow(function(a){return a[b.id].css(c,d)}),b.css[c]=d))},this.moveBefore=function(c){a.moveBefore(b,c)},this.exchangeWith=function(c){a.exchangeWith(b,c)},Object.defineProperty(this,"columnId",{get:function(){return b.id}})}function e(a,b,c){function d(a,b,c){var d=a.offset();return b<d.left||d.left+a.outerWidth(!0)<b?!1:!(c<d.top||d.top+a.outerHeight(!0)<c)}function e(a,b){a.detach(),b.before(a)}function f(a,b){var c=a.parent();a.detach(),c.append(a)}function g(a,b){a.removeAttr("style");for(var c in b)b.hasOwnProperty(c)&&a.css(c,b[c])}this.header=c,this.cells=[],this.css={},this.mapTo=b.length,this.id=b.length,this.applyLayout=function(a){this.css=angular.extend({},a.css),this.mapTo=a.mapTo,g(this.header,this.css)},this.moveBefore=function(b){var d=this;b?(e(c,b.header),a.forEachRow(function(a){return e(a[d.id],a[b.id])})):(f(c),a.forEachRow(function(a){return f(a[d.id])}))},this.columnFromPoint=function(b,e){var f=this;if(d(c,b,e))return this;var g=void 0;return a.forEachRow(function(a){d(a[f.id],b,e)&&(g=f)}),g},this.applyCss=function(a){g(a,this.css)}}function f(a,f){function g(a){var b=a[0].parent(),c=[];a.forEach(function(b,d){i[d].applyCss(b),c[i[d].mapTo]=a[d],a[d].detach()}),c.forEach(function(a){return b.append(a)})}var h=this,i=[],j=new Map;b(function(){f.adapter.gridAdapter=new c(h),f.adapter.transform=function(a,b){return g(j.get(a),b)}}),this.registerColumn=function(a){i.push(new e(this,i,a))},this.registerCell=function(a,b){var c=j.get(a);return c||(c=[],j.set(a,c)),c.length>=i.length?!1:(c.push(b),!0)},this.unregisterCell=function(a,b){var c=j.get(a),d=c.indexOf(b);c.splice(d,1),c.length||j["delete"](a)},this.forEachRow=function(a){j.forEach(a)},this.getColumns=function(){var a=this,b=[];return i.slice().sort(function(a,b){return a.mapTo-b.mapTo}).forEach(function(c){return b.push(new d(a,c))}),b},this.getLayout=function(){var a=[];return i.forEach(function(b,c){return a.push({index:c,css:angular.extend({},b.css),mapTo:b.mapTo})}),a},this.applyLayout=function(a){if(!a||a.length!=i.length)throw new Error("Failed to apply layout - number of layouts should match number of columns");a.forEach(function(a,b){i[b].applyLayout(a)}),g(i.map(function(a){return a.header})),j.forEach(function(a){g(a)})},this.moveBefore=function(a,b){var c=b;if(b%1!==0&&(c=b?i[b.columnId].mapTo:i.length),!(0>c||c>i.length)){var d=a.mapTo,e=void 0;c-=c>d?1:0,i.forEach(function(a){a.mapTo-=a.mapTo>d?1:0,a.mapTo+=a.mapTo>=c?1:0,e=a.mapTo===c+1?a:e}),a.mapTo=c,a.moveBefore(e)}},this.exchangeWith=function(a,b){0>b||b>=i.length||(i.find(function(a){return a.mapTo===b}).mapTo=a.mapTo,a.mapTo=b)},this.columnFromPoint=function(a,b){for(var c=0;c<i.length;c++){var e=i[c].columnFromPoint(a,b);if(e)break}return e?new d(this,e):void 0}}return{require:["^^uiScrollViewport"],restrict:"A",link:function(a,b,c,d,e){d[0].gridController=d[0].gridController||new f(a,d[0]),d[0].gridController.registerColumn(b)}}}]).directive("uiScrollTd",["$log",function(a){return{require:["?^^uiScrollViewport"],restrict:"A",link:function(a,b,c,d,e){d[0]&&!function(){var c=d[0].gridController;c.registerCell(a,b)&&a.$on("$destroy",function(){return c.unregisterCell(a,b)})}()}}}])}();
!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.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)})}()}}})}]);
//# sourceMappingURL=ui-scroll-grid.min.js.map
/*!
* angular-ui-scroll
* https://github.com/angular-ui/ui-scroll.git
* Version: 1.5.2 -- 2016-11-18T00:26:15.332Z
* This module is deprecated since 1.6.0 and will be removed in further versions!
* License: MIT
*/
(function () {
'use strict';
(function () {
'use strict';
angular.module('ui.scroll.jqlite', []);
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'); } }; }();
angular.module('ui.scroll.jqlite', ['ui.scroll']).service('jqLiteExtras', ['$log', '$window', function (console, window) {
return {
registerFor: function registerFor(element) {
var convertToPx, css, getStyle, isWindow;
// 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);
var method = _top$left$direction[0];
var prop = _top$left$direction[1];
var 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 = undefined,
result = undefined,
rs = undefined,
rsLeft = undefined,
style = undefined;
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 = undefined,
borderA = undefined,
borderB = undefined,
computedMarginA = undefined,
computedMarginB = undefined,
computedStyle = undefined,
dirA = undefined,
dirB = undefined,
marginA = undefined,
marginB = undefined,
paddingA = undefined,
paddingB = undefined;
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 = undefined,
result = undefined;
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 = undefined,
win = undefined;
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;
}
});
}
};
}]).run(['$log', '$window', 'jqLiteExtras', function (console, window, jqLiteExtras) {
if (!window.jQuery) {
return jqLiteExtras.registerFor(angular.element);
}
}]);
}());
/*!
* angular-ui-scroll
* https://github.com/angular-ui/ui-scroll.git
* Version: 1.5.2 -- 2016-11-18T00:26:15.332Z
* This module is deprecated since 1.6.0 and will be removed in further versions!
* License: MIT
*/
!function(){"use strict";var a=function(){function a(a,b){var c=[],d=!0,e=!1,f=void 0;try{for(var g,h=a[Symbol.iterator]();!(d=(g=h.next()).done)&&(c.push(g.value),!b||c.length!==b);d=!0);}catch(i){e=!0,f=i}finally{try{!d&&h["return"]&&h["return"]()}finally{if(e)throw f}}return c}return function(b,c){if(Array.isArray(b))return b;if(Symbol.iterator in Object(b))return a(b,c);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();angular.module("ui.scroll.jqlite",["ui.scroll"]).service("jqLiteExtras",["$log","$window",function(b,c){return{registerFor:function(b){function d(b,c,d){var e=b[0],f=a({top:["scrollTop","pageYOffset","scrollLeft"],left:["scrollLeft","pageXOffset","scrollTop"]}[c],3),g=f[0],h=f[1],i=f[2];return j(e)?angular.isDefined(d)?e.scrollTo(b[i].call(b),d):h in e?e[h]:e.document.documentElement[g]:(angular.isDefined(d)&&(e[g]=d),e[g])}function e(b,c){var d=void 0,e=void 0,f=void 0,h=void 0,k=void 0,l=void 0,m=void 0,n=void 0,o=void 0,p=void 0,q=void 0,r=void 0;if(j(b))return d=document.documentElement[{height:"clientHeight",width:"clientWidth"}[c]],{base:d,padding:0,border:0,margin:0};var s=a({width:[b.offsetWidth,"Left","Right"],height:[b.offsetHeight,"Top","Bottom"]}[c],3);return d=s[0],m=s[1],n=s[2],l=i(b),q=g(b,l["padding"+m])||0,r=g(b,l["padding"+n])||0,e=g(b,l["border"+m+"Width"])||0,f=g(b,l["border"+n+"Width"])||0,h=l["margin"+m],k=l["margin"+n],o=g(b,h)||0,p=g(b,k)||0,{base:d,padding:q+r,border:e+f,margin:o+p}}function f(a,b,c){var d=void 0,f=void 0,g=e(a,b);return g.base>0?{base:g.base-g.padding-g.border,outer:g.base,outerfull:g.base+g.margin}[c]:(d=i(a),f=d[b],(0>f||null===f)&&(f=a.style[b]||0),f=parseFloat(f)||0,{base:f-g.padding-g.border,outer:f,outerfull:f+g.padding+g.border+g.margin}[c])}var g,h,i,j;return h=angular.element.prototype.css,b.prototype.css=function(a,b){var c=this,d=c[0];return d&&3!==d.nodeType&&8!==d.nodeType&&d.style?h.call(c,a,b):void 0},j=function(a){return a&&a.document&&a.location&&a.alert&&a.setInterval},c.getComputedStyle?(i=function(a){return c.getComputedStyle(a,null)},g=function(a,b){return parseFloat(b)}):(i=function(a){return a.currentStyle},g=function(a,b){var c=void 0,d=void 0,e=void 0,f=void 0,g=void 0,h=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,i=new RegExp("^("+h+")(?!px)[a-z%]+$","i");return i.test(b)?(g=a.style,c=g.left,e=a.runtimeStyle,f=e&&e.left,e&&(e.left=g.left),g.left=b,d=g.pixelLeft,g.left=c,f&&(e.left=f),d):parseFloat(b)}),angular.forEach({before:function(a){var b,c,d,e,f,g,h;if(h=this,c=h[0],f=h.parent(),b=f.contents(),b[0]===c)return f.prepend(a);for(d=e=1,g=b.length-1;g>=1?g>=e:e>=g;d=g>=1?++e:--e)if(b[d]===c)return void angular.element(b[d-1]).after(a);throw new Error("invalid DOM structure "+c.outerHTML)},height:function(a){var b;return b=this,angular.isDefined(a)?(angular.isNumber(a)&&(a+="px"),h.call(b,"height",a)):f(this[0],"height","base")},outerHeight:function(a){return f(this[0],"height",a?"outerfull":"outer")},outerWidth:function(a){return f(this[0],"width",a?"outerfull":"outer")},offset:function(a){var b=void 0,c=void 0,d=this,e={top:0,left:0},f=d[0],g=f&&f.ownerDocument;if(arguments.length){if(void 0===a)return d;throw new Error("offset setter method is not implemented")}return g?(b=g.documentElement,null!=f.getBoundingClientRect&&(e=f.getBoundingClientRect()),c=g.defaultView||g.parentWindow,{top:e.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:e.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):void 0},scrollTop:function(a){return d(this,"top",a)},scrollLeft:function(a){return d(this,"left",a)}},function(a,c){return b.prototype[c]?void 0:b.prototype[c]=a})}}}]).run(["$log","$window","jqLiteExtras",function(a,b,c){return b.jQuery?void 0:c.registerFor(angular.element)}])}();
(function () {
'use strict';
angular.module('ui.scroll.jqlite', []);
}());
/*!
* angular-ui-scroll
* https://github.com/angular-ui/ui-scroll.git
* Version: 1.5.2 -- 2016-11-18T00:26:15.332Z
* angular-ui-scroll (uncompressed)
* https://github.com/angular-ui/ui-scroll
* Version: 1.6.0 -- 2017-02-04T09:24:37.966Z
* License: MIT
*/
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ 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
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {
(function () {
'use strict';
'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;
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, padding);
var adapter = new _adapter2.default($rootScope, $parse, $attr, viewport, buffer, adjustBuffer, element);
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);
};
adapter.reload = reload;
/**
* 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;
}
});
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();
}
}
}
}
}]);
var _typeof = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === 'function' && obj.constructor === Symbol ? 'symbol' : typeof obj; };
/***/ },
/* 1 */
/***/ function(module, exports) {
/*!
globals: angular, window
'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;
List of used element methods available in JQuery but not in JQuery Lite
/***/ },
/* 2 */
/***/ function(module, exports) {
element.before(elem)
element.height()
element.outerHeight(true)
element.height(value) = only for Top/Bottom padding elements
element.scrollTop()
element.scrollTop(value)
*/
angular.module('ui.scroll', []).directive('uiScrollViewport', function () {
return {
restrict: 'A',
controller: ['$log', '$scope', '$element', function (console, scope, element) {
var self = this;
self.container = element;
self.viewport = element;
'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;
angular.forEach(element.children(), function (child) {
if (child.tagName.toLowerCase() === 'tbody') {
self.viewport = angular.element(child);
}
});
}]
};
}).directive('uiScroll', ['$log', '$injector', '$rootScope', '$timeout', '$q', '$parse', function (console, $injector, $rootScope, $timeout, $q, $parse) {
var $animate = $injector.has && $injector.has('$animate') ? $injector.get('$animate') : null;
var isAngularVersionLessThen1_3 = angular.version.major === 1 && angular.version.minor < 3;
/***/ },
/* 3 */
/***/ function(module, exports) {
return {
require: ['?^^uiScrollViewport'],
restrict: 'A',
transclude: 'element',
priority: 1000,
terminal: true,
link: link
};
'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;
}
// Element manipulation routines
function _insertElement(newElement, previousElement) {
previousElement.after(newElement);
return [];
}
/***/ },
/* 4 */
/***/ function(module, exports, __webpack_require__) {
function removeElement(wrapper) {
wrapper.element.remove();
wrapper.scope.$destroy();
return [];
}
'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, 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;
viewport.css({
'overflow-y': 'auto',
'display': 'block'
});
function bufferPadding() {
return viewport.outerHeight() * padding; // some extra space to initiate preload
}
angular.extend(viewport, {
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;
}
function _insertElementAnimated(newElement, previousElement) {
if (!$animate) {
return _insertElement(newElement, previousElement);
}
/***/ },
/* 5 */
/***/ function(module, exports) {
if (isAngularVersionLessThen1_3) {
var _ret = function () {
var deferred = $q.defer();
// no need for parent - previous element is never null
$animate.enter(newElement, null, previousElement, function () {
return deferred.resolve();
});
'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;
}
return {
v: [deferred.promise]
};
}();
/***/ },
/* 6 */
/***/ function(module, exports) {
if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === 'object') return _ret.v;
}
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = Adapter;
function Adapter($rootScope, $parse, $attr, viewport, buffer, adjustBuffer, element) {
var viewportScope = viewport.scope() || $rootScope;
var disabled = false;
var self = this;
createValueInjector('adapter')(self);
var topVisibleInjector = createValueInjector('topVisible');
var topVisibleElementInjector = createValueInjector('topVisibleElement');
var topVisibleScopeInjector = createValueInjector('topVisibleScope');
var isLoadingInjector = createValueInjector('isLoading');
// Adapter API definition
Object.defineProperty(this, 'disabled', {
get: function get() {
return disabled;
},
set: function set(value) {
return !(disabled = value) ? adjustBuffer() : null;
}
});
this.isLoading = false;
this.isBOF = function () {
return buffer.bof;
};
this.isEOF = function () {
return buffer.eof;
};
this.isEmpty = function () {
return !buffer.length;
};
this.applyUpdates = function (arg1, arg2) {
if (angular.isFunction(arg1)) {
// arg1 is the updater function, arg2 is ignored
buffer.slice(0).forEach(function (wrapper) {
// we need to do it on the buffer clone, because buffer content
// may change as we iterate through
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 - buffer.first;
if (index >= 0 && index < buffer.length) {
applyUpdate(buffer[index], arg2);
}
}
adjustBuffer();
};
this.append = function (newItems) {
buffer.append(newItems);
adjustBuffer();
};
this.prepend = function (newItems) {
buffer.prepend(newItems);
adjustBuffer();
};
this.loading = function (value) {
isLoadingInjector(value);
};
this.calculateProperties = function () {
var item = void 0,
itemHeight = void 0,
itemTop = void 0,
isNewRow = void 0,
rowTop = null;
var topHeight = 0;
for (var i = 0; i < buffer.length; i++) {
item = buffer[i];
itemTop = item.element.offset().top;
isNewRow = rowTop !== itemTop;
rowTop = itemTop;
if (isNewRow) {
itemHeight = item.element.outerHeight(true);
}
if (isNewRow && viewport.topDataPos() + topHeight + itemHeight <= viewport.topVisiblePos()) {
topHeight += itemHeight;
} else {
if (isNewRow) {
topVisibleInjector(item.item);
topVisibleElementInjector(item.element);
topVisibleScopeInjector(item.scope);
}
break;
}
}
};
// private function definitions
function createValueInjector(attribute) {
var expression = $attr[attribute];
var scope = viewportScope;
var assign = void 0;
if (expression) {
// it is ok to have relaxed validation for the first part of the 'on' expression.
// additional validation will be done by the $parse service below
var match = expression.match(/^(\S+)(?:\s+on\s+(\w(?:\w|\d)*))?/);
if (!match) throw new Error('Expected injection expression in form of \'target\' or \'target on controller\' but got \'' + expression + '\'');
var target = match[1];
var onControllerName = match[2];
var parseController = function parseController(controllerName, on) {
var candidate = element;
while (candidate.length) {
var candidateScope = candidate.scope();
// ng-controller's "Controller As" parsing
var candidateName = (candidate.attr('ng-controller') || '').match(/(\w(?:\w|\d)*)(?:\s+as\s+(\w(?:\w|\d)*))?/);
if (candidateName && candidateName[on ? 1 : 2] === controllerName) {
scope = candidateScope;
return true;
}
// directive's/component's "Controller As" parsing
if (!on && candidateScope && candidateScope.hasOwnProperty(controllerName) && Object.getPrototypeOf(candidateScope[controllerName]).constructor.hasOwnProperty('$inject')) {
scope = candidateScope;
return true;
}
candidate = candidate.parent();
}
};
if (onControllerName) {
// 'on' syntax DOM parsing (adapter="adapter on ctrl")
scope = null;
parseController(onControllerName, true);
if (!scope) {
throw new Error('Failed to locate target controller \'' + onControllerName + '\' to inject \'' + target + '\'');
}
} else {
// try to parse DOM with 'Controller As' syntax (adapter="ctrl.adapter")
var controllerAsName = void 0;
var dotIndex = target.indexOf('.');
if (dotIndex > 0) {
controllerAsName = target.substr(0, dotIndex);
parseController(controllerAsName, false);
}
}
assign = $parse(target).assign;
}
return function (value) {
if (self !== value) // just to avoid injecting adapter reference in the adapter itself. Kludgy, I know.
self[attribute] = value;
if (assign) assign(scope, value);
};
}
function applyUpdate(wrapper, newItems) {
if (!angular.isArray(newItems)) {
return;
}
var keepIt = void 0;
var pos = buffer.indexOf(wrapper) + 1;
newItems.reverse().forEach(function (newItem) {
if (newItem === wrapper.item) {
keepIt = true;
pos--;
} else {
buffer.insert(pos, newItem);
}
});
if (!keepIt) {
wrapper.op = 'remove';
}
}
}
// no need for parent - previous element is never null
return [$animate.enter(newElement, null, previousElement)];
}
function removeElementAnimated(wrapper) {
if (!$animate) {
return removeElement(wrapper);
}
if (isAngularVersionLessThen1_3) {
var _ret2 = function () {
var deferred = $q.defer();
$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 [$animate.leave(wrapper.element).then(function () {
return wrapper.scope.$destroy();
})];
}
function Buffer(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++) {
removeElement(buffer[i]);
}
return buffer.splice(arg1, arg2 - arg1);
}
// removes single item(wrapper) from the buffer
buffer.splice(buffer.indexOf(arg1), 1);
return 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;
}
function Viewport(buffer, element, viewportController, padding) {
var topPadding = undefined;
var bottomPadding = undefined;
var viewport = viewportController && viewportController.viewport ? viewportController.viewport : angular.element(window);
var container = viewportController && viewportController.container ? viewportController.container : undefined;
viewport.css({
'overflow-y': 'auto',
'display': 'block'
});
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 = undefined;
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;
}
function bufferPadding() {
return viewport.outerHeight() * padding; // some extra space to initiate preload
}
angular.extend(viewport, {
createPaddingElements: function createPaddingElements(template) {
topPadding = new Padding(template);
bottomPadding = new Padding(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 _insertElement(e, sibling || topPadding);
},
insertElementAnimated: function insertElementAnimated(e, sibling) {
return _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;
}
function Adapter($attr, viewport, buffer, adjustBuffer, element) {
var viewportScope = viewport.scope() || $rootScope;
var disabled = false;
var self = this;
createValueInjector('adapter')(self);
var topVisibleInjector = createValueInjector('topVisible');
var topVisibleElementInjector = createValueInjector('topVisibleElement');
var topVisibleScopeInjector = createValueInjector('topVisibleScope');
var isLoadingInjector = createValueInjector('isLoading');
// Adapter API definition
Object.defineProperty(this, 'disabled', {
get: function get() {
return disabled;
},
set: function set(value) {
return !(disabled = value) ? adjustBuffer() : null;
}
});
this.isLoading = false;
this.isBOF = function () {
return buffer.bof;
};
this.isEOF = function () {
return buffer.eof;
};
this.applyUpdates = function (arg1, arg2) {
if (angular.isFunction(arg1)) {
// arg1 is the updater function, arg2 is ignored
buffer.slice(0).forEach(function (wrapper) {
// we need to do it on the buffer clone, because buffer content
// may change as we iterate through
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 - buffer.first;
if (index >= 0 && index < buffer.length) {
applyUpdate(buffer[index], arg2);
}
}
adjustBuffer();
};
this.append = function (newItems) {
buffer.append(newItems);
adjustBuffer();
};
this.prepend = function (newItems) {
buffer.prepend(newItems);
adjustBuffer();
};
this.loading = function (value) {
isLoadingInjector(value);
};
this.calculateProperties = function () {
var item = undefined,
itemHeight = undefined,
itemTop = undefined,
isNewRow = undefined,
rowTop = undefined;
var topHeight = 0;
for (var i = 0; i < buffer.length; i++) {
item = buffer[i];
itemTop = item.element.offset().top;
isNewRow = rowTop !== itemTop;
rowTop = itemTop;
if (isNewRow) {
itemHeight = item.element.outerHeight(true);
}
if (isNewRow && viewport.topDataPos() + topHeight + itemHeight <= viewport.topVisiblePos()) {
topHeight += itemHeight;
} else {
if (isNewRow) {
topVisibleInjector(item.item);
topVisibleElementInjector(item.element);
topVisibleScopeInjector(item.scope);
}
break;
}
}
};
// private function definitions
function createValueInjector(attribute) {
var expression = $attr[attribute];
var scope = viewportScope;
var assign = undefined;
if (expression) {
// it is ok to have relaxed validation for the first part of the 'on' expression.
// additional validation will be done by the $parse service below
var match = expression.match(/^(\S+)(?:\s+on\s+(\w(?:\w|\d)*))?/);
if (!match) throw new Error('Expected injection expression in form of \'target\' or \'target on controller\' but got \'' + expression + '\'');
var target = match[1];
var onControllerName = match[2];
var parseController = function parseController(controllerName, on) {
var candidate = element;
while (candidate.length) {
var candidateScope = candidate.scope();
// ng-controller's 'Controller As' parsing
var candidateName = (candidate.attr('ng-controller') || '').match(/(\w(?:\w|\d)*)(?:\s+as\s+(\w(?:\w|\d)*))?/);
if (candidateName && candidateName[on ? 1 : 2] === controllerName) {
scope = candidateScope;
return true;
}
// directive's/component's 'Controller As' parsing
if (!on && candidateScope && candidateScope.hasOwnProperty(controllerName) && Object.getPrototypeOf(candidateScope[controllerName]).constructor.hasOwnProperty('$inject')) {
scope = candidateScope;
return true;
}
candidate = candidate.parent();
}
};
if (onControllerName) {
// 'on' syntax DOM parsing (adapter='adapter on ctrl')
scope = null;
parseController(onControllerName, true);
if (!scope) {
throw new Error('Failed to locate target controller \'' + onControllerName + '\' to inject \'' + target + '\'');
}
} else {
// try to parse DOM with 'Controller As' syntax (adapter='ctrl.adapter')
var controllerAsName = undefined;
var dotIndex = target.indexOf('.');
if (dotIndex > 0) {
controllerAsName = target.substr(0, dotIndex);
parseController(controllerAsName, false);
}
}
assign = $parse(target).assign;
}
return function (value) {
if (self !== value) // just to avoid injecting adapter reference in the adapter itself. Kludgy, I know.
self[attribute] = value;
if (assign) assign(scope, value);
};
}
function applyUpdate(wrapper, newItems) {
if (!angular.isArray(newItems)) {
return;
}
var keepIt = undefined;
var pos = buffer.indexOf(wrapper) + 1;
newItems.reverse().forEach(function (newItem) {
if (newItem === wrapper.item) {
keepIt = true;
pos--;
} else {
buffer.insert(pos, newItem);
}
});
if (!keepIt) {
wrapper.op = 'remove';
}
}
}
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 buffer = new Buffer(bufferSize);
var viewport = new Viewport(buffer, element, viewportController, padding);
var adapter = new Adapter($attr, viewport, buffer, adjustBuffer, element);
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);
};
adapter.reload = reload;
/**
* 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;
}
});
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 = undefined;
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();
}
}
}
}
}]);
}());
/***/ }
/******/ ]);
//# sourceMappingURL=ui-scroll.js.map
/*!
* angular-ui-scroll
* https://github.com/angular-ui/ui-scroll.git
* Version: 1.5.2 -- 2016-11-18T00:26:15.332Z
* angular-ui-scroll (compressed)
* https://github.com/angular-ui/ui-scroll
* Version: 1.6.0 -- 2017-02-04T09:24:38.215Z
* License: MIT
*/
!function(){"use strict";var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol?"symbol":typeof a};angular.module("ui.scroll",[]).directive("uiScrollViewport",function(){return{restrict:"A",controller:["$log","$scope","$element",function(a,b,c){var d=this;d.container=c,d.viewport=c,angular.forEach(c.children(),function(a){"tbody"===a.tagName.toLowerCase()&&(d.viewport=angular.element(a))})}]}}).directive("uiScroll",["$log","$injector","$rootScope","$timeout","$q","$parse",function(b,c,d,e,f,g){function h(a,b){return b.after(a),[]}function i(a){return a.element.remove(),a.scope.$destroy(),[]}function j(b,c){if(!p)return h(b,c);if(q){var d=function(){var a=f.defer();return p.enter(b,null,c,function(){return a.resolve()}),{v:[a.promise]}}();if("object"===("undefined"==typeof d?"undefined":a(d)))return d.v}return[p.enter(b,null,c)]}function k(b){if(!p)return i(b);if(q){var c=function(){var a=f.defer();return p.leave(b.element,function(){return b.scope.$destroy(),a.resolve()}),{v:[a.promise]}}();if("object"===("undefined"==typeof c?"undefined":a(c)))return c.v}return[p.leave(b.element).then(function(){return b.scope.$destroy()})]}function l(a){var b=Object.create(Array.prototype);return angular.extend(b,{size:a,reset:function(a){b.remove(0,b.length),b.eof=!1,b.bof=!1,b.first=a,b.next=a,b.minIndex=a,b.maxIndex=a,b.minIndexUser=null,b.maxIndexUser=null},append:function(a){a.forEach(function(a){++b.next,b.insert("append",a)}),b.maxIndex=b.eof?b.next-1:Math.max(b.next-1,b.maxIndex)},prepend:function(a){a.reverse().forEach(function(a){--b.first,b.insert("prepend",a)}),b.minIndex=b.bof?b.minIndex=b.first:Math.min(b.first,b.minIndex)},insert:function(a,c){var d={item:c};if(a%1===0)d.op="insert",b.splice(a,0,d);else switch(d.op=a,a){case"append":b.push(d);break;case"prepend":b.unshift(d)}},remove:function(a,c){if(angular.isNumber(a)){for(var d=a;c>d;d++)i(b[d]);return b.splice(a,c-a)}return b.splice(b.indexOf(a),1),k(a)},effectiveHeight:function(a){if(!a.length)return 0;var b=Number.MAX_VALUE,c=Number.MIN_VALUE;return a.forEach(function(a){a.element[0].offsetParent&&(b=Math.min(b,a.element.offset().top),c=Math.max(c,a.element.offset().top+a.element.outerHeight(!0)))}),Math.max(0,c-b)}}),b}function m(a,b,c,d){function e(){var a=Object.create(Array.prototype);return angular.extend(a,{add:function(b){for(var c=a.length-1;c>=0;c--)if(a[c].index===b.scope.$index)return void(a[c].height=b.element.outerHeight());a.push({index:b.scope.$index,height:b.element.outerHeight()})},clear:function(){a.length=0}}),a}function f(a){var b=void 0;switch(a.tagName){case"dl":throw new Error("ui-scroll directive does not support <"+a.tagName+"> as a repeating tag: "+a.outerHTML);case"tr":var c=angular.element("<table><tr><td><div></div></td></tr></table>");b=c.find("tr");break;case"li":b=angular.element("<li></li>");break;default:b=angular.element("<div></div>")}return b.cache=new e,b}function g(){return l.outerHeight()*d}var i=void 0,k=void 0,l=c&&c.viewport?c.viewport:angular.element(window),m=c&&c.container?c.container:void 0;return l.css({"overflow-y":"auto",display:"block"}),angular.extend(l,{createPaddingElements:function(a){i=new f(a),k=new f(a),b.before(i),b.after(k)},applyContainerStyle:function(){m&&m!==l&&l.css("height",window.getComputedStyle(m[0]).height)},bottomDataPos:function(){var a=l[0].scrollHeight;return a=null!=a?a:l[0].document.documentElement.scrollHeight,a-k.height()},topDataPos:function(){return i.height()},bottomVisiblePos:function(){return l.scrollTop()+l.outerHeight()},topVisiblePos:function(){return l.scrollTop()},insertElement:function(a,b){return h(a,b||i)},insertElementAnimated:function(a,b){return j(a,b||i)},shouldLoadBottom:function(){return!a.eof&&l.bottomDataPos()<l.bottomVisiblePos()+g()},clipBottom:function(){for(var b=0,c=0,d=0,e=l.bottomDataPos()-l.bottomVisiblePos()-g(),f=a.length-1;f>=0&&(d=a[f].element.outerHeight(!0),!(c+d>e));f--)k.cache.add(a[f]),c+=d,b++;b>0&&(a.eof=!1,a.remove(a.length-b,a.length),a.next-=b,l.adjustPadding())},shouldLoadTop:function(){return!a.bof&&l.topDataPos()>l.topVisiblePos()-g()},clipTop:function(){for(var b=0,c=0,d=0,e=l.topVisiblePos()-l.topDataPos()-g(),f=0;f<a.length&&(d=a[f].element.outerHeight(!0),!(c+d>e));f++)i.cache.add(a[f]),c+=d,b++;b>0&&(i.height(i.height()+c),a.bof=!1,a.remove(0,b),a.first+=b)},adjustPadding:function(){if(a.length){var b=i.cache.reduce(function(b,c){return b+(c.index<a.first?c.height:0)},0),c=k.cache.reduce(function(b,c){return b+(c.index>=a.next?c.height:0)},0),d=a.reduce(function(a,b){return a+b.element.outerHeight(!0)},0),e=(d+b+c)/(a.maxIndex-a.minIndex+1),f=null!==a.minIndexUser&&a.minIndex>a.minIndexUser,g=null!==a.maxIndexUser&&a.maxIndex<a.maxIndexUser,h=f?(a.minIndex-a.minIndexUser)*e:0,j=g?(a.maxIndexUser-a.maxIndex)*e:0;i.height(b+h),k.height(c+j)}},adjustScrollTopAfterMinIndexSet:function(b){if(null!==a.minIndexUser&&a.minIndex>a.minIndexUser){var c=i.height()-b;l.scrollTop(l.scrollTop()+c)}},adjustScrollTopAfterPrepend:function(b){if(b.prepended.length){var c=a.effectiveHeight(b.prepended),d=i.height()-c;d>=0?i.height(d):(i.height(0),l.scrollTop(l.scrollTop()-d))}},resetTopPadding:function(){i.height(0),i.cache.clear()},resetBottomPadding:function(){k.height(0),k.cache.clear()}}),l}function n(a,b,c,e,f){function h(b){var c=a[b],d=j,e=void 0;if(c){var h=c.match(/^(\S+)(?:\s+on\s+(\w(?:\w|\d)*))?/);if(!h)throw new Error("Expected injection expression in form of 'target' or 'target on controller' but got '"+c+"'");var i=h[1],k=h[2],m=function(a,b){for(var c=f;c.length;){var e=c.scope(),g=(c.attr("ng-controller")||"").match(/(\w(?:\w|\d)*)(?:\s+as\s+(\w(?:\w|\d)*))?/);if(g&&g[b?1:2]===a)return d=e,!0;if(!b&&e&&e.hasOwnProperty(a)&&Object.getPrototypeOf(e[a]).constructor.hasOwnProperty("$inject"))return d=e,!0;c=c.parent()}};if(k){if(d=null,m(k,!0),!d)throw new Error("Failed to locate target controller '"+k+"' to inject '"+i+"'")}else{var n=void 0,o=i.indexOf(".");o>0&&(n=i.substr(0,o),m(n,!1))}e=g(i).assign}return function(a){l!==a&&(l[b]=a),e&&e(d,a)}}function i(a,b){if(angular.isArray(b)){var d=void 0,e=c.indexOf(a)+1;b.reverse().forEach(function(b){b===a.item?(d=!0,e--):c.insert(e,b)}),d||(a.op="remove")}}var j=b.scope()||d,k=!1,l=this;h("adapter")(l);var m=h("topVisible"),n=h("topVisibleElement"),o=h("topVisibleScope"),p=h("isLoading");Object.defineProperty(this,"disabled",{get:function(){return k},set:function(a){return(k=a)?null:e()}}),this.isLoading=!1,this.isBOF=function(){return c.bof},this.isEOF=function(){return c.eof},this.applyUpdates=function(a,b){if(angular.isFunction(a))c.slice(0).forEach(function(b){i(b,a(b.item,b.scope,b.element))});else{if(a%1!==0)throw new Error("applyUpdates - "+a+" is not a valid index");var d=a-c.first;d>=0&&d<c.length&&i(c[d],b)}e()},this.append=function(a){c.append(a),e()},this.prepend=function(a){c.prepend(a),e()},this.loading=function(a){p(a)},this.calculateProperties=function(){for(var a=void 0,d=void 0,e=void 0,f=void 0,g=void 0,h=0,i=0;i<c.length;i++){if(a=c[i],e=a.element.offset().top,f=g!==e,g=e,f&&(d=a.element.outerHeight(!0)),!(f&&b.topDataPos()+h+d<=b.topVisiblePos())){f&&(m(a.item),n(a.element),o(a.scope));break}h+=d}}}function o(a,b,h,i,j){function k(b,c){var d=g(b)(a);return isNaN(d)?c:d}function o(a,b,c){var d=Object.getOwnPropertyDescriptor(a,b);d&&(d.set||d.get)||Object.defineProperty(a,b,{set:function(a){X[b]=a,e(function(){if(T[c]=a,!S.length){var d=U.topDataPos();U.adjustPadding(),"minIndex"===b&&U.adjustScrollTopAfterMinIndexSet(d)}})},get:function(){return X[b]}})}function p(b){return b&&b!==R||a.$$destroyed}function q(){U.bind("resize",D),U.bind("scroll",D)}function r(){U.unbind("resize",D),U.unbind("scroll",D)}function s(){U.resetTopPadding(),U.resetBottomPadding(),arguments.length&&(Q=arguments[0]),T.reset(Q),A()}function t(a){return a.element.height()&&a.element[0].offsetParent}function u(a){t(a)&&(T.forEach(function(a){angular.isFunction(a.unregisterVisibilityWatcher)&&(a.unregisterVisibilityWatcher(),delete a.unregisterVisibilityWatcher)}),A())}function v(a,b){w(a,b,U.insertElement),t(a)||(a.unregisterVisibilityWatcher=a.scope.$watch(function(){return u(a)})),a.element.addClass("ng-hide")}function w(a,b,c){var d=void 0,e=b>0?T[b-1].element:void 0;return j(function(b,f){d=c(b,e),a.element=b,a.scope=f,f[L]=a.item}),V.transform&&V.transform(a.scope,a.element),d}function x(){var a=[],b=[],c=[],d=[];return T.forEach(function(e,f){switch(e.op){case"prepend":b.unshift(e);break;case"append":v(e,f),e.op="none",d.push(e);break;case"insert":a=a.concat(w(e,f,U.insertElementAnimated)),e.op="none",d.push(e);break;case"remove":c.push(e)}}),c.forEach(function(b){return a=a.concat(T.remove(b))}),b.length&&b.forEach(function(a){v(a),a.op="none"}),T.forEach(function(a,b){return a.scope.$index=T.first+b}),{prepended:b,removed:c,inserted:d,animated:a}}function y(a,b){b.animated.length?f.all(b.animated).then(function(){U.adjustPadding(),A(a)}):U.adjustPadding()}function z(a,b){U.shouldLoadBottom()?(!b||T.effectiveHeight(b.inserted)>0)&&1===S.push(!0)&&(C(a),V.loading(!0)):U.shouldLoadTop()&&(!b||T.effectiveHeight(b.prepended)>0||S[0])&&1===S.push(!1)&&(C(a),V.loading(!0))}function A(a){a||(S=[],a=++R);var b=x();e(function(){b.inserted.forEach(function(a){return a.element.removeClass("ng-hide")}),b.prepended.forEach(function(a){return a.element.removeClass("ng-hide")}),p(a)||(y(a,b),z(a),S.length||V.calculateProperties())})}function B(a){var b=x();e(function(){b.inserted.forEach(function(a){return a.element.removeClass("ng-hide")}),b.prepended.forEach(function(a){return a.element.removeClass("ng-hide")}),U.adjustScrollTopAfterPrepend(b),p(a)||(y(a,b),z(a,b),S.shift(),S.length?C(a):(V.loading(!1),q(),V.calculateProperties()))})}function C(a){S[0]?T.length&&!U.shouldLoadBottom()?B(a):Y(function(b){p(a)||(b.length<O&&(T.eof=!0),b.length>0&&(U.clipTop(),T.append(b)),B(a))}):T.length&&!U.shouldLoadTop()?B(a):Z(function(b){p(a)||(b.length<O&&(T.bof=!0),b.length>0&&(T.length&&U.clipBottom(),T.prepend(b)),B(a))})}function D(){d.$$phase||V.isLoading||V.disabled||(z(R),S.length?r():(V.calculateProperties(),a.$apply()))}function E(a){if(!V.disabled){var b=U[0].scrollTop,c=U[0].scrollHeight-U[0].clientHeight;(0===b&&!T.bof||b===c&&!T.eof)&&a.preventDefault()}}var F=h.uiScroll.match(/^\s*(\w+)\s+in\s+([(\w|\$)\.]+)\s*$/);if(!F)throw new Error("Expected uiScroll in form of '_item_ in _datasource_' but got '"+h.uiScroll+"'");var G=3,H=10,I=.3,J=.5,K=null,L=F[1],M=F[2],N=i[0],O=Math.max(G,k(h.bufferSize,H)),P=Math.max(I,k(h.padding,J)),Q=k(h.startIndex,1),R=0,S=[],T=new l(O),U=new m(T,b,N,P),V=new n(h,U,T,A,b);N&&(N.adapter=V);var W=function(){return angular.isObject(K)&&angular.isFunction(K.get)};if(K=g(M)(a),!W()&&(K=c.get(M),!W()))throw new Error(M+" is not a valid datasource");var X={};o(K,"minIndex","minIndexUser"),o(K,"maxIndex","maxIndexUser");var Y=2!==K.get.length?function(a){return K.get(T.next,O,a)}:function(a){K.get({index:T.next,append:T.length?T[T.length-1].item:void 0,count:O},a)},Z=2!==K.get.length?function(a){return K.get(T.first-O,O,a)}:function(a){K.get({index:T.first-O,prepend:T.length?T[0].item:void 0,count:O},a)};V.reload=s,j(function(a,b){U.createPaddingElements(a[0]),b.$destroy(),a.remove()}),a.$on("$destroy",function(){r(),U.unbind("mousewheel",E)}),U.bind("mousewheel",E),e(function(){U.applyContainerStyle(),s()})}var p=c.has&&c.has("$animate")?c.get("$animate"):null,q=1===angular.version.major&&angular.version.minor<3;return{require:["?^^uiScrollViewport"],restrict:"A",transclude:"element",priority:1e3,terminal:!0,link:o}}])}();
!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),h=r(d);angular.module("ui.scroll",[]).service("jqLiteExtras",function(){return new o.default}).run(["jqLiteExtras",function(e){return window.jQuery?null:e.registerFor(angular.element)}]).directive("uiScrollViewport",function(){return{restrict:"A",controller:["$scope","$element",function(e,t){var n=this;return this.container=t,this.viewport=t,angular.forEach(t.children(),function(e){"tbody"===e.tagName.toLowerCase()&&(n.viewport=angular.element(e))}),this}]}}).directive("uiScroll",["$log","$injector","$rootScope","$timeout","$q","$parse",function(e,t,n,r,i,o){function a(e,a,l,c,d){function p(t,n){var r=o(t)(e);return isNaN(r)?n:r}function m(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 g(t){return t&&t!==q||e.$$destroyed}function v(){Y.bind("resize",L),Y.bind("scroll",L)}function b(){Y.unbind("resize",L),Y.unbind("scroll",L)}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)}),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[C]=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 I(e,t){Y.shouldLoadBottom()?(!t||X.effectiveHeight(t.inserted)>0)&&1===z.push(!0)&&(S(e),Q.loading(!0)):Y.shouldLoadTop()&&(!t||X.effectiveHeight(t.prepended)>0||z[0])&&1===z.push(!1)&&(S(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")}),g(e)||(j(e,t),I(e),z.length||Q.calculateProperties())})}function O(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),g(e)||(j(e,t),I(e,t),z.shift(),z.length?S(e):(Q.loading(!1),v(),Q.calculateProperties()))})}function S(e){z[0]?X.length&&!Y.shouldLoadBottom()?O(e):K(function(t){g(e)||(t.length<F&&(X.eof=!0),t.length>0&&(Y.clipTop(),X.append(t)),O(e))}):X.length&&!Y.shouldLoadTop()?O(e):Z(function(t){g(e)||(t.length<F&&(X.bof=!0),t.length>0&&(X.length&&Y.clipBottom(),X.prepend(t)),O(e))})}function L(){n.$$phase||Q.isLoading||Q.disabled||(I(q),z.length?b():(Q.calculateProperties(),e.$apply()))}function _(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 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 H=3,M=10,V=.3,k=.5,U=null,C=A[1],D=A[2],B=c[0],F=Math.max(H,p(l.bufferSize,M)),N=Math.max(V,p(l.padding,k)),W=p(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,B,N),Q=new h.default(n,o,l,Y,X,T,a);B&&(B.adapter=Q);var G=function(){return angular.isObject(U)&&angular.isFunction(U.get)};if(U=o(D)(e),!G()&&(U=t.get(D),!G()))throw new Error(D+" is not a valid datasource");var J={};m(U,"minIndex","minIndexUser"),m(U,"maxIndex","maxIndexUser");var K=2!==U.get.length?function(e){return U.get(X.next,F,e)}:function(e){U.get({index:X.next,append:X.length?X[X.length-1].item:void 0,count:F},e)},Z=2!==U.get.length?function(e){return U.get(X.first-F,F,e)}:function(e){U.get({index:X.first-F,prepend:X.length?X[0].item:void 0,count:F},e)};Q.reload=y,d(function(e,t){Y.createPaddingElements(e[0]),t.$destroy(),e.remove()}),e.$on("$destroy",function(){b(),Y.unbind("mousewheel",_)}),Y.bind("mousewheel",_),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,h=void 0,p=void 0,m=void 0,g=void 0,v=void 0;if(l(e))return n=document.documentElement[{height:"clientHeight",width:"clientWidth"}[t]],{base:n,padding:0,border:0,margin:0};var b=r({width:[e.offsetWidth,"Left","Right"],height:[e.offsetHeight,"Top","Bottom"]}[t],3);return n=b[0],d=b[1],h=b[2],f=u(e),g=o(e,f["padding"+d])||0,v=o(e,f["padding"+h])||0,i=o(e,f["border"+d+"Width"])||0,a=o(e,f["border"+h+"Width"])||0,s=f["margin"+d],c=f["margin"+h],p=o(e,s)||0,m=o(e,c)||0,{base:n,padding:g+v,border:i+a,margin:p+m}}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){function o(){return s.outerHeight()*i}var u=null,l=null,s=r&&r.viewport?r.viewport:angular.element(window),c=r&&r.container?r.container:void 0;return s.css({"overflow-y":"auto",display:"block"}),angular.extend(s,{createPaddingElements:function(e){u=new a.default(e),l=new a.default(e),n.before(u),n.after(l)},applyContainerStyle:function(){c&&c!==s&&s.css("height",window.getComputedStyle(c[0]).height)},bottomDataPos:function(){var e=s[0].scrollHeight;return e=null!=e?e:s[0].document.documentElement.scrollHeight,e-l.height()},topDataPos:function(){return u.height()},bottomVisiblePos:function(){return s.scrollTop()+s.outerHeight()},topVisiblePos:function(){return s.scrollTop()},insertElement:function(t,n){return e.insertElement(t,n||u)},insertElementAnimated:function(t,n){return e.insertElementAnimated(t,n||u)},shouldLoadBottom:function(){return!t.eof&&s.bottomDataPos()<s.bottomVisiblePos()+o()},clipBottom:function(){for(var e=0,n=0,r=0,i=s.bottomDataPos()-s.bottomVisiblePos()-o(),a=t.length-1;a>=0&&(r=t[a].element.outerHeight(!0),!(n+r>i));a--)l.cache.add(t[a]),n+=r,e++;e>0&&(t.eof=!1,t.remove(t.length-e,t.length),t.next-=e,s.adjustPadding())},shouldLoadTop:function(){return!t.bof&&s.topDataPos()>s.topVisiblePos()-o()},clipTop:function(){for(var e=0,n=0,r=0,i=s.topVisiblePos()-s.topDataPos()-o(),a=0;a<t.length&&(r=t[a].element.outerHeight(!0),!(n+r>i));a++)u.cache.add(t[a]),n+=r,e++;e>0&&(u.height(u.height()+n),t.bof=!1,t.remove(0,e),t.first+=e)},adjustPadding:function(){if(t.length){var e=u.cache.reduce(function(e,n){return e+(n.index<t.first?n.height:0)},0),n=l.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,s=o?(t.minIndex-t.minIndexUser)*i:0,c=a?(t.maxIndexUser-t.maxIndex)*i:0;u.height(e+s),l.height(n+c)}},adjustScrollTopAfterMinIndexSet:function(e){if(null!==t.minIndexUser&&t.minIndex>t.minIndexUser){var n=u.height()-e;s.scrollTop(s.scrollTop()+n)}},adjustScrollTopAfterPrepend:function(e){if(e.prepended.length){var n=t.effectiveHeight(e.prepended),r=u.height()-n;r>=0?u.height(r):(u.height(0),s.scrollTop(s.scrollTop()-r))}},resetTopPadding:function(){u.height(0),u.cache.clear()},resetBottomPadding:function(){l.height(0),l.cache.clear()}}),s}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,n,r,i,o,a){function u(e){var r=n[e],i=s,o=void 0;if(r){var u=r.match(/^(\S+)(?:\s+on\s+(\w(?:\w|\d)*))?/);if(!u)throw new Error("Expected injection expression in form of 'target' or 'target on controller' but got '"+r+"'");var l=u[1],c=u[2],d=function(e,t){for(var n=a;n.length;){var r=n.scope(),o=(n.attr("ng-controller")||"").match(/(\w(?:\w|\d)*)(?:\s+as\s+(\w(?:\w|\d)*))?/);if(o&&o[t?1:2]===e)return i=r,!0;if(!t&&r&&r.hasOwnProperty(e)&&Object.getPrototypeOf(r[e]).constructor.hasOwnProperty("$inject"))return i=r,!0;n=n.parent()}};if(c){if(i=null,d(c,!0),!i)throw new Error("Failed to locate target controller '"+c+"' to inject '"+l+"'")}else{var h=void 0,p=l.indexOf(".");p>0&&(h=l.substr(0,p),d(h,!1))}o=t(l).assign}return function(t){f!==t&&(f[e]=t),o&&o(i,t)}}function l(e,t){if(angular.isArray(t)){var n=void 0,r=i.indexOf(e)+1;t.reverse().forEach(function(t){t===e.item?(n=!0,r--):i.insert(r,t)}),n||(e.op="remove")}}var s=r.scope()||e,c=!1,f=this;u("adapter")(f);var d=u("topVisible"),h=u("topVisibleElement"),p=u("topVisibleScope"),m=u("isLoading");Object.defineProperty(this,"disabled",{get:function(){return c},set:function(e){return(c=e)?null:o()}}),this.isLoading=!1,this.isBOF=function(){return i.bof},this.isEOF=function(){return i.eof},this.isEmpty=function(){return!i.length},this.applyUpdates=function(e,t){if(angular.isFunction(e))i.slice(0).forEach(function(t){l(t,e(t.item,t.scope,t.element))});else{if(e%1!==0)throw new Error("applyUpdates - "+e+" is not a valid index");var n=e-i.first;n>=0&&n<i.length&&l(i[n],t)}o()},this.append=function(e){i.append(e),o()},this.prepend=function(e){i.prepend(e),o()},this.loading=function(e){m(e)},this.calculateProperties=function(){for(var e=void 0,t=void 0,n=void 0,o=void 0,a=null,u=0,l=0;l<i.length;l++){if(e=i[l],n=e.element.offset().top,o=a!==n,a=n,o&&(t=e.element.outerHeight(!0)),!(o&&r.topDataPos()+u+t<=r.topVisiblePos())){o&&(d(e.item),h(e.element),p(e.scope));break}u+=t}}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n}]);
//# sourceMappingURL=ui-scroll.min.js.map
{
"name": "angular-ui-scroll",
"description": "two way infinite scroll",
"version": "1.5.2",
"description": "AngularJS infinite scrolling module",
"version": "1.6.0",
"src": "./src/",

@@ -20,28 +20,29 @@ "public": "./public/",

},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/angular-ui/ui-scroll/blob/master/LICENSE-MIT"
}
],
"license": "MIT",
"scripts": {
"start": "grunt server",
"build": "grunt build",
"test": "grunt test"
},
"devDependencies": {
"babel-preset-es2015": "^6.5.0",
"express": "~3.4.8",
"grunt": "~0.4.5",
"grunt-babel": "^6.0.0",
"grunt-contrib-concat": "~0.5.1",
"grunt-contrib-connect": "~0.10.1",
"grunt-contrib-jshint": "~1.0.0",
"grunt-contrib-uglify": "0.9.1",
"grunt-contrib-watch": "~0.6.1",
"grunt-karma": "~0.12.0",
"jasmine-core": "^2.4.1",
"karma": "~0.13",
"karma-chrome-launcher": "~0.2",
"karma-firefox-launcher": "~0.1",
"karma-ie-launcher": "~0.2",
"karma-jasmine": "~0.3"
"babel-core": "^6.22.1",
"babel-loader": "^6.2.10",
"babel-preset-es2015": "^6.22.0",
"clean-webpack-plugin": "^0.1.15",
"express": "^4.14.0",
"grunt": "^1.0.1",
"grunt-contrib-clean": "^1.0.0",
"grunt-contrib-connect": "^1.0.2",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-jshint": "^1.1.0",
"grunt-contrib-watch": "^1.0.0",
"grunt-karma": "^2.0.0",
"grunt-webpack": "^1.0.18",
"jasmine-core": "^2.5.2",
"karma": "^1.4.0",
"karma-chrome-launcher": "^2.0.0",
"karma-firefox-launcher": "^1.0.0",
"karma-ie-launcher": "^1.0.0",
"karma-jasmine": "^1.1.0",
"webpack": "^1.14.0"
},

@@ -55,2 +56,4 @@ "keywords": [

"ui-scroll",
"angular-ui-scroll",
"unlimited",
"infinite",

@@ -57,0 +60,0 @@ "live",

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

The common way to present to the user a list of data elements of undefined length is to start with a small portion at the top of the
list - just enough to fill the space on the page. Additional rows are appended to the bottom of the list as the user scrolls down the list.
### UI Scroll - [AngularJS](http://angularjs.org/) directive to provide infinite scroll over a limited element buffer
[![Build Status](https://travis-ci.org/angular-ui/ui-scroll.svg?branch=master)](https://travis-ci.org/angular-ui/ui-scroll)
[![npm version](https://badge.fury.io/js/angular-ui-scroll.svg)](http://badge.fury.io/js/angular-ui-scroll)
[![Bower version](https://badge.fury.io/bo/angular-ui-scroll.svg)](http://badge.fury.io/bo/angular-ui-scroll)
[![Join the chat at https://gitter.im/angular-ui/ui-scroll](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/angular-ui/ui-scroll?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
### Quick links
- [Introduction](#introduction)
- [Why?](#why)
- [How it works](#how-it-works)
- [Basic usage](#basic-usage)
- [Examples](#examples)
- [Install and connect](#install-and-connect)
- [uiScroll directive](#uiscroll-directive)
- [Parametrs](#parametrs)
- [Datasource](#datasource)
- [Adapter](#adapter)
- [uiScrollViewport directive](#uiscrollviewport-directive)
- [jqLiteExtras service](#jqliteextras-service)
- [uiScrollTh and uiScrollTd](#uiscrollth-and-uiscrolltd-directives)
- [GridAdapter](#gridadapter)
- [Development](#development)
- [Change log](#change-log)
-------------------
## Introduction
### Why?
The common way to present to the user a list of data elements of undefined length is to start with a small portion at the top of
the list - just enough to fill the space on the page. Additional rows are appended to the bottom of the list as the user scrolls
down the list.
The problem with this approach is that even though rows at the top of the list become invisible as they scroll out of the view,

@@ -10,64 +47,103 @@ they are still a part of the page and still consume resources. As the user scrolls down the list grows and the web app slows down.

uiScroll directive
-------------------
[![Build Status](https://travis-ci.org/angular-ui/ui-scroll.svg?branch=master)](https://travis-ci.org/angular-ui/ui-scroll) [![npm version](https://badge.fury.io/js/angular-ui-scroll.svg)](http://badge.fury.io/js/angular-ui-scroll) [![Bower version](https://badge.fury.io/bo/angular-ui-scroll.svg)](http://badge.fury.io/bo/angular-ui-scroll) [![Join the chat at https://gitter.im/angular-ui/ui-scroll](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/angular-ui/ui-scroll?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
### How it works
**uiScroll** directive solves this problem by dynamically destroying elements as they become invisible and recreating
The uiScroll directive solves the problem just described by dynamically destroying elements as they become invisible and recreating
them if they become visible again.
Look [here](https://github.com/Hill30/NGScroller) for older versions.
The uiScroll directive is similar to the ngRepeat. Like the ngRepeat, uiScroll directive instantiates a template once per item from a
collection. Each template instance gets its own scope, where the given loop variable is set to the current collection item. The
collection content is provided by the datasource.
###Description
The directive is asking the datasource for data to build and render elements until it has enough elements to fill out the viewport.
It will start retrieving new data for new elements again if the user scrolls up/down to the edge of visible element list.
The uiScroll directive is similar to the ngRepeat. Like the ngRepeat, uiScroll directive instantiates a template once per item from a collection.
Each template instance gets its own scope, where the given loop variable is set to the current collection item. The collection content is provided by the datasource. The datasource name is specified in the scroll_expression. Starting with v 1.2.0 uiScroll supports animation.
One of the most important use cases for the directive is using it to build scrollable grids. There is no magic in doing it - all what's involved is putting together the HTML to be repeated and there are numerous ways to do it. It is a bit trickier if you want to give your user ability to adjust the grid (column widts, column order, etc.) as well as save/restore the adjustments. [uiScrollTd](#uiscrollth-and-uiscrolltd-directives) and [uiScrollTh](#uiscrollth-and-uiscrolltd-directives) companion directives were created to simplify this task.
![](https://raw.githubusercontent.com/angular-ui/ui-scroll/modules/demo/ui-scroll-demo.gif)
### Dependencies
To use the directive make sure the dist/ui-scroll.js is loaded in your page. You also have to include module name 'ui.scroll' on the list of your application module dependencies. The directive supports angular version 1.2 or later. Earlier versions of angular are no longer supported.
### Basic usage
The code in this file relies on a few DOM element methods of jQuery which are currently not implemented in jQlite, namely
* before(elem)
* height() and height(value)
* outerHeight() and outerHeight(true)
* scrollTop() and scrollTop(value)
* offset()
```html
<ANY ui-scroll="{scroll_expression}" buffer-size="value" ... >
...
</ANY>
```
Listing `ANY` for the tag, the directive can be applied to, stretches the truth - a little bit. The directive works well with majority
of the 'usual' tags - divs, spans, a, inputs, etc. For all of them the viewport should be a div (unless it is the window). Some other
tags require special treatment. If the repeated tag is a li, it is best to use ul or ol as a viewport. For a tr as a repeated tag the
viewport has to be the table or tbody. dl as a repeated tag is not supported.
File dist/ui-scroll-jqlite.js houses implementations of the above methods and also has to be loaded in your page. Please note that the methods are implemented in a separate module
'ui.scroll.jqlite' and this name should also be included in the dependency list of the main module. The implementation currently supports missing methods
only as necessary for the directive. It is tested on IE8 and up as well as on the Chrome 28 and Firefox 20.
The viewport is an element representing the space where the items from the collection are to be shown. Unless specified explicitly with
the [uiScrollViewport](#uiscrollviewport-directive) directive, browser window will be used as the viewport.
This module is only necessary if you plan to use ui-scroll without jQuery. If full jQuery is loaded, uiScroll will use the jQuery implementatin of the above methods, the ui.scroll.jqlite implementation of them will be ignored.
If you plan to use ui-scroll over jQuery feel free to skip ui-scroll-jqlite.
_Important!_ The viewport height must be constrained. If the height of the viewport is not constrained
(style="height:auto") it will pull the entire content of the datasource and may throw an Error depending on the number of items
in the datasource. Even if it does not, using the directive this way does not provide any advantages over using ng-repeat, because
item template will be always instantiated for every item in the datasource.
###Usage
```html
<ANY ui-scroll="{scroll_expression}" buffer-size="value" padding="value" start-index="value" adapter="expression">
...
</ANY>
### Examples
We have built pull of examples covering a number of use-cases, showing various ways to use the ui-scroll directive. Each demo is
absolutely independent and has its own html-page and the javascript file with the same name and .js extension.
To run the examples use __[this link](http://rawgithub.com/angular-ui/ui-scroll/master/demo/index.html)__.
### Install and connect
To install the package via npm use
```
Listing `ANY` for the tag, the directive can be applied to, stretches the truth - a little bit. The directive works well with majority of
the 'usual' tags - divs, spans, a, inputs, etc. For all of them the viewport should be a div (unless it is the window). Some other tags
require special treatment. If the repeated tag is a li, it is best to use ul or ol as a viewport. For a tr as a repeated tag the
viewport has to be the table or tbody.
dl as a repeated tag is not supported.
npm install --save angular-ui-scroll
```
The viewport is an element representing the space where the items from the collection are to be shown. Unless specified explicitly with the [uiScrollViewport](#uiscrollviewport-directive) directive, browser window will be used as the viewport.
After installation, the ui-scroll distributive files will be available as
**Important: viewport height must be constrained.** The directive will stop asking the datasource for more elements only when it has enough
to fill out the viewport. If the height of the viewport is not constrained (style="height:auto") it will pull the entire content of the datasource
and may throw an Error depending on the number of items in the datasource. Even if it does not, using the directive this way does not provide any
advantages over using ng-repeat, because item template will be always instantiated for every item in the datasource.
```
<script src="node_modules/angular-ui-scroll/dist/ui-scroll.min.js">
<script src="node_modules/angular-ui-scroll/dist/ui-scroll-grid.min.js">
```
###Directive info
* This directive creates a new scope
* This directive executes at priority level 1000
There are also uncompressed versions (ui-scroll.js, ui-scroll-grid.js) and sourcemaps for all of js-files.
###Parameters
* **uiScroll – scroll expression** – The expression indicating how to enumerate a collection. Only one format is currently supported:
* **variable in datasource** – where variable is the user defined loop variable and datasource is the name of the data source to enumerate.
To use it in your angular-app you should add the module (modules)
```
angular.module('application', ['ui.scroll', 'ui.scroll.grid'])
```
Currently we have 2 regular modules which can be added to the angular-app you are developing.
- __ui.scroll__ module which has
- [uiScroll directive](#uiscroll-directive)
- [uiScrollViewport directive](#uiscrollviewport-directive)
- [jqLiteExtras service](#jqliteextras-service) (with runner)
- __ui.scroll.grid__ module which has
- [uiScrollTh directive](#uiscrollth-and-uiscrolltd-directives)
- [uiScrollTd directive](#uiscrollth-and-uiscrolltd-directives)
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.
-------------------
## uiScroll directive
```html
<div ui-scroll="item in myDatasource"
buffer-size="5"
padding="1"
start-index="100"
adapter="myAdapter"
>{{item}}</div>
```
### Parametrs
* **uiScroll – scroll expression** – The expression indicating how to enumerate a collection. Only one format is currently supported: `variable in datasource` – where variable is the user defined loop variable and datasource is the name of the data source to enumerate.
* **buffer-size - expression**, optional - number of items requested from the datasource in a single request. The default is 10 and the minimal value is 3

@@ -85,3 +161,3 @@ * **padding - expression**, optional - extra height added to the visible area for the purpose of determining when the items should be created/destroyed. The value is relative to the visible height of the area, the default is 0.5 and the minimal value is 0.3

The `expression` can be any angular expression (assignable expression where so specified). All expressions are evaluated once at the time when the scroller is initalized. Changes in the expresion value after scroller intialization will have no impact on the scroller behavior.
The `expression` can be any angular expression (assignable expression where so specified). All expressions are evaluated once at the time when the scroller is initialized. Changes in the expression value after scroller initialization will have no impact on the scroller behavior.

@@ -94,9 +170,14 @@ The assignable expressions will be used by scroller to inject the requested value into the target scope. The scope associated with the viewport (the element marked with the [uiScrollViewport](#uiscrollviewport-directive) directive) will be used as the target scope. If the viewport is not defined (window viewport), the $rootScope will be used as the target scope. Note that the nearest additional scope-wrapper (like ng-if directive set right on the viewport) makes this mechanism unusable. There are two options which help in this case:

###Data Source
### Datasource
Data source is an object to be used by the uiScroll directive to access the data.
The directive will locate the object using the provided data source name. It will first look for a property with the given name on its $scope.
If none found it will try to get an angular service with the provided name.
The directive will locate the object using the provided data source name. It will first look for a property with the given name on its
$scope ([here](https://github.com/angular-ui/ui-scroll/blob/master/demo/scopeDatasource) is the example of
scope-based datasource usage). If none found it will try to get an angular service with the provided name
([here](https://github.com/angular-ui/ui-scroll/blob/master/demo/serviceDatasource) is the example of
service-based datasource usage).
The data source object implements methods and properties to be used by the directive to access the data:
The data source object implements methods and properties to be used by the directive to access the data.

@@ -107,7 +188,6 @@ * Method `get`

or
get(index, count, success)
#### Description
this is a mandatory method used by the directive to retrieve the data.
This is a mandatory method used by the directive to retrieve the data.
#### Parameters

@@ -119,13 +199,14 @@ * **descriptor** is an object defining the portion of the dataset requested. The object will have 3 properties. Two of them named `index` and `count`. They have the same meaning as in the alternative signature when the parameters passed explicitly (see below). The third one will be named either `append` if the items will be appended to the last item in the buffer, or `prepend` if they are to be prepended to the first item in the buffer. The value of the property in either case will be the item the new items will be appended/prepended to. This is useful if it is easier to identify the items to be added based on the previously requested items rather than on the index. Keep in mind that in certain use cases (i.e. on initial load) the value of the append/prepend property can be undefined.

**Important:** Make sure to respect the `index` and `count` parameters of the request. The array passed to the success method should have
exactly `count` elements unless it hit eof/bof
_Important!_ Make sure to respect the `index` and `count` parameters of the request. The array passed to the success method should have
exactly `count` elements unless it hit eof/bof.
* Properties `minIndex` and `maxIndex`
#### Description
As the scroller recieves the items requested by the `get` method, the value of minimum and maximum values of the item index are placed in the `minIndex` and `maxIndex` properties respectively. The values of the properties are cumulative - the value of the `minIndex` will never increase, and the value of the `maxIndex` will never decrease - except the values are reset in response to a call to the adapter `reload` method. The values of the properties are used to maintain the appearance of the scroller scrollBar.
As the scroller receives the items requested by the `get` method, the value of minimum and maximum values of the item index are placed in the `minIndex` and `maxIndex` properties respectively. The values of the properties are cumulative - the value of the `minIndex` will never increase, and the value of the `maxIndex` will never decrease - except the values are reset in response to a call to the adapter `reload` method. The values of the properties are used to maintain the appearance of the scroller scrollBar.
Values of the properties can be assigned programmatically. If the range of the index values is known in advance, assigneing them programmatically would improve the usability of the scrollBar.
Values of the properties can be assigned programmatically. If the range of the index values is known in advance, assigning them programmatically would improve the usability of the scrollBar.
###Adapter
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. Adapter based API replaces old (undocumented) event based API introduced earlier for this purpose. The event based API is now deprecated and no longer supported.

@@ -135,9 +216,9 @@

* `isLoading` - a boolean value indicating whether there are any pending load requests.
* `topVisible` - a reference to the item currently in the topmost visible position.
* `topVisibleElement` - a reference to the DOM element currently in the topmost visible position.
* `topVisibleScope` - a reference to the scope created for the item currently in the topmost visible position.
* `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.
* `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.
Adapater object implements the following methods
Adapter object implements the following methods

@@ -148,4 +229,3 @@ * Method `isBOF`

#### Description
returns `true` if the first item of the dataset is already in the buffer. No further requests for preceding items will be issued, returns `false` otherwise.
Returns `true` if the first item of the dataset is already in the buffer. No further requests for preceding items will be issued, returns `false` otherwise.

@@ -156,5 +236,10 @@ * Method `isEOF`

#### Description
returns `true` if the last item of the dataset is already in the buffer. No further requests for tailing items will be issued, returns `false` otherwise,
Returns `true` if the last item of the dataset is already in the buffer. No further requests for tailing items will be issued, returns `false` otherwise.
* Method `isEmpty`
isEmpty()
Returns `true` if the dataset is empty and the internal buffer length = 0. Returns `false` otherwise. Mind that isEmpty() will return `true` during the **first** request is pending, so maybe it should be used together with `isLoading` property.
* Method `reload`

@@ -167,6 +252,5 @@

#### Description
Calling this method reinitializes and reloads the scroller content. `startIndex` is an integer indicating what item index the scroller will use to start the load process. The value of the argument replaces the value provided with the start-index attribute. Calling `reload()` is equivalent to calling `reload` method with current value of the `start-index` attribute .
Calling this method reinitializes and reloads the scroller content. `startIndex` is an integer indicating what item index the scroller will use to start the load process. The value of the argument replaces the value provided with the start-index attribute. Calling `reload()` is equivalent to calling `reload` method with current value of the `start-index` attribute.
**important: `startIndex` should fall within underlying datset boundaries** The scroller will request two batches of items one starting from the `startIndex` and another one preceding the first one (starting from `startIndex - bufferSize`). If both requests come back empty, the scroller will consider the dataset to be empty and will place no further data requests.
_Important!_ `startIndex` should fall within underlying datset boundaries. The scroller will request two batches of items one starting from the `startIndex` and another one preceding the first one (starting from `startIndex - bufferSize`). If both requests come back empty, the scroller will consider the dataset to be empty and will place no further data requests.

@@ -176,3 +260,3 @@ * Method `applyUpdates`

applyUpdates(index, newItems)
#### Description
Replaces the item in the buffer at the given index with the new items.

@@ -185,3 +269,2 @@ #### Parameters

#### Description
Updates scroller content as determined by the updater function

@@ -194,3 +277,3 @@ #### Parameters

append(newItems)
#### Description
Adds new items after the last item in the buffer.

@@ -203,3 +286,3 @@ #### Parameters

prepend(newItems)
#### Description
Adds new items before the first item in the buffer.

@@ -209,9 +292,9 @@ #### Parameters

####Manipulating the scroller content with adapter methods
#### Manipulating the scroller content with adapter methods
Adapter methods `applyUpdates`, `append` and `prepend` provide a way to update the scroller content without full reload of the content from the datasource. The updates are performed by changing the items in the scroller internal buffer after they are loaded from the datasource. Items in the buffer can be deleted or replaced with one or more items.
**Important: update datasource to match the scroller buffer content:** Keep in mind that the modifications made by the adapter methods are only applied to the content of the buffer. As the items in response to scrolling are pushed out of the buffer, the modifications are lost. It is your responsibility to ensure that as the scroller is scrolled back and a modified item is requested from the datasource again the values returned by the datasource would reflect the updated state. In other words you have to make sure that in addition to manipulating the scroller content you also apply the modifications to the dataset underlying the datasource.
_Important!_ Update datasource to match the scroller buffer content. Keep in mind that the modifications made by the adapter methods are only applied to the content of the buffer. As the items in response to scrolling are pushed out of the buffer, the modifications are lost. It is your responsibility to ensure that as the scroller is scrolled back and a modified item is requested from the datasource again the values returned by the datasource would reflect the updated state. In other words you have to make sure that in addition to manipulating the scroller content you also apply the modifications to the dataset underlying the datasource.
[Here](https://rawgit.com/angular-ui/ui-scroll/master/demo/append/append.html) is the example of such implementation.
###Animations
#### Animations
In the fashion similar to ngRepeat the following animations are supported:

@@ -223,9 +306,12 @@ * .enter - when a new item is added to the list

uiScrollViewport directive
-------------------
###Description
The uiScrollViewport directive marks a particular element as viewport for the uiScroll directive. If no parent of the uiScroll directive is
marked with uiScrollViewport directive, the browser window object will be used as viewport
## uiScrollViewport directive
The uiScrollViewport directive marks a particular element as viewport for the uiScroll directive.
If no parent of the uiScroll directive is marked with uiScrollViewport directive,
the browser window object will be used as viewport.
###Usage

@@ -239,12 +325,32 @@

uiScrollTh and uiScrollTd directives
-------------------
###Description
The uiScrollTh and uiScrollTd directives provide a way to build flexible dynamic grids. Handling of grid rows is done by the uiScroll directive itself. In addition to this uiScrollTh and uiScrollTd directive provide tools to programmatically change grid layout, inclduing applying styles to columns, changing column size and order, as well as saving the modifications to the layout and applying previosly saved layouts.
## jqLiteExtras service
This service implements some DOM element methods of jQuery which are currently not implemented in jqLite, namely
* before(elem)
* height() and height(value)
* outerHeight() and outerHeight(true)
* scrollTop() and scrollTop(value)
* offset()
These methods are being registered on angular.element during 'ui.scroll' module run automatically only if jQuery is not loaded.
It is so since ui-scroll v1.6.0. In previous versions there was a separate module 'ui.scroll.jqlite' which should have been
included in the dependency list of the main app module. So currently we leave 'ui.scroll.jqlite' module stub with no content
to provide full backward compatibility.
-------------------
## uiScrollTh and uiScrollTd directives
The uiScrollTh and uiScrollTd directives provide a way to build flexible dynamic grids. Handling of grid rows is done by the uiScroll directive itself. In addition to this uiScrollTh and uiScrollTd directive provide tools to programmatically change grid layout, including applying styles to columns, changing column size and order, as well as saving the modifications to the layout and applying previously saved layouts.
At this point the above functionality is supported only for table based scrollable grids.
###Usage
Here is the basic html template for scrollable grid using the uiScrollTh and uiScrollTd directives. Keep in mind that the height of the scroll viewport (in this case the `<TABLE>` tag) should be constrained. Also, make sure that the initial column widths are applied uniformly to both headers (`<TH>`) and cells (`<TD>`)
Here is the basic html template for scrollable grid using the uiScrollTh and uiScrollTd directives. Keep in mind that the height of the scroll viewport (in this case the `<TABLE>` tag) should be constrained. Also make sure that the initial column widths are applied uniformly to both headers (`<TH>`) and cells (`<TD>`)
```html

@@ -269,9 +375,8 @@ <TABLE ui-scroll-viewport class="grid">

### Dependencies
The grid directives have the same dependency requirements as the uiScroll directive itself. To use the directives make sure the `ui.scroll.grid` module is on the list of the module dependencies. Also you have to load the dist/ui-scroll-grid.js file in your page.
### Controlling scrollable grid with the GridAdapter
### GridAdapter
GridAdapter object (along with ColumnAdapter objects) provides methods and properties to be used to change the scrollable grid layout. A reference to this object is injected as a property named `gridAdapter`in the scroller adapter.
GridAdapter object (along with ColumnAdapter objects) provides methods and properties to be used to change the scrollable grid layout.
A reference to this object is injected as a property named `gridAdapter`in the scroller `adapter`.

@@ -286,3 +391,3 @@ `GridAdapter` object implements the following properties:

* Method `applyLayout(layout)` - restores scrollabel grid layout to the state as defined by the object passed as the parameter
* Method `columnFromPoint(x,y)` - if the coordinates belong to a scrollable grid column returns the appropriate ColumnAdapter object. Otherwise returns `undefined`.
* Method `columnFromPoint(x,y)` - if the coordinates belong to a scrollable grid column returns the appropriate ColumnAdapter object. Otherwise, returns `undefined`.

@@ -292,19 +397,69 @@ `ColumnAdapter` object implements the following methods:

* Method `css(name, value)` - sets the css property `name` to `value` for the column header as well as for the column cells.
* Method `moveBefore(column)` - moves the column in front of the column refrenced by the parameter. If the parameter is null the column will become the rightmost column.
* Method `moveBefore(column)` - moves the column in front of the column referenced by the parameter. If the parameter is null, the column will become the rightmost column.
###Examples
-------------------
Examples ([look here for sources](https://github.com/angular-ui/ui-scroll/tree/master/demo)) consist of several pages (.html files) showing various ways to use the ui-scroll directive. Each page relays on its own datasource service (called `datasource`) defined in the javascript file with the same name and .js extension.
I intentionally broke every rule of proper html/css structure (i.e. embedded styles). This is done to keep the html as bare bones as possible and leave
it to you to do it properly - whatever properly means in your book.
## Development
To run the examples use this [link](http://rawgithub.com/angular-ui/ui-scroll/master/demo/index.html)
Please feel free to make Pull Requests. Below is the information which could be useful for local developing and contributing.
###History
The ui-scroll sources are in [./src](https://github.com/angular-ui/ui-scroll/tree/master/src) folder. They could not be run as is
because of ES6 modules (since v1.6.0), they should be built. Build process includes jshint sources verification, webpack-based
distributive files forming and tests running.
Three npm scripts are available for developing.
__1__. To run dev-server use
```
npm start
```
This should start development server on 5005 port over the [./demo](https://github.com/angular-ui/ui-scroll/tree/master/demo) folder.
The middleware is configured to provide work with temporary distributive files (./temp) despite the direct links to public distributive
files (./dist). So the dist-folder should stay clear until the development is finished. Dev-server watches for the source codes (./src)
and automatically re-build temporary distributive files.
__2__. To run tests in keep-alive mode use
```
npm run test
```
This runs karma testing against temporary distributive files (./temp). We created a number of specifications which consist of more
than 160 tests. They are living at [./test](https://github.com/angular-ui/ui-scroll/tree/master/test) folder. Karma watches for temp
and test folders changes and automatically re-run tests.
__3__. To run full build use
```
npm run build
```
After developing and testing complete the build process should be run to
a) pass through jshint,
b) generate minified versions of distributive,
c) run tests with minified distributive files,
d) obtain all necessary files in [./dist](https://github.com/angular-ui/ui-scroll/tree/master/dist) folder.
PR should include source code (./scr) and tests (./test) changes and may not include public distributive (./dist) changes.
-------------------
## Change log
###v1.6.0
* Introduced ES6 modules in the source codes.
* Improved build process with Webpack.
* Added sourcemaps. Fixed dev-server.
* Removed 'ui.scroll.jqlite' module. Added jqLiteExtras service to 'ui.scroll' module.
* Significantly changed readme.
###v1.5.2
* Refactored assignable expressions and attributes scope bindings.
* Added new demos and tests. fixed IE compatibility.
* Added new demos and tests. Fixed IE compatibility.

@@ -321,3 +476,3 @@ ###v1.5.1

###v1.4.1
* Developed a new complex approach of paddings elements height calculation (see [details](https://github.com/angular-ui/ui-scroll/pull/77)).
* Developed a new complex approach of padding elements height calculation (see [details](https://github.com/angular-ui/ui-scroll/pull/77)).
* Added startIndex attribute.

@@ -324,0 +479,0 @@ * Changed clipTop/clipBottom methods logic.

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

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

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

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc