Viewing File: /usr/local/cpanel/3rdparty/share/angular-ui-scroll/1.6.1/dist/ui-scroll-grid.min.js

/*!
 * angular-ui-scroll (compressed)
 * https://github.com/angular-ui/ui-scroll
 * Version: 1.6.1 -- 2017-03-03T05:28:34.249Z
 * License: MIT
 */
!function(t){function n(o){if(r[o])return r[o].exports;var e=r[o]={exports:{},id:o,loaded:!1};return t[o].call(e.exports,e,e.exports,n),e.loaded=!0,e.exports}var r={};return n.m=t,n.c=r,n.p="",n(0)}([function(t,n){"use strict";angular.module("ui.scroll.grid",[]).directive("uiScrollTh",["$log","$timeout",function(t,n){function r(t){this.getLayout=function(){return t.getLayout()},this.applyLayout=function(n){return t.applyLayout(n)},this.columnFromPoint=function(n,r){return t.columnFromPoint(n,r)},Object.defineProperty(this,"columns",{get:function(){return t.getColumns()}})}function o(t,n){this.css=function(){var r=arguments[0],o=arguments[1];return 1==arguments.length?n.header.css(r):void(2==arguments.length&&(n.header.css(r,o),t.forEachRow(function(t){return t[n.id].css(r,o)}),n.css[r]=o))},this.moveBefore=function(r){return t.moveBefore(n,r)},this.exchangeWith=function(r){return t.exchangeWith(n,r)},Object.defineProperty(this,"columnId",{get:function(){return n.id}})}function e(t,n,r){function o(t,n,r){var o=t.offset();return!(n<o.left||o.left+t.outerWidth(!0)<n)&&!(r<o.top||o.top+t.outerHeight(!0)<r)}function e(t,n){t.detach(),n.before(t)}function i(t){var n=t.parent();t.detach(),n.append(t)}function u(t,n){t.removeAttr("style");for(var r in n)n.hasOwnProperty(r)&&t.css(r,n[r])}this.header=r,this.css={},this.mapTo=n.length,this.id=n.length,this.applyLayout=function(t){this.css=angular.extend({},t.css),this.mapTo=t.mapTo,u(this.header,this.css)},this.moveBefore=function(n){var o=this;n?(e(r,n.header),t.forEachRow(function(t){return e(t[o.id],t[n.id])})):(i(r),t.forEachRow(function(t){return i(t[o.id])}))},this.columnFromPoint=function(n,e){var i=this;if(o(r,n,e))return this;var u=null;return t.forEachRow(function(t){return u=o(t[i.id],n,e)?i:u}),u},this.applyCss=function(t){u(t,this.css)}}function i(t){function i(t){var n=t[0].parent(),r=[];t.forEach(function(n,o){c[o].applyCss(n),r[c[o].mapTo]=t[o],t[o].detach()}),r.forEach(function(t){return n.append(t)})}var u=this,c=[],a=new Map;n(function(){t.adapter.publicContext.gridAdapter=new r(u),t.adapter.transform=function(t,n){return i(a.get(t),n)}}),this.registerColumn=function(t){c.push(new e(this,c,t))},this.registerCell=function(t,n){var r=a.get(t);return r||(r=[],a.set(t,r)),!(r.length>=c.length)&&(r.push(n),!0)},this.unregisterCell=function(t,n){var r=a.get(t),o=r.indexOf(n);r.splice(o,1),r.length||a.delete(t)},this.forEachRow=function(t){a.forEach(t)},this.getColumns=function(){var t=this,n=[];return c.slice().sort(function(t,n){return t.mapTo-n.mapTo}).forEach(function(r){return n.push(new o(t,r))}),n},this.getLayout=function(){var t=[];return c.forEach(function(n,r){return t.push({index:r,css:angular.extend({},n.css),mapTo:n.mapTo})}),t},this.applyLayout=function(t){if(!t||t.length!=c.length)throw new Error("Failed to apply layout - number of layouts should match number of columns");t.forEach(function(t,n){return c[n].applyLayout(t)}),i(c.map(function(t){return t.header})),a.forEach(function(t){return i(t)})},this.moveBefore=function(t,n){var r=n;if(n%1!==0&&(r=n?c[n.columnId].mapTo:c.length),!(r<0||r>c.length)){var o=t.mapTo,e=null;r-=o<r?1:0,c.forEach(function(t){t.mapTo-=t.mapTo>o?1:0,t.mapTo+=t.mapTo>=r?1:0,e=t.mapTo===r+1?t:e}),t.mapTo=r,t.moveBefore(e)}},this.exchangeWith=function(t,n){n<0||n>=c.length||(c.find(function(t){return t.mapTo===n}).mapTo=t.mapTo,t.mapTo=n)},this.columnFromPoint=function(t,n){var r=c.find(function(r){return r.columnFromPoint(t,n)});return r?new o(this,r):void 0}}return{require:["^^uiScrollViewport"],restrict:"A",link:function(t,n,r,o){o[0].gridController=o[0].gridController||new i(o[0]),o[0].gridController.registerColumn(n)}}}]).directive("uiScrollTd",function(){return{require:["?^^uiScrollViewport"],restrict:"A",link:function(t,n,r,o){o[0]&&!function(){var r=o[0].gridController;r.registerCell(t,n)&&t.$on("$destroy",function(){return r.unregisterCell(t,n)})}()}}})}]);
//# sourceMappingURL=ui-scroll-grid.min.js.map
Back to Directory File Manager