nexus site path corrected
[portal.git] / ecomp-portal-FE / client / bower_components / angular-material / modules / js / gridList / gridList.min.js
1 /*!
2  * Angular Material Design
3  * https://github.com/angular/material
4  * @license MIT
5  * v0.9.8
6  */
7 !function(t,e,n){"use strict";function i(t,n,i,o){function a(r,a,u,s){function l(){for(var t in n.MEDIA)o(t),o.getQuery(n.MEDIA[t]).addListener(L);return o.watchResponsiveAttributes(["md-cols","md-row-height"],u,d)}function c(){s.layoutDelegate=e.noop,T();for(var t in n.MEDIA)o.getQuery(n.MEDIA[t]).removeListener(L)}function d(t){null==t?s.invalidateLayout():o(t)&&s.invalidateLayout()}function f(t){var n=h(),o={tileSpans:v(n),colCount:w(),rowMode:I(),rowHeight:$(),gutter:y()};if(t||!e.equals(o,M)){var u=i(o.colCount,o.tileSpans,n).map(function(t,i){return{grid:{element:a,style:m(o.colCount,i,o.gutter,o.rowMode,o.rowHeight)},tiles:t.map(function(t,i){return{element:e.element(n[i]),style:g(t.position,t.spans,o.colCount,o.rowCount,o.gutter,o.rowMode,o.rowHeight)}})}}).reflow().performance();r.mdOnLayout({$event:{performance:u}}),M=o}}function p(t){return x+t+A}function g(t,e,n,i,r,o,a){var u=1/n*100,s=(n-1)/n,l=D({share:u,gutterShare:s,gutter:r}),c={left:C({unit:l,offset:t.col,gutter:r}),width:G({unit:l,span:e.col,gutter:r}),paddingTop:"",marginTop:"",top:"",height:""};switch(o){case"fixed":c.top=C({unit:a,offset:t.row,gutter:r}),c.height=G({unit:a,span:e.row,gutter:r});break;case"ratio":var d=u/a,f=D({share:d,gutterShare:s,gutter:r});c.paddingTop=G({unit:f,span:e.row,gutter:r}),c.marginTop=C({unit:f,offset:t.row,gutter:r});break;case"fit":var p=(i-1)/i,d=1/i*100,f=D({share:d,gutterShare:p,gutter:r});c.top=C({unit:f,offset:t.row,gutter:r}),c.height=G({unit:f,span:e.row,gutter:r})}return c}function m(t,e,n,i,r){var o={height:"",paddingBottom:""};switch(i){case"fixed":o.height=G({unit:r,span:e,gutter:n});break;case"ratio":var a=1===t?0:(t-1)/t,u=1/t*100,s=u*(1/r),l=D({share:s,gutterShare:a,gutter:n});o.paddingBottom=G({unit:l,span:e,gutter:n});break;case"fit":}return o}function h(){return[].filter.call(a.children(),function(t){return"MD-GRID-TILE"==t.tagName})}function v(t){return[].map.call(t,function(t){var n=e.element(t).controller("mdGridTile");return{row:parseInt(o.getResponsiveAttribute(n.$attrs,"md-rowspan"),10)||1,col:parseInt(o.getResponsiveAttribute(n.$attrs,"md-colspan"),10)||1}})}function w(){var t=parseInt(o.getResponsiveAttribute(u,"md-cols"),10);if(isNaN(t))throw"md-grid-list: md-cols attribute was not found, or contained a non-numeric value";return t}function y(){return b(o.getResponsiveAttribute(u,"md-gutter")||1)}function $(){var t=o.getResponsiveAttribute(u,"md-row-height");switch(I()){case"fixed":return b(t);case"ratio":var e=t.split(":");return parseFloat(e[0])/parseFloat(e[1]);case"fit":return 0}}function I(){var t=o.getResponsiveAttribute(u,"md-row-height");return"fit"==t?"fit":-1!==t.indexOf(":")?"ratio":"fixed"}function b(t){return/\D$/.test(t)?t:t+"px"}a.attr("role","list"),s.layoutDelegate=f;var L=e.bind(s,s.invalidateLayout),T=l();r.$on("$destroy",c);var M,x=t.startSymbol(),A=t.endSymbol(),D=t(p("share")+"% - ("+p("gutter")+" * "+p("gutterShare")+")"),C=t("calc(("+p("unit")+" + "+p("gutter")+") * "+p("offset")+")"),G=t("calc(("+p("unit")+") * "+p("span")+" + ("+p("span")+" - 1) * "+p("gutter")+")")}return{restrict:"E",controller:r,scope:{mdOnLayout:"&"},link:a}}function r(t){this.layoutInvalidated=!1,this.tilesInvalidated=!1,this.$timeout_=t,this.layoutDelegate=e.noop}function o(t){function n(e,n){var i,a,u,s,l,c;return s=t.time(function(){a=r(e,n)}),i={layoutInfo:function(){return a},map:function(e){return l=t.time(function(){var t=i.layoutInfo();u=e(t.positioning,t.rowCount)}),i},reflow:function(e){return c=t.time(function(){var t=e||o;t(u.grid,u.tiles)}),i},performance:function(){return{tileCount:n.length,layoutTime:s,mapTime:l,reflowTime:c,totalTime:s+l+c}}}}function i(t,e){t.element.css(t.style),e.forEach(function(t){t.element.css(t.style)})}function r(t,e){function n(e,n){if(e.col>t)throw"md-grid-list: Tile at position "+n+" has a colspan ("+e.col+") that exceeds the column count ("+t+")";for(var a=0,c=0;c-a<e.col;)u>=t?i():(a=l.indexOf(0,u),-1!==a&&-1!==(c=o(a+1))?u=c+1:(a=c=0,i()));return r(a,e.col,e.row),u=a+e.col,{col:a,row:s}}function i(){u=0,s++,r(0,t,-1)}function r(t,e,n){for(var i=t;t+e>i;i++)l[i]=Math.max(l[i]+n,0)}function o(t){var e;for(e=t;e<l.length;e++)if(0!==l[e])return e;return e===l.length?e:void 0}function a(){for(var e=[],n=0;t>n;n++)e.push(0);return e}var u=0,s=0,l=a();return{positioning:e.map(function(t,e){return{spans:t,position:n(t,e)}}),rowCount:s+Math.max.apply(Math,l)}}var o=i;return n.animateWith=function(t){o=e.isFunction(t)?t:i},n}function a(t){function n(n,i,r,o){i.attr("role","listitem");var a=t.watchResponsiveAttributes(["md-colspan","md-rowspan"],r,e.bind(o,o.invalidateLayout));o.invalidateTiles(),n.$on("$destroy",function(){a(),o.invalidateLayout()}),e.isDefined(n.$parent.$index)&&n.$watch(function(){return n.$parent.$index},function(t,e){t!==e&&o.invalidateTiles()})}return{restrict:"E",require:"^mdGridList",template:"<figure ng-transclude></figure>",transclude:!0,scope:{},controller:["$attrs",function(t){this.$attrs=t}],link:n}}function u(){return{template:"<figcaption ng-transclude></figcaption>",transclude:!0}}e.module("material.components.gridList",["material.core"]).directive("mdGridList",i).directive("mdGridTile",a).directive("mdGridTileFooter",u).directive("mdGridTileHeader",u).factory("$mdGridLayout",o),i.$inject=["$interpolate","$mdConstant","$mdGridLayout","$mdMedia"],r.$inject=["$timeout"],r.prototype={invalidateTiles:function(){this.tilesInvalidated=!0,this.invalidateLayout()},invalidateLayout:function(){this.layoutInvalidated||(this.layoutInvalidated=!0,this.$timeout_(e.bind(this,this.layout)))},layout:function(){try{this.layoutDelegate(this.tilesInvalidated)}finally{this.layoutInvalidated=!1,this.tilesInvalidated=!1}}},o.$inject=["$mdUtil"],a.$inject=["$mdMedia"]}(window,window.angular);