UPGIT6

parent e6b65c58
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/md-progress-circular{display:block;position:relative;width:100px;height:100px;padding-top:0!important;margin-bottom:0!important;z-index:2}md-progress-circular ._md-spinner-wrapper{display:block;position:absolute;overflow:hidden;top:50%;left:50%}md-progress-circular ._md-spinner-wrapper ._md-inner{width:100px;height:100px;position:relative}md-progress-circular ._md-spinner-wrapper ._md-inner ._md-gap{position:absolute;left:49px;right:49px;top:0;bottom:0;border-top-width:10px;border-top-style:solid;box-sizing:border-box}md-progress-circular ._md-spinner-wrapper ._md-inner ._md-left,md-progress-circular ._md-spinner-wrapper ._md-inner ._md-right{position:absolute;top:0;height:100px;width:50px;overflow:hidden}md-progress-circular ._md-spinner-wrapper ._md-inner ._md-left ._md-half-circle,md-progress-circular ._md-spinner-wrapper ._md-inner ._md-right ._md-half-circle{position:absolute;top:0;width:100px;height:100px;box-sizing:border-box;border-width:10px;border-style:solid;border-bottom-color:transparent;border-radius:50%}md-progress-circular ._md-spinner-wrapper ._md-inner ._md-left{left:0}md-progress-circular ._md-spinner-wrapper ._md-inner ._md-left ._md-half-circle{left:0;border-right-color:transparent}md-progress-circular ._md-spinner-wrapper ._md-inner ._md-right{right:0}md-progress-circular ._md-spinner-wrapper ._md-inner ._md-right ._md-half-circle{right:0;border-left-color:transparent}md-progress-circular ._md-mode-indeterminate ._md-spinner-wrapper{-webkit-animation:outer-rotate 2.91667s linear infinite;animation:outer-rotate 2.91667s linear infinite}md-progress-circular ._md-mode-indeterminate ._md-spinner-wrapper ._md-inner{-webkit-animation:sporadic-rotate 5.25s cubic-bezier(.35,0,.25,1) infinite;animation:sporadic-rotate 5.25s cubic-bezier(.35,0,.25,1) infinite}md-progress-circular ._md-mode-indeterminate ._md-spinner-wrapper ._md-inner ._md-left ._md-half-circle,md-progress-circular ._md-mode-indeterminate ._md-spinner-wrapper ._md-inner ._md-right ._md-half-circle{-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-duration:1.3125s;animation-duration:1.3125s;-webkit-animation-timing-function:cubic-bezier(.35,0,.25,1);animation-timing-function:cubic-bezier(.35,0,.25,1)}md-progress-circular ._md-mode-indeterminate ._md-spinner-wrapper ._md-inner ._md-left ._md-half-circle{-webkit-animation-name:left-wobble;animation-name:left-wobble}md-progress-circular ._md-mode-indeterminate ._md-spinner-wrapper ._md-inner ._md-right ._md-half-circle{-webkit-animation-name:right-wobble;animation-name:right-wobble}md-progress-circular.ng-hide ._md-spinner-wrapper,md-progress-circular.ng-hide ._md-spinner-wrapper ._md-inner{-webkit-animation:none;animation:none}md-progress-circular.ng-hide ._md-spinner-wrapper ._md-inner ._md-left ._md-half-circle,md-progress-circular.ng-hide ._md-spinner-wrapper ._md-inner ._md-right ._md-half-circle{-webkit-animation-name:none;animation-name:none}md-progress-circular ._md-spinner-wrapper.ng-hide,md-progress-circular ._md-spinner-wrapper.ng-hide ._md-inner{-webkit-animation:none;animation:none}md-progress-circular ._md-spinner-wrapper.ng-hide ._md-inner ._md-left ._md-half-circle,md-progress-circular ._md-spinner-wrapper.ng-hide ._md-inner ._md-right ._md-half-circle{-webkit-animation-name:none;animation-name:none}@-webkit-keyframes outer-rotate{0%{-webkit-transform:rotate(0deg) scale(.5);transform:rotate(0deg) scale(.5)}100%{-webkit-transform:rotate(360deg) scale(.5);transform:rotate(360deg) scale(.5)}}@keyframes outer-rotate{0%{-webkit-transform:rotate(0deg) scale(.5);transform:rotate(0deg) scale(.5)}100%{-webkit-transform:rotate(360deg) scale(.5);transform:rotate(360deg) scale(.5)}}@-webkit-keyframes left-wobble{0%,100%{-webkit-transform:rotate(130deg);transform:rotate(130deg)}50%{-webkit-transform:rotate(-5deg);transform:rotate(-5deg)}}@keyframes left-wobble{0%,100%{-webkit-transform:rotate(130deg);transform:rotate(130deg)}50%{-webkit-transform:rotate(-5deg);transform:rotate(-5deg)}}@-webkit-keyframes right-wobble{0%,100%{-webkit-transform:rotate(-130deg);transform:rotate(-130deg)}50%{-webkit-transform:rotate(5deg);transform:rotate(5deg)}}@keyframes right-wobble{0%,100%{-webkit-transform:rotate(-130deg);transform:rotate(-130deg)}50%{-webkit-transform:rotate(5deg);transform:rotate(5deg)}}@-webkit-keyframes sporadic-rotate{12.5%{-webkit-transform:rotate(135deg);transform:rotate(135deg)}25%{-webkit-transform:rotate(270deg);transform:rotate(270deg)}37.5%{-webkit-transform:rotate(405deg);transform:rotate(405deg)}50%{-webkit-transform:rotate(540deg);transform:rotate(540deg)}62.5%{-webkit-transform:rotate(675deg);transform:rotate(675deg)}75%{-webkit-transform:rotate(810deg);transform:rotate(810deg)}87.5%{-webkit-transform:rotate(945deg);transform:rotate(945deg)}100%{-webkit-transform:rotate(1080deg);transform:rotate(1080deg)}}@keyframes sporadic-rotate{12.5%{-webkit-transform:rotate(135deg);transform:rotate(135deg)}25%{-webkit-transform:rotate(270deg);transform:rotate(270deg)}37.5%{-webkit-transform:rotate(405deg);transform:rotate(405deg)}50%{-webkit-transform:rotate(540deg);transform:rotate(540deg)}62.5%{-webkit-transform:rotate(675deg);transform:rotate(675deg)}75%{-webkit-transform:rotate(810deg);transform:rotate(810deg)}87.5%{-webkit-transform:rotate(945deg);transform:rotate(945deg)}100%{-webkit-transform:rotate(1080deg);transform:rotate(1080deg)}}
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/
function MdProgressCircularDirective(r,e,a){function t(r){return r.attr("aria-valuemin",0),r.attr("aria-valuemax",100),r.attr("role","progressbar"),i}function i(t,i,c){function u(){c.$observe("value",function(r){var e=n(r);i.attr("aria-valuenow",e),h()==l&&p(e)}),c.$observe("mdMode",function(r){switch(r){case l:case m:M.removeClass("ng-hide"),C&&M.removeClass(C),M.addClass(C="_md-mode-"+r);break;default:C&&M.removeClass(C),M.addClass("ng-hide"),C=void 0}})}function v(){_.css({width:100*f()+"px",height:100*f()+"px"}),_.children().eq(0).css(b({transform:e.supplant("translate(-50%, -50%) scale( {0} )",[f()])}))}function g(){if(angular.isUndefined(c.mdMode)){var r=angular.isDefined(c.value),t=r?l:m,n="Auto-adding the missing md-mode='{0}' to the ProgressCircular element";a.debug(e.supplant(n,[t])),i.attr("md-mode",t),c.mdMode=t}}function p(r){if(h()){w=w||angular.element(i[0].querySelector("._md-left > ._md-half-circle")),D=D||angular.element(i[0].querySelector("._md-right > ._md-half-circle")),x=x||angular.element(i[0].querySelector("._md-gap"));var a=s({borderBottomColor:50>=r?"transparent !important":"",transition:50>=r?"":"borderBottomColor 0.1s linear"}),t=s({transition:50>=r?"transform 0.1s linear":"",transform:e.supplant("rotate({0}deg)",[50>=r?135:(r-50)/50*180+135])}),n=s({transition:r>=50?"transform 0.1s linear":"",transform:e.supplant("rotate({0}deg)",[r>=50?45:r/50*180-135])});w.css(b(t)),D.css(b(n)),x.css(b(a))}}function f(){if(!c.mdDiameter)return d;var r=/([0-9]*)%/.exec(c.mdDiameter),e=Math.max(0,r&&r[1]/100||parseFloat(c.mdDiameter));return e>1?e/o:e}function h(){var r=(c.mdMode||"").trim();if(r)switch(r){case l:case m:break;default:r=void 0}return r}r(i);var C,_=i,M=angular.element(i.children()[0]),b=e.dom.animator.toCss;i.attr("md-mode",h()),v(),g(),u();var w,D,x}function n(r){return Math.max(0,Math.min(r||0,100))}function s(r){for(var e in r)r.hasOwnProperty(e)&&""==r[e]&&delete r[e];return r}var o=100,d=.5,l="determinate",m="indeterminate";return{restrict:"E",scope:!0,template:'<div class="_md-scale-wrapper"><div class="_md-spinner-wrapper"><div class="_md-inner"><div class="_md-gap"></div><div class="_md-left"><div class="_md-half-circle"></div></div><div class="_md-right"><div class="_md-half-circle"></div></div></div></div></div>',compile:t}}goog.provide("ng.material.components.progressCircular"),goog.require("ng.material.core"),angular.module("material.components.progressCircular",["material.core"]).directive("mdProgressCircular",MdProgressCircularDirective),MdProgressCircularDirective.$inject=["$mdTheming","$mdUtil","$log"],ng.material.components.progressCircular=angular.module("material.components.progressCircular");
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
md-progress-linear.md-THEME_NAME-theme .md-container {
background-color: '{{primary-100}}'; }
md-progress-linear.md-THEME_NAME-theme .md-bar {
background-color: '{{primary-color}}'; }
md-progress-linear.md-THEME_NAME-theme.md-warn .md-container {
background-color: '{{warn-100}}'; }
md-progress-linear.md-THEME_NAME-theme.md-warn .md-bar {
background-color: '{{warn-color}}'; }
md-progress-linear.md-THEME_NAME-theme.md-accent .md-container {
background-color: '{{accent-100}}'; }
md-progress-linear.md-THEME_NAME-theme.md-accent .md-bar {
background-color: '{{accent-color}}'; }
md-progress-linear.md-THEME_NAME-theme[md-mode=buffer].md-warn .md-bar1 {
background-color: '{{warn-100}}'; }
md-progress-linear.md-THEME_NAME-theme[md-mode=buffer].md-warn .md-dashed:before {
background: radial-gradient("{{warn-100}}" 0%, "{{warn-100}}" 16%, transparent 42%); }
md-progress-linear.md-THEME_NAME-theme[md-mode=buffer].md-accent .md-bar1 {
background-color: '{{accent-100}}'; }
md-progress-linear.md-THEME_NAME-theme[md-mode=buffer].md-accent .md-dashed:before {
background: radial-gradient("{{accent-100}}" 0%, "{{accent-100}}" 16%, transparent 42%); }
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/md-progress-linear.md-THEME_NAME-theme ._md-container{background-color:'{{primary-100}}'}md-progress-linear.md-THEME_NAME-theme ._md-bar{background-color:'{{primary-color}}'}md-progress-linear.md-THEME_NAME-theme.md-warn ._md-container{background-color:'{{warn-100}}'}md-progress-linear.md-THEME_NAME-theme.md-warn ._md-bar{background-color:'{{warn-color}}'}md-progress-linear.md-THEME_NAME-theme.md-accent ._md-container{background-color:'{{accent-100}}'}md-progress-linear.md-THEME_NAME-theme.md-accent ._md-bar{background-color:'{{accent-color}}'}md-progress-linear.md-THEME_NAME-theme[md-mode=buffer].md-warn ._md-bar1{background-color:'{{warn-100}}'}md-progress-linear.md-THEME_NAME-theme[md-mode=buffer].md-warn ._md-dashed:before{background:0 0}md-progress-linear.md-THEME_NAME-theme[md-mode=buffer].md-accent ._md-bar1{background-color:'{{accent-100}}'}md-progress-linear.md-THEME_NAME-theme[md-mode=buffer].md-accent ._md-dashed:before{background:0 0}
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
md-progress-linear {
display: block;
position: relative;
width: 100%;
height: 5px;
padding-top: 0 !important;
margin-bottom: 0 !important; }
md-progress-linear .md-container {
display: block;
position: relative;
overflow: hidden;
width: 100%;
height: 5px;
-webkit-transform: translate(0, 0) scale(1, 1);
transform: translate(0, 0) scale(1, 1); }
md-progress-linear .md-container .md-bar {
position: absolute;
left: 0;
top: 0;
bottom: 0;
width: 100%;
height: 5px; }
md-progress-linear .md-container .md-dashed:before {
content: "";
display: none;
position: absolute;
margin-top: 0;
height: 5px;
width: 100%;
background-color: transparent;
background-size: 10px 10px !important;
background-position: 0px -23px; }
md-progress-linear .md-container .md-bar1, md-progress-linear .md-container .md-bar2 {
transition: -webkit-transform 0.2s linear;
transition: transform 0.2s linear; }
md-progress-linear .md-container.md-mode-query .md-bar1 {
display: none; }
md-progress-linear .md-container.md-mode-query .md-bar2 {
transition: all 0.2s linear;
-webkit-animation: query 0.8s infinite cubic-bezier(0.39, 0.575, 0.565, 1);
animation: query 0.8s infinite cubic-bezier(0.39, 0.575, 0.565, 1); }
md-progress-linear .md-container.md-mode-determinate .md-bar1 {
display: none; }
md-progress-linear .md-container.md-mode-indeterminate .md-bar1 {
-webkit-animation: md-progress-linear-indeterminate-scale-1 4s infinite, md-progress-linear-indeterminate-1 4s infinite;
animation: md-progress-linear-indeterminate-scale-1 4s infinite, md-progress-linear-indeterminate-1 4s infinite; }
md-progress-linear .md-container.md-mode-indeterminate .md-bar2 {
-webkit-animation: md-progress-linear-indeterminate-scale-2 4s infinite, md-progress-linear-indeterminate-2 4s infinite;
animation: md-progress-linear-indeterminate-scale-2 4s infinite, md-progress-linear-indeterminate-2 4s infinite; }
md-progress-linear .md-container.ng-hide {
-webkit-animation: none;
animation: none; }
md-progress-linear .md-container.ng-hide .md-bar1 {
-webkit-animation-name: none;
animation-name: none; }
md-progress-linear .md-container.ng-hide .md-bar2 {
-webkit-animation-name: none;
animation-name: none; }
md-progress-linear .md-container.md-mode-buffer {
background-color: transparent !important;
transition: all 0.2s linear; }
md-progress-linear .md-container.md-mode-buffer .md-dashed:before {
display: block;
-webkit-animation: buffer 3s infinite linear;
animation: buffer 3s infinite linear; }
@-webkit-keyframes query {
0% {
opacity: 1;
-webkit-transform: translateX(35%) scale(0.3, 1);
transform: translateX(35%) scale(0.3, 1); }
100% {
opacity: 0;
-webkit-transform: translateX(-50%) scale(0, 1);
transform: translateX(-50%) scale(0, 1); } }
@keyframes query {
0% {
opacity: 1;
-webkit-transform: translateX(35%) scale(0.3, 1);
transform: translateX(35%) scale(0.3, 1); }
100% {
opacity: 0;
-webkit-transform: translateX(-50%) scale(0, 1);
transform: translateX(-50%) scale(0, 1); } }
@-webkit-keyframes buffer {
0% {
opacity: 1;
background-position: 0px -23px; }
50% {
opacity: 0; }
100% {
opacity: 1;
background-position: -200px -23px; } }
@keyframes buffer {
0% {
opacity: 1;
background-position: 0px -23px; }
50% {
opacity: 0; }
100% {
opacity: 1;
background-position: -200px -23px; } }
@-webkit-keyframes md-progress-linear-indeterminate-scale-1 {
0% {
-webkit-transform: scaleX(0.1);
transform: scaleX(0.1);
-webkit-animation-timing-function: linear;
animation-timing-function: linear; }
36.6% {
-webkit-transform: scaleX(0.1);
transform: scaleX(0.1);
-webkit-animation-timing-function: cubic-bezier(0.33473, 0.12482, 0.78584, 1);
animation-timing-function: cubic-bezier(0.33473, 0.12482, 0.78584, 1); }
69.15% {
-webkit-transform: scaleX(0.83);
transform: scaleX(0.83);
-webkit-animation-timing-function: cubic-bezier(0.22573, 0, 0.23365, 1.37098);
animation-timing-function: cubic-bezier(0.22573, 0, 0.23365, 1.37098); }
100% {
-webkit-transform: scaleX(0.1);
transform: scaleX(0.1); } }
@keyframes md-progress-linear-indeterminate-scale-1 {
0% {
-webkit-transform: scaleX(0.1);
transform: scaleX(0.1);
-webkit-animation-timing-function: linear;
animation-timing-function: linear; }
36.6% {
-webkit-transform: scaleX(0.1);
transform: scaleX(0.1);
-webkit-animation-timing-function: cubic-bezier(0.33473, 0.12482, 0.78584, 1);
animation-timing-function: cubic-bezier(0.33473, 0.12482, 0.78584, 1); }
69.15% {
-webkit-transform: scaleX(0.83);
transform: scaleX(0.83);
-webkit-animation-timing-function: cubic-bezier(0.22573, 0, 0.23365, 1.37098);
animation-timing-function: cubic-bezier(0.22573, 0, 0.23365, 1.37098); }
100% {
-webkit-transform: scaleX(0.1);
transform: scaleX(0.1); } }
@-webkit-keyframes md-progress-linear-indeterminate-1 {
0% {
left: -105.16667%;
-webkit-animation-timing-function: linear;
animation-timing-function: linear; }
20% {
left: -105.16667%;
-webkit-animation-timing-function: cubic-bezier(0.5, 0, 0.70173, 0.49582);
animation-timing-function: cubic-bezier(0.5, 0, 0.70173, 0.49582); }
69.15% {
left: 21.5%;
-webkit-animation-timing-function: cubic-bezier(0.30244, 0.38135, 0.55, 0.95635);
animation-timing-function: cubic-bezier(0.30244, 0.38135, 0.55, 0.95635); }
100% {
left: 95.44444%; } }
@keyframes md-progress-linear-indeterminate-1 {
0% {
left: -105.16667%;
-webkit-animation-timing-function: linear;
animation-timing-function: linear; }
20% {
left: -105.16667%;
-webkit-animation-timing-function: cubic-bezier(0.5, 0, 0.70173, 0.49582);
animation-timing-function: cubic-bezier(0.5, 0, 0.70173, 0.49582); }
69.15% {
left: 21.5%;
-webkit-animation-timing-function: cubic-bezier(0.30244, 0.38135, 0.55, 0.95635);
animation-timing-function: cubic-bezier(0.30244, 0.38135, 0.55, 0.95635); }
100% {
left: 95.44444%; } }
@-webkit-keyframes md-progress-linear-indeterminate-scale-2 {
0% {
-webkit-transform: scaleX(0.1);
transform: scaleX(0.1);
-webkit-animation-timing-function: cubic-bezier(0.20503, 0.05705, 0.57661, 0.45397);
animation-timing-function: cubic-bezier(0.20503, 0.05705, 0.57661, 0.45397); }
19.15% {
-webkit-transform: scaleX(0.57);
transform: scaleX(0.57);
-webkit-animation-timing-function: cubic-bezier(0.15231, 0.19643, 0.64837, 1.00432);
animation-timing-function: cubic-bezier(0.15231, 0.19643, 0.64837, 1.00432); }
44.15% {
-webkit-transform: scaleX(0.91);
transform: scaleX(0.91);
-webkit-animation-timing-function: cubic-bezier(0.25776, -0.00316, 0.21176, 1.38179);
animation-timing-function: cubic-bezier(0.25776, -0.00316, 0.21176, 1.38179); }
100% {
-webkit-transform: scaleX(0.1);
transform: scaleX(0.1); } }
@keyframes md-progress-linear-indeterminate-scale-2 {
0% {
-webkit-transform: scaleX(0.1);
transform: scaleX(0.1);
-webkit-animation-timing-function: cubic-bezier(0.20503, 0.05705, 0.57661, 0.45397);
animation-timing-function: cubic-bezier(0.20503, 0.05705, 0.57661, 0.45397); }
19.15% {
-webkit-transform: scaleX(0.57);
transform: scaleX(0.57);
-webkit-animation-timing-function: cubic-bezier(0.15231, 0.19643, 0.64837, 1.00432);
animation-timing-function: cubic-bezier(0.15231, 0.19643, 0.64837, 1.00432); }
44.15% {
-webkit-transform: scaleX(0.91);
transform: scaleX(0.91);
-webkit-animation-timing-function: cubic-bezier(0.25776, -0.00316, 0.21176, 1.38179);
animation-timing-function: cubic-bezier(0.25776, -0.00316, 0.21176, 1.38179); }
100% {
-webkit-transform: scaleX(0.1);
transform: scaleX(0.1); } }
@-webkit-keyframes md-progress-linear-indeterminate-2 {
0% {
left: -54.88889%;
-webkit-animation-timing-function: cubic-bezier(0.15, 0, 0.51506, 0.40968);
animation-timing-function: cubic-bezier(0.15, 0, 0.51506, 0.40968); }
25% {
left: -17.25%;
-webkit-animation-timing-function: cubic-bezier(0.31033, 0.28406, 0.8, 0.73372);
animation-timing-function: cubic-bezier(0.31033, 0.28406, 0.8, 0.73372); }
48.35% {
left: 29.5%;
-webkit-animation-timing-function: cubic-bezier(0.4, 0.62703, 0.6, 0.90203);
animation-timing-function: cubic-bezier(0.4, 0.62703, 0.6, 0.90203); }
100% {
left: 117.38889%; } }
@keyframes md-progress-linear-indeterminate-2 {
0% {
left: -54.88889%;
-webkit-animation-timing-function: cubic-bezier(0.15, 0, 0.51506, 0.40968);
animation-timing-function: cubic-bezier(0.15, 0, 0.51506, 0.40968); }
25% {
left: -17.25%;
-webkit-animation-timing-function: cubic-bezier(0.31033, 0.28406, 0.8, 0.73372);
animation-timing-function: cubic-bezier(0.31033, 0.28406, 0.8, 0.73372); }
48.35% {
left: 29.5%;
-webkit-animation-timing-function: cubic-bezier(0.4, 0.62703, 0.6, 0.90203);
animation-timing-function: cubic-bezier(0.4, 0.62703, 0.6, 0.90203); }
100% {
left: 117.38889%; } }
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
goog.provide('ng.material.components.progressLinear');
goog.require('ng.material.core');
/**
* @ngdoc module
* @name material.components.progressLinear
* @description Linear Progress module!
*/
angular.module('material.components.progressLinear', [
'material.core'
])
.directive('mdProgressLinear', MdProgressLinearDirective);
/**
* @ngdoc directive
* @name mdProgressLinear
* @module material.components.progressLinear
* @restrict E
*
* @description
* The linear progress directive is used to make loading content
* in your app as delightful and painless as possible by minimizing
* the amount of visual change a user sees before they can view
* and interact with content.
*
* Each operation should only be represented by one activity indicator
* For example: one refresh operation should not display both a
* refresh bar and an activity circle.
*
* For operations where the percentage of the operation completed
* can be determined, use a determinate indicator. They give users
* a quick sense of how long an operation will take.
*
* For operations where the user is asked to wait a moment while
* something finishes up, and it’s not necessary to expose what's
* happening behind the scenes and how long it will take, use an
* indeterminate indicator.
*
* @param {string} md-mode Select from one of four modes: determinate, indeterminate, buffer or query.
*
* Note: if the `md-mode` value is set as undefined or specified as 1 of the four (4) valid modes, then `.ng-hide`
* will be auto-applied as a style to the component.
*
* Note: if not configured, the `md-mode="indeterminate"` will be auto injected as an attribute. If `value=""` is also specified, however,
* then `md-mode="determinate"` would be auto-injected instead.
* @param {number=} value In determinate and buffer modes, this number represents the percentage of the primary progress bar. Default: 0
* @param {number=} md-buffer-value In the buffer mode, this number represents the percentage of the secondary progress bar. Default: 0
*
* @usage
* <hljs lang="html">
* <md-progress-linear md-mode="determinate" value="..."></md-progress-linear>
*
* <md-progress-linear md-mode="determinate" ng-value="..."></md-progress-linear>
*
* <md-progress-linear md-mode="indeterminate"></md-progress-linear>
*
* <md-progress-linear md-mode="buffer" value="..." md-buffer-value="..."></md-progress-linear>
*
* <md-progress-linear md-mode="query"></md-progress-linear>
* </hljs>
*/
function MdProgressLinearDirective($mdTheming, $mdUtil, $log) {
var MODE_DETERMINATE = "determinate",
MODE_INDETERMINATE = "indeterminate",
MODE_BUFFER = "buffer",
MODE_QUERY = "query";
return {
restrict: 'E',
template: '<div class="md-container">' +
'<div class="md-dashed"></div>' +
'<div class="md-bar md-bar1"></div>' +
'<div class="md-bar md-bar2"></div>' +
'</div>',
compile: compile
};
function compile(tElement, tAttrs, transclude) {
tElement.attr('aria-valuemin', 0);
tElement.attr('aria-valuemax', 100);
tElement.attr('role', 'progressbar');
return postLink;
}
function postLink(scope, element, attr) {
$mdTheming(element);
var lastMode, toVendorCSS = $mdUtil.dom.animator.toCss;
var bar1 = angular.element(element[0].querySelector('.md-bar1')),
bar2 = angular.element(element[0].querySelector('.md-bar2')),
container = angular.element(element[0].querySelector('.md-container'));
element.attr('md-mode', mode());
validateMode();
watchAttributes();
/**
* Watch the value, md-buffer-value, and md-mode attributes
*/
function watchAttributes() {
attr.$observe('value', function(value) {
var percentValue = clamp(value);
element.attr('aria-valuenow', percentValue);
if (mode() != MODE_QUERY) animateIndicator(bar2, percentValue);
});
attr.$observe('mdBufferValue', function(value) {
animateIndicator(bar1, clamp(value));
});
attr.$observe('mdMode',function(mode){
switch( mode ) {
case MODE_QUERY:
case MODE_BUFFER:
case MODE_DETERMINATE:
case MODE_INDETERMINATE:
container.removeClass( 'ng-hide' + ' ' + lastMode );
container.addClass( lastMode = "md-mode-" + mode );
break;
default:
if (lastMode) container.removeClass( lastMode );
container.addClass('ng-hide');
lastMode = undefined;
break;
}
});
}
/**
* Auto-defaults the mode to either `determinate` or `indeterminate` mode; if not specified
*/
function validateMode() {
if ( angular.isUndefined(attr.mdMode) ) {
var hasValue = angular.isDefined(attr.value);
var mode = hasValue ? MODE_DETERMINATE : MODE_INDETERMINATE;
var info = "Auto-adding the missing md-mode='{0}' to the ProgressLinear element";
$log.debug( $mdUtil.supplant(info, [mode]) );
element.attr("md-mode",mode);
attr['mdMode'] = mode;
}
}
/**
* Is the md-mode a valid option?
*/
function mode() {
var value = (attr.mdMode || "").trim();
if ( value ) {
switch(value) {
case MODE_DETERMINATE:
case MODE_INDETERMINATE:
case MODE_BUFFER:
case MODE_QUERY:
break;
default:
value = undefined;
break;
}
}
return value;
}
/**
* Manually set CSS to animate the Determinate indicator based on the specified
* percentage value (0-100).
*/
function animateIndicator(target, value) {
if ( !mode() ) return;
var to = $mdUtil.supplant("translateX({0}%) scale({1},1)", [ (value-100)/2, value/100 ]);
var styles = toVendorCSS({ transform : to });
angular.element(target).css( styles );
}
}
/**
* Clamps the value to be between 0 and 100.
* @param {number} value The value to clamp.
* @returns {number}
*/
function clamp(value) {
return Math.max(0, Math.min(value || 0, 100));
}
}
MdProgressLinearDirective.$inject = ["$mdTheming", "$mdUtil", "$log"];
ng.material.components.progressLinear = angular.module("material.components.progressLinear");
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/md-progress-linear{display:block;position:relative;width:100%;height:5px;padding-top:0!important;margin-bottom:0!important}md-progress-linear ._md-container{display:block;position:relative;overflow:hidden;width:100%;height:5px;-webkit-transform:translate(0,0) scale(1,1);transform:translate(0,0) scale(1,1)}md-progress-linear ._md-container ._md-bar{position:absolute;left:0;top:0;bottom:0;width:100%;height:5px}md-progress-linear ._md-container ._md-dashed:before{content:"";display:none;position:absolute;margin-top:0;height:5px;width:100%;background-color:transparent;background-size:10px 10px!important;background-position:0 -23px}md-progress-linear ._md-container ._md-bar1,md-progress-linear ._md-container ._md-bar2{transition:-webkit-transform .2s linear;transition:transform .2s linear}md-progress-linear ._md-container._md-mode-query ._md-bar1{display:none}md-progress-linear ._md-container._md-mode-query ._md-bar2{transition:all .2s linear;-webkit-animation:query .8s infinite cubic-bezier(.39,.575,.565,1);animation:query .8s infinite cubic-bezier(.39,.575,.565,1)}md-progress-linear ._md-container._md-mode-determinate ._md-bar1{display:none}md-progress-linear ._md-container._md-mode-indeterminate ._md-bar1{-webkit-animation:md-progress-linear-indeterminate-scale-1 4s infinite,md-progress-linear-indeterminate-1 4s infinite;animation:md-progress-linear-indeterminate-scale-1 4s infinite,md-progress-linear-indeterminate-1 4s infinite}md-progress-linear ._md-container._md-mode-indeterminate ._md-bar2{-webkit-animation:md-progress-linear-indeterminate-scale-2 4s infinite,md-progress-linear-indeterminate-2 4s infinite;animation:md-progress-linear-indeterminate-scale-2 4s infinite,md-progress-linear-indeterminate-2 4s infinite}md-progress-linear ._md-container.ng-hide{-webkit-animation:none;animation:none}md-progress-linear ._md-container.ng-hide ._md-bar1,md-progress-linear ._md-container.ng-hide ._md-bar2{-webkit-animation-name:none;animation-name:none}md-progress-linear ._md-container._md-mode-buffer{background-color:transparent!important;transition:all .2s linear}md-progress-linear ._md-container._md-mode-buffer ._md-dashed:before{display:block;-webkit-animation:buffer 3s infinite linear;animation:buffer 3s infinite linear}@-webkit-keyframes query{0%{opacity:1;-webkit-transform:translateX(35%) scale(.3,1);transform:translateX(35%) scale(.3,1)}100%{opacity:0;-webkit-transform:translateX(-50%) scale(0,1);transform:translateX(-50%) scale(0,1)}}@keyframes query{0%{opacity:1;-webkit-transform:translateX(35%) scale(.3,1);transform:translateX(35%) scale(.3,1)}100%{opacity:0;-webkit-transform:translateX(-50%) scale(0,1);transform:translateX(-50%) scale(0,1)}}@-webkit-keyframes buffer{0%{opacity:1;background-position:0 -23px}50%{opacity:0}100%{opacity:1;background-position:-200px -23px}}@keyframes buffer{0%{opacity:1;background-position:0 -23px}50%{opacity:0}100%{opacity:1;background-position:-200px -23px}}@-webkit-keyframes md-progress-linear-indeterminate-scale-1{0%{-webkit-transform:scaleX(.1);transform:scaleX(.1);-webkit-animation-timing-function:linear;animation-timing-function:linear}36.6%{-webkit-transform:scaleX(.1);transform:scaleX(.1);-webkit-animation-timing-function:cubic-bezier(.33473,.12482,.78584,1);animation-timing-function:cubic-bezier(.33473,.12482,.78584,1)}69.15%{-webkit-transform:scaleX(.83);transform:scaleX(.83);-webkit-animation-timing-function:cubic-bezier(.22573,0,.23365,1.37098);animation-timing-function:cubic-bezier(.22573,0,.23365,1.37098)}100%{-webkit-transform:scaleX(.1);transform:scaleX(.1)}}@keyframes md-progress-linear-indeterminate-scale-1{0%{-webkit-transform:scaleX(.1);transform:scaleX(.1);-webkit-animation-timing-function:linear;animation-timing-function:linear}36.6%{-webkit-transform:scaleX(.1);transform:scaleX(.1);-webkit-animation-timing-function:cubic-bezier(.33473,.12482,.78584,1);animation-timing-function:cubic-bezier(.33473,.12482,.78584,1)}69.15%{-webkit-transform:scaleX(.83);transform:scaleX(.83);-webkit-animation-timing-function:cubic-bezier(.22573,0,.23365,1.37098);animation-timing-function:cubic-bezier(.22573,0,.23365,1.37098)}100%{-webkit-transform:scaleX(.1);transform:scaleX(.1)}}@-webkit-keyframes md-progress-linear-indeterminate-1{0%{left:-105.16667%;-webkit-animation-timing-function:linear;animation-timing-function:linear}20%{left:-105.16667%;-webkit-animation-timing-function:cubic-bezier(.5,0,.70173,.49582);animation-timing-function:cubic-bezier(.5,0,.70173,.49582)}69.15%{left:21.5%;-webkit-animation-timing-function:cubic-bezier(.30244,.38135,.55,.95635);animation-timing-function:cubic-bezier(.30244,.38135,.55,.95635)}100%{left:95.44444%}}@keyframes md-progress-linear-indeterminate-1{0%{left:-105.16667%;-webkit-animation-timing-function:linear;animation-timing-function:linear}20%{left:-105.16667%;-webkit-animation-timing-function:cubic-bezier(.5,0,.70173,.49582);animation-timing-function:cubic-bezier(.5,0,.70173,.49582)}69.15%{left:21.5%;-webkit-animation-timing-function:cubic-bezier(.30244,.38135,.55,.95635);animation-timing-function:cubic-bezier(.30244,.38135,.55,.95635)}100%{left:95.44444%}}@-webkit-keyframes md-progress-linear-indeterminate-scale-2{0%{-webkit-transform:scaleX(.1);transform:scaleX(.1);-webkit-animation-timing-function:cubic-bezier(.20503,.05705,.57661,.45397);animation-timing-function:cubic-bezier(.20503,.05705,.57661,.45397)}19.15%{-webkit-transform:scaleX(.57);transform:scaleX(.57);-webkit-animation-timing-function:cubic-bezier(.15231,.19643,.64837,1.00432);animation-timing-function:cubic-bezier(.15231,.19643,.64837,1.00432)}44.15%{-webkit-transform:scaleX(.91);transform:scaleX(.91);-webkit-animation-timing-function:cubic-bezier(.25776,-.00316,.21176,1.38179);animation-timing-function:cubic-bezier(.25776,-.00316,.21176,1.38179)}100%{-webkit-transform:scaleX(.1);transform:scaleX(.1)}}@keyframes md-progress-linear-indeterminate-scale-2{0%{-webkit-transform:scaleX(.1);transform:scaleX(.1);-webkit-animation-timing-function:cubic-bezier(.20503,.05705,.57661,.45397);animation-timing-function:cubic-bezier(.20503,.05705,.57661,.45397)}19.15%{-webkit-transform:scaleX(.57);transform:scaleX(.57);-webkit-animation-timing-function:cubic-bezier(.15231,.19643,.64837,1.00432);animation-timing-function:cubic-bezier(.15231,.19643,.64837,1.00432)}44.15%{-webkit-transform:scaleX(.91);transform:scaleX(.91);-webkit-animation-timing-function:cubic-bezier(.25776,-.00316,.21176,1.38179);animation-timing-function:cubic-bezier(.25776,-.00316,.21176,1.38179)}100%{-webkit-transform:scaleX(.1);transform:scaleX(.1)}}@-webkit-keyframes md-progress-linear-indeterminate-2{0%{left:-54.88889%;-webkit-animation-timing-function:cubic-bezier(.15,0,.51506,.40968);animation-timing-function:cubic-bezier(.15,0,.51506,.40968)}25%{left:-17.25%;-webkit-animation-timing-function:cubic-bezier(.31033,.28406,.8,.73372);animation-timing-function:cubic-bezier(.31033,.28406,.8,.73372)}48.35%{left:29.5%;-webkit-animation-timing-function:cubic-bezier(.4,.62703,.6,.90203);animation-timing-function:cubic-bezier(.4,.62703,.6,.90203)}100%{left:117.38889%}}@keyframes md-progress-linear-indeterminate-2{0%{left:-54.88889%;-webkit-animation-timing-function:cubic-bezier(.15,0,.51506,.40968);animation-timing-function:cubic-bezier(.15,0,.51506,.40968)}25%{left:-17.25%;-webkit-animation-timing-function:cubic-bezier(.31033,.28406,.8,.73372);animation-timing-function:cubic-bezier(.31033,.28406,.8,.73372)}48.35%{left:29.5%;-webkit-animation-timing-function:cubic-bezier(.4,.62703,.6,.90203);animation-timing-function:cubic-bezier(.4,.62703,.6,.90203)}100%{left:117.38889%}}
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/
function MdProgressLinearDirective(e,r,a){function n(e,r,a){return e.attr("aria-valuemin",0),e.attr("aria-valuemax",100),e.attr("role","progressbar"),t}function t(n,t,l){function c(){l.$observe("value",function(e){var r=i(e);t.attr("aria-valuenow",r),g()!=m&&v(h,r)}),l.$observe("mdBufferValue",function(e){v(b,i(e))}),l.$observe("mdMode",function(e){switch(e){case m:case d:case o:case s:_.removeClass("ng-hide "+f),_.addClass(f="_md-mode-"+e);break;default:f&&_.removeClass(f),_.addClass("ng-hide"),f=void 0}})}function u(){if(angular.isUndefined(l.mdMode)){var e=angular.isDefined(l.value),n=e?o:s,i="Auto-adding the missing md-mode='{0}' to the ProgressLinear element";a.debug(r.supplant(i,[n])),t.attr("md-mode",n),l.mdMode=n}}function g(){var e=(l.mdMode||"").trim();if(e)switch(e){case o:case s:case d:case m:break;default:e=void 0}return e}function v(e,a){if(g()){var n=r.supplant("translateX({0}%) scale({1},1)",[(a-100)/2,a/100]),t=p({transform:n});angular.element(e).css(t)}}e(t);var f,p=r.dom.animator.toCss,b=angular.element(t[0].querySelector("._md-bar1")),h=angular.element(t[0].querySelector("._md-bar2")),_=angular.element(t[0].querySelector("._md-container"));t.attr("md-mode",g()),u(),c()}function i(e){return Math.max(0,Math.min(e||0,100))}var o="determinate",s="indeterminate",d="buffer",m="query";return{restrict:"E",template:'<div class="_md-container"><div class="_md-dashed"></div><div class="_md-bar _md-bar1"></div><div class="_md-bar _md-bar2"></div></div>',compile:n}}goog.provide("ng.material.components.progressLinear"),goog.require("ng.material.core"),angular.module("material.components.progressLinear",["material.core"]).directive("mdProgressLinear",MdProgressLinearDirective),MdProgressLinearDirective.$inject=["$mdTheming","$mdUtil","$log"],ng.material.components.progressLinear=angular.module("material.components.progressLinear");
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
md-radio-button.md-THEME_NAME-theme .md-off {
border-color: '{{foreground-2}}'; }
md-radio-button.md-THEME_NAME-theme .md-on {
background-color: '{{accent-color-0.87}}'; }
md-radio-button.md-THEME_NAME-theme.md-checked .md-off {
border-color: '{{accent-color-0.87}}'; }
md-radio-button.md-THEME_NAME-theme.md-checked .md-ink-ripple {
color: '{{accent-color-0.87}}'; }
md-radio-button.md-THEME_NAME-theme .md-container .md-ripple {
color: '{{accent-600}}'; }
md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-primary .md-on, md-radio-group.md-THEME_NAME-theme:not([disabled]).md-primary .md-on,
md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-primary .md-on,
md-radio-button.md-THEME_NAME-theme:not([disabled]).md-primary .md-on {
background-color: '{{primary-color-0.87}}'; }
md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-primary .md-checked .md-off, md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-primary.md-checked .md-off, md-radio-group.md-THEME_NAME-theme:not([disabled]).md-primary .md-checked .md-off, md-radio-group.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked .md-off,
md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-primary .md-checked .md-off,
md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-primary.md-checked .md-off,
md-radio-button.md-THEME_NAME-theme:not([disabled]).md-primary .md-checked .md-off,
md-radio-button.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked .md-off {
border-color: '{{primary-color-0.87}}'; }
md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-primary .md-checked .md-ink-ripple, md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-primary.md-checked .md-ink-ripple, md-radio-group.md-THEME_NAME-theme:not([disabled]).md-primary .md-checked .md-ink-ripple, md-radio-group.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked .md-ink-ripple,
md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-primary .md-checked .md-ink-ripple,
md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-primary.md-checked .md-ink-ripple,
md-radio-button.md-THEME_NAME-theme:not([disabled]).md-primary .md-checked .md-ink-ripple,
md-radio-button.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked .md-ink-ripple {
color: '{{primary-color-0.87}}'; }
md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-primary .md-container .md-ripple, md-radio-group.md-THEME_NAME-theme:not([disabled]).md-primary .md-container .md-ripple,
md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-primary .md-container .md-ripple,
md-radio-button.md-THEME_NAME-theme:not([disabled]).md-primary .md-container .md-ripple {
color: '{{primary-600}}'; }
md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-warn .md-on, md-radio-group.md-THEME_NAME-theme:not([disabled]).md-warn .md-on,
md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-warn .md-on,
md-radio-button.md-THEME_NAME-theme:not([disabled]).md-warn .md-on {
background-color: '{{warn-color-0.87}}'; }
md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-warn .md-checked .md-off, md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-warn.md-checked .md-off, md-radio-group.md-THEME_NAME-theme:not([disabled]).md-warn .md-checked .md-off, md-radio-group.md-THEME_NAME-theme:not([disabled]).md-warn.md-checked .md-off,
md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-warn .md-checked .md-off,
md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-warn.md-checked .md-off,
md-radio-button.md-THEME_NAME-theme:not([disabled]).md-warn .md-checked .md-off,
md-radio-button.md-THEME_NAME-theme:not([disabled]).md-warn.md-checked .md-off {
border-color: '{{warn-color-0.87}}'; }
md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-warn .md-checked .md-ink-ripple, md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-warn.md-checked .md-ink-ripple, md-radio-group.md-THEME_NAME-theme:not([disabled]).md-warn .md-checked .md-ink-ripple, md-radio-group.md-THEME_NAME-theme:not([disabled]).md-warn.md-checked .md-ink-ripple,
md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-warn .md-checked .md-ink-ripple,
md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-warn.md-checked .md-ink-ripple,
md-radio-button.md-THEME_NAME-theme:not([disabled]).md-warn .md-checked .md-ink-ripple,
md-radio-button.md-THEME_NAME-theme:not([disabled]).md-warn.md-checked .md-ink-ripple {
color: '{{warn-color-0.87}}'; }
md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-warn .md-container .md-ripple, md-radio-group.md-THEME_NAME-theme:not([disabled]).md-warn .md-container .md-ripple,
md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-warn .md-container .md-ripple,
md-radio-button.md-THEME_NAME-theme:not([disabled]).md-warn .md-container .md-ripple {
color: '{{warn-600}}'; }
md-radio-group.md-THEME_NAME-theme[disabled],
md-radio-button.md-THEME_NAME-theme[disabled] {
color: '{{foreground-3}}'; }
md-radio-group.md-THEME_NAME-theme[disabled] .md-container .md-off,
md-radio-button.md-THEME_NAME-theme[disabled] .md-container .md-off {
border-color: '{{foreground-3}}'; }
md-radio-group.md-THEME_NAME-theme[disabled] .md-container .md-on,
md-radio-button.md-THEME_NAME-theme[disabled] .md-container .md-on {
border-color: '{{foreground-3}}'; }
md-radio-group.md-THEME_NAME-theme .md-checked .md-ink-ripple {
color: '{{accent-color-0.26}}'; }
md-radio-group.md-THEME_NAME-theme.md-primary .md-checked:not([disabled]) .md-ink-ripple, md-radio-group.md-THEME_NAME-theme .md-checked:not([disabled]).md-primary .md-ink-ripple {
color: '{{primary-color-0.26}}'; }
md-radio-group.md-THEME_NAME-theme .md-checked.md-primary .md-ink-ripple {
color: '{{warn-color-0.26}}'; }
md-radio-group.md-THEME_NAME-theme.md-focused:not(:empty) .md-checked .md-container:before {
background-color: '{{accent-color-0.26}}'; }
md-radio-group.md-THEME_NAME-theme.md-focused:not(:empty).md-primary .md-checked .md-container:before,
md-radio-group.md-THEME_NAME-theme.md-focused:not(:empty) .md-checked.md-primary .md-container:before {
background-color: '{{primary-color-0.26}}'; }
md-radio-group.md-THEME_NAME-theme.md-focused:not(:empty).md-warn .md-checked .md-container:before,
md-radio-group.md-THEME_NAME-theme.md-focused:not(:empty) .md-checked.md-warn .md-container:before {
background-color: '{{warn-color-0.26}}'; }
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/md-radio-button.md-THEME_NAME-theme ._md-off{border-color:'{{foreground-2}}'}md-radio-button.md-THEME_NAME-theme ._md-on{background-color:'{{accent-color-0.87}}'}md-radio-button.md-THEME_NAME-theme.md-checked ._md-off{border-color:'{{accent-color-0.87}}'}md-radio-button.md-THEME_NAME-theme.md-checked .md-ink-ripple{color:'{{accent-color-0.87}}'}md-radio-button.md-THEME_NAME-theme ._md-container .md-ripple{color:'{{accent-600}}'}md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-primary ._md-on,md-radio-button.md-THEME_NAME-theme:not([disabled]).md-primary ._md-on,md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-primary ._md-on,md-radio-group.md-THEME_NAME-theme:not([disabled]).md-primary ._md-on{background-color:'{{primary-color-0.87}}'}md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-primary .md-checked ._md-off,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-primary.md-checked ._md-off,md-radio-button.md-THEME_NAME-theme:not([disabled]).md-primary .md-checked ._md-off,md-radio-button.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked ._md-off,md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-primary .md-checked ._md-off,md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-primary.md-checked ._md-off,md-radio-group.md-THEME_NAME-theme:not([disabled]).md-primary .md-checked ._md-off,md-radio-group.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked ._md-off{border-color:'{{primary-color-0.87}}'}md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-primary .md-checked .md-ink-ripple,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-primary.md-checked .md-ink-ripple,md-radio-button.md-THEME_NAME-theme:not([disabled]).md-primary .md-checked .md-ink-ripple,md-radio-button.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked .md-ink-ripple,md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-primary .md-checked .md-ink-ripple,md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-primary.md-checked .md-ink-ripple,md-radio-group.md-THEME_NAME-theme:not([disabled]).md-primary .md-checked .md-ink-ripple,md-radio-group.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked .md-ink-ripple{color:'{{primary-color-0.87}}'}md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-primary ._md-container .md-ripple,md-radio-button.md-THEME_NAME-theme:not([disabled]).md-primary ._md-container .md-ripple,md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-primary ._md-container .md-ripple,md-radio-group.md-THEME_NAME-theme:not([disabled]).md-primary ._md-container .md-ripple{color:'{{primary-600}}'}md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-warn ._md-on,md-radio-button.md-THEME_NAME-theme:not([disabled]).md-warn ._md-on,md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-warn ._md-on,md-radio-group.md-THEME_NAME-theme:not([disabled]).md-warn ._md-on{background-color:'{{warn-color-0.87}}'}md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-warn .md-checked ._md-off,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-warn.md-checked ._md-off,md-radio-button.md-THEME_NAME-theme:not([disabled]).md-warn .md-checked ._md-off,md-radio-button.md-THEME_NAME-theme:not([disabled]).md-warn.md-checked ._md-off,md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-warn .md-checked ._md-off,md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-warn.md-checked ._md-off,md-radio-group.md-THEME_NAME-theme:not([disabled]).md-warn .md-checked ._md-off,md-radio-group.md-THEME_NAME-theme:not([disabled]).md-warn.md-checked ._md-off{border-color:'{{warn-color-0.87}}'}md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-warn .md-checked .md-ink-ripple,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-warn.md-checked .md-ink-ripple,md-radio-button.md-THEME_NAME-theme:not([disabled]).md-warn .md-checked .md-ink-ripple,md-radio-button.md-THEME_NAME-theme:not([disabled]).md-warn.md-checked .md-ink-ripple,md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-warn .md-checked .md-ink-ripple,md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-warn.md-checked .md-ink-ripple,md-radio-group.md-THEME_NAME-theme:not([disabled]).md-warn .md-checked .md-ink-ripple,md-radio-group.md-THEME_NAME-theme:not([disabled]).md-warn.md-checked .md-ink-ripple{color:'{{warn-color-0.87}}'}md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-warn ._md-container .md-ripple,md-radio-button.md-THEME_NAME-theme:not([disabled]).md-warn ._md-container .md-ripple,md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-warn ._md-container .md-ripple,md-radio-group.md-THEME_NAME-theme:not([disabled]).md-warn ._md-container .md-ripple{color:'{{warn-600}}'}md-radio-button.md-THEME_NAME-theme[disabled],md-radio-group.md-THEME_NAME-theme[disabled]{color:'{{foreground-3}}'}md-radio-button.md-THEME_NAME-theme[disabled] ._md-container ._md-off,md-radio-button.md-THEME_NAME-theme[disabled] ._md-container ._md-on,md-radio-group.md-THEME_NAME-theme[disabled] ._md-container ._md-off,md-radio-group.md-THEME_NAME-theme[disabled] ._md-container ._md-on{border-color:'{{foreground-3}}'}md-radio-group.md-THEME_NAME-theme .md-checked .md-ink-ripple{color:'{{accent-color-0.26}}'}md-radio-group.md-THEME_NAME-theme .md-checked:not([disabled]).md-primary .md-ink-ripple,md-radio-group.md-THEME_NAME-theme.md-primary .md-checked:not([disabled]) .md-ink-ripple{color:'{{primary-color-0.26}}'}md-radio-group.md-THEME_NAME-theme .md-checked.md-primary .md-ink-ripple{color:'{{warn-color-0.26}}'}md-radio-group.md-THEME_NAME-theme.md-focused:not(:empty) .md-checked ._md-container:before{background-color:'{{accent-color-0.26}}'}md-radio-group.md-THEME_NAME-theme.md-focused:not(:empty) .md-checked.md-primary ._md-container:before,md-radio-group.md-THEME_NAME-theme.md-focused:not(:empty).md-primary .md-checked ._md-container:before{background-color:'{{primary-color-0.26}}'}md-radio-group.md-THEME_NAME-theme.md-focused:not(:empty) .md-checked.md-warn ._md-container:before,md-radio-group.md-THEME_NAME-theme.md-focused:not(:empty).md-warn .md-checked ._md-container:before{background-color:'{{warn-color-0.26}}'}
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
md-radio-button {
box-sizing: border-box;
display: block;
margin-bottom: 16px;
white-space: nowrap;
cursor: pointer;
position: relative; }
md-radio-button[disabled] {
cursor: default; }
md-radio-button[disabled] .md-container {
cursor: default; }
md-radio-button .md-container {
position: absolute;
top: 50%;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
box-sizing: border-box;
display: inline-block;
width: 20px;
height: 20px;
cursor: pointer;
left: 0;
right: auto; }
html[dir=rtl] md-radio-button .md-container {
left: auto;
unicode-bidi: embed; }
body[dir=rtl] md-radio-button .md-container {
left: auto;
unicode-bidi: embed; }
md-radio-button .md-container bdo[dir=rtl] {
direction: rtl;
unicode-bidi: bidi-override; }
md-radio-button .md-container bdo[dir=ltr] {
direction: ltr;
unicode-bidi: bidi-override; }
html[dir=rtl] md-radio-button .md-container {
right: 0;
unicode-bidi: embed; }
body[dir=rtl] md-radio-button .md-container {
right: 0;
unicode-bidi: embed; }
md-radio-button .md-container bdo[dir=rtl] {
direction: rtl;
unicode-bidi: bidi-override; }
md-radio-button .md-container bdo[dir=ltr] {
direction: ltr;
unicode-bidi: bidi-override; }
md-radio-button .md-container .md-ripple-container {
position: absolute;
display: block;
width: auto;
height: auto;
left: -15px;
top: -15px;
right: -15px;
bottom: -15px; }
md-radio-button .md-container:before {
box-sizing: border-box;
background-color: transparent;
border-radius: 50%;
content: '';
position: absolute;
display: block;
height: auto;
left: 0;
top: 0;
right: 0;
bottom: 0;
transition: all 0.5s;
width: auto; }
md-radio-button.md-align-top-left > div.md-container {
top: 12px; }
md-radio-button .md-off {
box-sizing: border-box;
position: absolute;
top: 0;
left: 0;
width: 20px;
height: 20px;
border-style: solid;
border-width: 2px;
border-radius: 50%;
transition: border-color ease 0.28s; }
md-radio-button .md-on {
box-sizing: border-box;
position: absolute;
top: 0;
left: 0;
width: 20px;
height: 20px;
border-radius: 50%;
transition: -webkit-transform ease 0.28s;
transition: transform ease 0.28s;
-webkit-transform: scale(0);
transform: scale(0); }
md-radio-button.md-checked .md-on {
-webkit-transform: scale(0.5);
transform: scale(0.5); }
md-radio-button .md-label {
box-sizing: border-box;
position: relative;
display: inline-block;
margin-left: 30px;
margin-right: 0;
vertical-align: middle;
white-space: normal;
pointer-events: none;
width: auto; }
html[dir=rtl] md-radio-button .md-label {
margin-left: 0;
unicode-bidi: embed; }
body[dir=rtl] md-radio-button .md-label {
margin-left: 0;
unicode-bidi: embed; }
md-radio-button .md-label bdo[dir=rtl] {
direction: rtl;
unicode-bidi: bidi-override; }
md-radio-button .md-label bdo[dir=ltr] {
direction: ltr;
unicode-bidi: bidi-override; }
html[dir=rtl] md-radio-button .md-label {
margin-right: 30px;
unicode-bidi: embed; }
body[dir=rtl] md-radio-button .md-label {
margin-right: 30px;
unicode-bidi: embed; }
md-radio-button .md-label bdo[dir=rtl] {
direction: rtl;
unicode-bidi: bidi-override; }
md-radio-button .md-label bdo[dir=ltr] {
direction: ltr;
unicode-bidi: bidi-override; }
md-radio-button .circle {
border-radius: 50%; }
md-radio-group md-radio-button:not(:first-child) {
margin-top: 16px; }
md-radio-group.layout-row md-radio-button {
margin-top: 0;
margin-bottom: 0;
margin-left: inherit;
margin-right: 16px; }
html[dir=rtl] md-radio-group.layout-row md-radio-button {
margin-left: 16px;
unicode-bidi: embed; }
body[dir=rtl] md-radio-group.layout-row md-radio-button {
margin-left: 16px;
unicode-bidi: embed; }
md-radio-group.layout-row md-radio-button bdo[dir=rtl] {
direction: rtl;
unicode-bidi: bidi-override; }
md-radio-group.layout-row md-radio-button bdo[dir=ltr] {
direction: ltr;
unicode-bidi: bidi-override; }
html[dir=rtl] md-radio-group.layout-row md-radio-button {
margin-right: inherit;
unicode-bidi: embed; }
body[dir=rtl] md-radio-group.layout-row md-radio-button {
margin-right: inherit;
unicode-bidi: embed; }
md-radio-group.layout-row md-radio-button bdo[dir=rtl] {
direction: rtl;
unicode-bidi: bidi-override; }
md-radio-group.layout-row md-radio-button bdo[dir=ltr] {
direction: ltr;
unicode-bidi: bidi-override; }
md-radio-group.layout-row md-radio-button:last-of-type {
margin-left: inherit;
margin-right: 0; }
html[dir=rtl] md-radio-group.layout-row md-radio-button:last-of-type {
margin-left: 0;
unicode-bidi: embed; }
body[dir=rtl] md-radio-group.layout-row md-radio-button:last-of-type {
margin-left: 0;
unicode-bidi: embed; }
md-radio-group.layout-row md-radio-button:last-of-type bdo[dir=rtl] {
direction: rtl;
unicode-bidi: bidi-override; }
md-radio-group.layout-row md-radio-button:last-of-type bdo[dir=ltr] {
direction: ltr;
unicode-bidi: bidi-override; }
html[dir=rtl] md-radio-group.layout-row md-radio-button:last-of-type {
margin-right: inherit;
unicode-bidi: embed; }
body[dir=rtl] md-radio-group.layout-row md-radio-button:last-of-type {
margin-right: inherit;
unicode-bidi: embed; }
md-radio-group.layout-row md-radio-button:last-of-type bdo[dir=rtl] {
direction: rtl;
unicode-bidi: bidi-override; }
md-radio-group.layout-row md-radio-button:last-of-type bdo[dir=ltr] {
direction: ltr;
unicode-bidi: bidi-override; }
md-radio-group:focus {
outline: none; }
md-radio-group.md-focused .md-checked .md-container:before {
left: -8px;
top: -8px;
right: -8px;
bottom: -8px; }
.md-inline-form md-radio-group {
margin: 18px 0 19px; }
.md-inline-form md-radio-group md-radio-button {
display: inline-block;
height: 30px;
padding: 2px;
box-sizing: border-box;
margin-top: 0;
margin-bottom: 0; }
@media screen and (-ms-high-contrast: active) {
md-radio-button.md-default-theme .md-on {
background-color: #fff; } }
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
goog.provide('ng.material.components.radioButton');
goog.require('ng.material.core');
/**
* @ngdoc module
* @name material.components.radioButton
* @description radioButton module!
*/
angular.module('material.components.radioButton', [
'material.core'
])
.directive('mdRadioGroup', mdRadioGroupDirective)
.directive('mdRadioButton', mdRadioButtonDirective);
/**
* @ngdoc directive
* @module material.components.radioButton
* @name mdRadioGroup
*
* @restrict E
*
* @description
* The `<md-radio-group>` directive identifies a grouping
* container for the 1..n grouped radio buttons; specified using nested
* `<md-radio-button>` tags.
*
* As per the [material design spec](http://www.google.com/design/spec/style/color.html#color-ui-color-application)
* the radio button is in the accent color by default. The primary color palette may be used with
* the `md-primary` class.
*
* Note: `<md-radio-group>` and `<md-radio-button>` handle tabindex differently
* than the native `<input type='radio'>` controls. Whereas the native controls
* force the user to tab through all the radio buttons, `<md-radio-group>`
* is focusable, and by default the `<md-radio-button>`s are not.
*
* @param {string} ng-model Assignable angular expression to data-bind to.
* @param {boolean=} md-no-ink Use of attribute indicates flag to disable ink ripple effects.
*
* @usage
* <hljs lang="html">
* <md-radio-group ng-model="selected">
*
* <md-radio-button
* ng-repeat="d in colorOptions"
* ng-value="d.value" aria-label="{{ d.label }}">
*
* {{ d.label }}
*
* </md-radio-button>
*
* </md-radio-group>
* </hljs>
*
*/
function mdRadioGroupDirective($mdUtil, $mdConstant, $mdTheming, $timeout) {
RadioGroupController.prototype = createRadioGroupControllerProto();
return {
restrict: 'E',
controller: ['$element', RadioGroupController],
require: ['mdRadioGroup', '?ngModel'],
link: { pre: linkRadioGroup }
};
function linkRadioGroup(scope, element, attr, ctrls) {
$mdTheming(element);
var rgCtrl = ctrls[0];
var ngModelCtrl = ctrls[1] || $mdUtil.fakeNgModel();
rgCtrl.init(ngModelCtrl);
scope.mouseActive = false;
element.attr({
'role': 'radiogroup',
'tabIndex': element.attr('tabindex') || '0'
})
.on('keydown', keydownListener)
.on('mousedown', function(event) {
scope.mouseActive = true;
$timeout(function() {
scope.mouseActive = false;
}, 100);
})
.on('focus', function() {
if(scope.mouseActive === false) { rgCtrl.$element.addClass('md-focused'); }
})
.on('blur', function() { rgCtrl.$element.removeClass('md-focused'); });
/**
*
*/
function setFocus() {
if (!element.hasClass('md-focused')) { element.addClass('md-focused'); }
}
/**
*
*/
function keydownListener(ev) {
var keyCode = ev.which || ev.keyCode;
// Only listen to events that we originated ourselves
// so that we don't trigger on things like arrow keys in
// inputs.
if (keyCode != $mdConstant.KEY_CODE.ENTER &&
ev.currentTarget != ev.target) {
return;
}
switch (keyCode) {
case $mdConstant.KEY_CODE.LEFT_ARROW:
case $mdConstant.KEY_CODE.UP_ARROW:
ev.preventDefault();
rgCtrl.selectPrevious();
setFocus();
break;
case $mdConstant.KEY_CODE.RIGHT_ARROW:
case $mdConstant.KEY_CODE.DOWN_ARROW:
ev.preventDefault();
rgCtrl.selectNext();
setFocus();
break;
case $mdConstant.KEY_CODE.ENTER:
var form = angular.element($mdUtil.getClosest(element[0], 'form'));
if (form.length > 0) {
form.triggerHandler('submit');
}
break;
}
}
}
function RadioGroupController($element) {
this._radioButtonRenderFns = [];
this.$element = $element;
}
function createRadioGroupControllerProto() {
return {
init: function(ngModelCtrl) {
this._ngModelCtrl = ngModelCtrl;
this._ngModelCtrl.$render = angular.bind(this, this.render);
},
add: function(rbRender) {
this._radioButtonRenderFns.push(rbRender);
},
remove: function(rbRender) {
var index = this._radioButtonRenderFns.indexOf(rbRender);
if (index !== -1) {
this._radioButtonRenderFns.splice(index, 1);
}
},
render: function() {
this._radioButtonRenderFns.forEach(function(rbRender) {
rbRender();
});
},
setViewValue: function(value, eventType) {
this._ngModelCtrl.$setViewValue(value, eventType);
// update the other radio buttons as well
this.render();
},
getViewValue: function() {
return this._ngModelCtrl.$viewValue;
},
selectNext: function() {
return changeSelectedButton(this.$element, 1);
},
selectPrevious: function() {
return changeSelectedButton(this.$element, -1);
},
setActiveDescendant: function (radioId) {
this.$element.attr('aria-activedescendant', radioId);
}
};
}
/**
* Change the radio group's selected button by a given increment.
* If no button is selected, select the first button.
*/
function changeSelectedButton(parent, increment) {
// Coerce all child radio buttons into an array, then wrap then in an iterator
var buttons = $mdUtil.iterator(parent[0].querySelectorAll('md-radio-button'), true);
if (buttons.count()) {
var validate = function (button) {
// If disabled, then NOT valid
return !angular.element(button).attr("disabled");
};
var selected = parent[0].querySelector('md-radio-button.md-checked');
var target = buttons[increment < 0 ? 'previous' : 'next'](selected, validate) || buttons.first();
// Activate radioButton's click listener (triggerHandler won't create a real click event)
angular.element(target).triggerHandler('click');
}
}
}
mdRadioGroupDirective.$inject = ["$mdUtil", "$mdConstant", "$mdTheming", "$timeout"];
/**
* @ngdoc directive
* @module material.components.radioButton
* @name mdRadioButton
*
* @restrict E
*
* @description
* The `<md-radio-button>`directive is the child directive required to be used within `<md-radio-group>` elements.
*
* While similar to the `<input type="radio" ng-model="" value="">` directive,
* the `<md-radio-button>` directive provides ink effects, ARIA support, and
* supports use within named radio groups.
*
* @param {string} ngModel Assignable angular expression to data-bind to.
* @param {string=} ngChange Angular expression to be executed when input changes due to user
* interaction with the input element.
* @param {string} ngValue Angular expression which sets the value to which the expression should
* be set when selected.
* @param {string} value The value to which the expression should be set when selected.
* @param {string=} name Property name of the form under which the control is published.
* @param {string=} aria-label Adds label to radio button for accessibility.
* Defaults to radio button's text. If no text content is available, a warning will be logged.
*
* @usage
* <hljs lang="html">
*
* <md-radio-button value="1" aria-label="Label 1">
* Label 1
* </md-radio-button>
*
* <md-radio-button ng-model="color" ng-value="specialValue" aria-label="Green">
* Green
* </md-radio-button>
*
* </hljs>
*
*/
function mdRadioButtonDirective($mdAria, $mdUtil, $mdTheming) {
var CHECKED_CSS = 'md-checked';
return {
restrict: 'E',
require: '^mdRadioGroup',
transclude: true,
template: '<div class="md-container" md-ink-ripple md-ink-ripple-checkbox>' +
'<div class="md-off"></div>' +
'<div class="md-on"></div>' +
'</div>' +
'<div ng-transclude class="md-label"></div>',
link: link
};
function link(scope, element, attr, rgCtrl) {
var lastChecked;
$mdTheming(element);
configureAria(element, scope);
initialize();
/**
*
*/
function initialize(controller) {
if ( !rgCtrl ) {
throw 'RadioGroupController not found.';
}
rgCtrl.add(render);
attr.$observe('value', render);
element
.on('click', listener)
.on('$destroy', function() {
rgCtrl.remove(render);
});
}
/**
*
*/
function listener(ev) {
if (element[0].hasAttribute('disabled')) return;
scope.$apply(function() {
rgCtrl.setViewValue(attr.value, ev && ev.type);
});
}
/**
* Add or remove the `.md-checked` class from the RadioButton (and conditionally its parent).
* Update the `aria-activedescendant` attribute.
*/
function render() {
var checked = (rgCtrl.getViewValue() == attr.value);
if (checked === lastChecked) {
return;
}
lastChecked = checked;
element.attr('aria-checked', checked);
if (checked) {
markParentAsChecked(true);
element.addClass(CHECKED_CSS);
rgCtrl.setActiveDescendant(element.attr('id'));
} else {
markParentAsChecked(false);
element.removeClass(CHECKED_CSS);
}
/**
* If the radioButton is inside a div, then add class so highlighting will work...
*/
function markParentAsChecked(addClass ) {
if ( element.parent()[0].nodeName != "MD-RADIO-GROUP") {
element.parent()[ !!addClass ? 'addClass' : 'removeClass'](CHECKED_CSS);
}
}
}
/**
* Inject ARIA-specific attributes appropriate for each radio button
*/
function configureAria( element, scope ){
scope.ariaId = buildAriaID();
element.attr({
'id' : scope.ariaId,
'role' : 'radio',
'aria-checked' : 'false'
});
$mdAria.expectWithText(element, 'aria-label');
/**
* Build a unique ID for each radio button that will be used with aria-activedescendant.
* Preserve existing ID if already specified.
* @returns {*|string}
*/
function buildAriaID() {
return attr.id || ( 'radio' + "_" + $mdUtil.nextUid() );
}
}
}
}
mdRadioButtonDirective.$inject = ["$mdAria", "$mdUtil", "$mdTheming"];
ng.material.components.radioButton = angular.module("material.components.radioButton");
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/md-radio-button{box-sizing:border-box;display:block;margin-bottom:16px;white-space:nowrap;cursor:pointer;position:relative}md-radio-button[disabled],md-radio-button[disabled] ._md-container{cursor:default}md-radio-button ._md-container{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);box-sizing:border-box;display:inline-block;width:20px;height:20px;cursor:pointer}body[dir=ltr] md-radio-button ._md-container,html[dir=ltr] md-radio-button ._md-container{left:0}body[dir=rtl] md-radio-button ._md-container,html[dir=rtl] md-radio-button ._md-container{left:auto}html:not([dir]) body:not([dir]) md-radio-button ._md-container{left:0}body[dir=ltr] md-radio-button ._md-container,html[dir=ltr] md-radio-button ._md-container{right:auto;unicode-bidi:embed}body[dir=rtl] md-radio-button ._md-container,html[dir=rtl] md-radio-button ._md-container{right:0;unicode-bidi:embed}html:not([dir]) body:not([dir]) md-radio-button ._md-container{right:auto;unicode-bidi:embed}md-radio-button ._md-container bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}md-radio-button ._md-container bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}md-radio-button ._md-container .md-ripple-container{position:absolute;display:block;width:auto;height:auto;left:-15px;top:-15px;right:-15px;bottom:-15px}md-radio-button ._md-container:before{box-sizing:border-box;background-color:transparent;border-radius:50%;content:'';position:absolute;display:block;height:auto;left:0;top:0;right:0;bottom:0;transition:all .5s;width:auto}md-radio-button.md-align-top-left>div._md-container{top:12px}md-radio-button ._md-off{box-sizing:border-box;position:absolute;top:0;left:0;width:20px;height:20px;border-style:solid;border-width:2px;border-radius:50%;transition:border-color ease .28s}md-radio-button ._md-on{box-sizing:border-box;position:absolute;top:0;left:0;width:20px;height:20px;border-radius:50%;transition:-webkit-transform ease .28s;transition:transform ease .28s;-webkit-transform:scale(0);transform:scale(0)}md-radio-button.md-checked ._md-on{-webkit-transform:scale(.5);transform:scale(.5)}md-radio-button ._md-label{box-sizing:border-box;position:relative;display:inline-block;vertical-align:middle;white-space:normal;pointer-events:none;width:auto}body[dir=ltr] md-radio-button ._md-label,html[dir=ltr] md-radio-button ._md-label{margin-left:30px}body[dir=rtl] md-radio-button ._md-label,html[dir=rtl] md-radio-button ._md-label{margin-left:0}html:not([dir]) body:not([dir]) md-radio-button ._md-label{margin-left:30px}body[dir=ltr] md-radio-button ._md-label,html[dir=ltr] md-radio-button ._md-label{margin-right:0;unicode-bidi:embed}body[dir=rtl] md-radio-button ._md-label,html[dir=rtl] md-radio-button ._md-label{margin-right:30px;unicode-bidi:embed}html:not([dir]) body:not([dir]) md-radio-button ._md-label{margin-right:0;unicode-bidi:embed}md-radio-button ._md-label bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}md-radio-button ._md-label bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}md-radio-group.layout-column md-radio-button,md-radio-group.layout-gt-lg-column md-radio-button,md-radio-group.layout-gt-md-column md-radio-button,md-radio-group.layout-gt-sm-column md-radio-button,md-radio-group.layout-gt-xs-column md-radio-button,md-radio-group.layout-lg-column md-radio-button,md-radio-group.layout-md-column md-radio-button,md-radio-group.layout-sm-column md-radio-button,md-radio-group.layout-xl-column md-radio-button,md-radio-group.layout-xs-column md-radio-button{margin-bottom:16px}md-radio-group.layout-gt-lg-row md-radio-button,md-radio-group.layout-gt-md-row md-radio-button,md-radio-group.layout-gt-sm-row md-radio-button,md-radio-group.layout-gt-xs-row md-radio-button,md-radio-group.layout-lg-row md-radio-button,md-radio-group.layout-md-row md-radio-button,md-radio-group.layout-row md-radio-button,md-radio-group.layout-sm-row md-radio-button,md-radio-group.layout-xl-row md-radio-button,md-radio-group.layout-xs-row md-radio-button{margin-top:0;margin-bottom:0}body[dir=ltr] md-radio-group.layout-gt-lg-row md-radio-button,body[dir=ltr] md-radio-group.layout-gt-md-row md-radio-button,body[dir=ltr] md-radio-group.layout-gt-sm-row md-radio-button,body[dir=ltr] md-radio-group.layout-gt-xs-row md-radio-button,body[dir=ltr] md-radio-group.layout-lg-row md-radio-button,body[dir=ltr] md-radio-group.layout-md-row md-radio-button,body[dir=ltr] md-radio-group.layout-row md-radio-button,body[dir=ltr] md-radio-group.layout-sm-row md-radio-button,body[dir=ltr] md-radio-group.layout-xl-row md-radio-button,body[dir=ltr] md-radio-group.layout-xs-row md-radio-button,html[dir=ltr] md-radio-group.layout-gt-lg-row md-radio-button,html[dir=ltr] md-radio-group.layout-gt-md-row md-radio-button,html[dir=ltr] md-radio-group.layout-gt-sm-row md-radio-button,html[dir=ltr] md-radio-group.layout-gt-xs-row md-radio-button,html[dir=ltr] md-radio-group.layout-lg-row md-radio-button,html[dir=ltr] md-radio-group.layout-md-row md-radio-button,html[dir=ltr] md-radio-group.layout-row md-radio-button,html[dir=ltr] md-radio-group.layout-sm-row md-radio-button,html[dir=ltr] md-radio-group.layout-xl-row md-radio-button,html[dir=ltr] md-radio-group.layout-xs-row md-radio-button{margin-left:inherit}body[dir=rtl] md-radio-group.layout-gt-lg-row md-radio-button,body[dir=rtl] md-radio-group.layout-gt-md-row md-radio-button,body[dir=rtl] md-radio-group.layout-gt-sm-row md-radio-button,body[dir=rtl] md-radio-group.layout-gt-xs-row md-radio-button,body[dir=rtl] md-radio-group.layout-lg-row md-radio-button,body[dir=rtl] md-radio-group.layout-md-row md-radio-button,body[dir=rtl] md-radio-group.layout-row md-radio-button,body[dir=rtl] md-radio-group.layout-sm-row md-radio-button,body[dir=rtl] md-radio-group.layout-xl-row md-radio-button,body[dir=rtl] md-radio-group.layout-xs-row md-radio-button,html[dir=rtl] md-radio-group.layout-gt-lg-row md-radio-button,html[dir=rtl] md-radio-group.layout-gt-md-row md-radio-button,html[dir=rtl] md-radio-group.layout-gt-sm-row md-radio-button,html[dir=rtl] md-radio-group.layout-gt-xs-row md-radio-button,html[dir=rtl] md-radio-group.layout-lg-row md-radio-button,html[dir=rtl] md-radio-group.layout-md-row md-radio-button,html[dir=rtl] md-radio-group.layout-row md-radio-button,html[dir=rtl] md-radio-group.layout-sm-row md-radio-button,html[dir=rtl] md-radio-group.layout-xl-row md-radio-button,html[dir=rtl] md-radio-group.layout-xs-row md-radio-button{margin-left:16px}html:not([dir]) body:not([dir]) md-radio-group.layout-gt-lg-row md-radio-button,html:not([dir]) body:not([dir]) md-radio-group.layout-gt-md-row md-radio-button,html:not([dir]) body:not([dir]) md-radio-group.layout-gt-sm-row md-radio-button,html:not([dir]) body:not([dir]) md-radio-group.layout-gt-xs-row md-radio-button,html:not([dir]) body:not([dir]) md-radio-group.layout-lg-row md-radio-button,html:not([dir]) body:not([dir]) md-radio-group.layout-md-row md-radio-button,html:not([dir]) body:not([dir]) md-radio-group.layout-row md-radio-button,html:not([dir]) body:not([dir]) md-radio-group.layout-sm-row md-radio-button,html:not([dir]) body:not([dir]) md-radio-group.layout-xl-row md-radio-button,html:not([dir]) body:not([dir]) md-radio-group.layout-xs-row md-radio-button{margin-left:inherit}body[dir=ltr] md-radio-group.layout-gt-lg-row md-radio-button,body[dir=ltr] md-radio-group.layout-gt-md-row md-radio-button,body[dir=ltr] md-radio-group.layout-gt-sm-row md-radio-button,body[dir=ltr] md-radio-group.layout-gt-xs-row md-radio-button,body[dir=ltr] md-radio-group.layout-lg-row md-radio-button,body[dir=ltr] md-radio-group.layout-md-row md-radio-button,body[dir=ltr] md-radio-group.layout-row md-radio-button,body[dir=ltr] md-radio-group.layout-sm-row md-radio-button,body[dir=ltr] md-radio-group.layout-xl-row md-radio-button,body[dir=ltr] md-radio-group.layout-xs-row md-radio-button,html[dir=ltr] md-radio-group.layout-gt-lg-row md-radio-button,html[dir=ltr] md-radio-group.layout-gt-md-row md-radio-button,html[dir=ltr] md-radio-group.layout-gt-sm-row md-radio-button,html[dir=ltr] md-radio-group.layout-gt-xs-row md-radio-button,html[dir=ltr] md-radio-group.layout-lg-row md-radio-button,html[dir=ltr] md-radio-group.layout-md-row md-radio-button,html[dir=ltr] md-radio-group.layout-row md-radio-button,html[dir=ltr] md-radio-group.layout-sm-row md-radio-button,html[dir=ltr] md-radio-group.layout-xl-row md-radio-button,html[dir=ltr] md-radio-group.layout-xs-row md-radio-button{margin-right:16px;unicode-bidi:embed}body[dir=rtl] md-radio-group.layout-gt-lg-row md-radio-button,body[dir=rtl] md-radio-group.layout-gt-md-row md-radio-button,body[dir=rtl] md-radio-group.layout-gt-sm-row md-radio-button,body[dir=rtl] md-radio-group.layout-gt-xs-row md-radio-button,body[dir=rtl] md-radio-group.layout-lg-row md-radio-button,body[dir=rtl] md-radio-group.layout-md-row md-radio-button,body[dir=rtl] md-radio-group.layout-row md-radio-button,body[dir=rtl] md-radio-group.layout-sm-row md-radio-button,body[dir=rtl] md-radio-group.layout-xl-row md-radio-button,body[dir=rtl] md-radio-group.layout-xs-row md-radio-button,html[dir=rtl] md-radio-group.layout-gt-lg-row md-radio-button,html[dir=rtl] md-radio-group.layout-gt-md-row md-radio-button,html[dir=rtl] md-radio-group.layout-gt-sm-row md-radio-button,html[dir=rtl] md-radio-group.layout-gt-xs-row md-radio-button,html[dir=rtl] md-radio-group.layout-lg-row md-radio-button,html[dir=rtl] md-radio-group.layout-md-row md-radio-button,html[dir=rtl] md-radio-group.layout-row md-radio-button,html[dir=rtl] md-radio-group.layout-sm-row md-radio-button,html[dir=rtl] md-radio-group.layout-xl-row md-radio-button,html[dir=rtl] md-radio-group.layout-xs-row md-radio-button{margin-right:inherit;unicode-bidi:embed}html:not([dir]) body:not([dir]) md-radio-group.layout-gt-lg-row md-radio-button,html:not([dir]) body:not([dir]) md-radio-group.layout-gt-md-row md-radio-button,html:not([dir]) body:not([dir]) md-radio-group.layout-gt-sm-row md-radio-button,html:not([dir]) body:not([dir]) md-radio-group.layout-gt-xs-row md-radio-button,html:not([dir]) body:not([dir]) md-radio-group.layout-lg-row md-radio-button,html:not([dir]) body:not([dir]) md-radio-group.layout-md-row md-radio-button,html:not([dir]) body:not([dir]) md-radio-group.layout-row md-radio-button,html:not([dir]) body:not([dir]) md-radio-group.layout-sm-row md-radio-button,html:not([dir]) body:not([dir]) md-radio-group.layout-xl-row md-radio-button,html:not([dir]) body:not([dir]) md-radio-group.layout-xs-row md-radio-button{margin-right:16px;unicode-bidi:embed}md-radio-group.layout-gt-lg-row md-radio-button bdo[dir=rtl],md-radio-group.layout-gt-md-row md-radio-button bdo[dir=rtl],md-radio-group.layout-gt-sm-row md-radio-button bdo[dir=rtl],md-radio-group.layout-gt-xs-row md-radio-button bdo[dir=rtl],md-radio-group.layout-lg-row md-radio-button bdo[dir=rtl],md-radio-group.layout-md-row md-radio-button bdo[dir=rtl],md-radio-group.layout-row md-radio-button bdo[dir=rtl],md-radio-group.layout-sm-row md-radio-button bdo[dir=rtl],md-radio-group.layout-xl-row md-radio-button bdo[dir=rtl],md-radio-group.layout-xs-row md-radio-button bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}md-radio-group.layout-gt-lg-row md-radio-button bdo[dir=ltr],md-radio-group.layout-gt-md-row md-radio-button bdo[dir=ltr],md-radio-group.layout-gt-sm-row md-radio-button bdo[dir=ltr],md-radio-group.layout-gt-xs-row md-radio-button bdo[dir=ltr],md-radio-group.layout-lg-row md-radio-button bdo[dir=ltr],md-radio-group.layout-md-row md-radio-button bdo[dir=ltr],md-radio-group.layout-row md-radio-button bdo[dir=ltr],md-radio-group.layout-sm-row md-radio-button bdo[dir=ltr],md-radio-group.layout-xl-row md-radio-button bdo[dir=ltr],md-radio-group.layout-xs-row md-radio-button bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}body[dir=ltr] md-radio-group.layout-gt-lg-row md-radio-button:last-of-type,body[dir=ltr] md-radio-group.layout-gt-md-row md-radio-button:last-of-type,body[dir=ltr] md-radio-group.layout-gt-sm-row md-radio-button:last-of-type,body[dir=ltr] md-radio-group.layout-gt-xs-row md-radio-button:last-of-type,body[dir=ltr] md-radio-group.layout-lg-row md-radio-button:last-of-type,body[dir=ltr] md-radio-group.layout-md-row md-radio-button:last-of-type,body[dir=ltr] md-radio-group.layout-row md-radio-button:last-of-type,body[dir=ltr] md-radio-group.layout-sm-row md-radio-button:last-of-type,body[dir=ltr] md-radio-group.layout-xl-row md-radio-button:last-of-type,body[dir=ltr] md-radio-group.layout-xs-row md-radio-button:last-of-type,html[dir=ltr] md-radio-group.layout-gt-lg-row md-radio-button:last-of-type,html[dir=ltr] md-radio-group.layout-gt-md-row md-radio-button:last-of-type,html[dir=ltr] md-radio-group.layout-gt-sm-row md-radio-button:last-of-type,html[dir=ltr] md-radio-group.layout-gt-xs-row md-radio-button:last-of-type,html[dir=ltr] md-radio-group.layout-lg-row md-radio-button:last-of-type,html[dir=ltr] md-radio-group.layout-md-row md-radio-button:last-of-type,html[dir=ltr] md-radio-group.layout-row md-radio-button:last-of-type,html[dir=ltr] md-radio-group.layout-sm-row md-radio-button:last-of-type,html[dir=ltr] md-radio-group.layout-xl-row md-radio-button:last-of-type,html[dir=ltr] md-radio-group.layout-xs-row md-radio-button:last-of-type{margin-left:inherit}body[dir=rtl] md-radio-group.layout-gt-lg-row md-radio-button:last-of-type,body[dir=rtl] md-radio-group.layout-gt-md-row md-radio-button:last-of-type,body[dir=rtl] md-radio-group.layout-gt-sm-row md-radio-button:last-of-type,body[dir=rtl] md-radio-group.layout-gt-xs-row md-radio-button:last-of-type,body[dir=rtl] md-radio-group.layout-lg-row md-radio-button:last-of-type,body[dir=rtl] md-radio-group.layout-md-row md-radio-button:last-of-type,body[dir=rtl] md-radio-group.layout-row md-radio-button:last-of-type,body[dir=rtl] md-radio-group.layout-sm-row md-radio-button:last-of-type,body[dir=rtl] md-radio-group.layout-xl-row md-radio-button:last-of-type,body[dir=rtl] md-radio-group.layout-xs-row md-radio-button:last-of-type,html[dir=rtl] md-radio-group.layout-gt-lg-row md-radio-button:last-of-type,html[dir=rtl] md-radio-group.layout-gt-md-row md-radio-button:last-of-type,html[dir=rtl] md-radio-group.layout-gt-sm-row md-radio-button:last-of-type,html[dir=rtl] md-radio-group.layout-gt-xs-row md-radio-button:last-of-type,html[dir=rtl] md-radio-group.layout-lg-row md-radio-button:last-of-type,html[dir=rtl] md-radio-group.layout-md-row md-radio-button:last-of-type,html[dir=rtl] md-radio-group.layout-row md-radio-button:last-of-type,html[dir=rtl] md-radio-group.layout-sm-row md-radio-button:last-of-type,html[dir=rtl] md-radio-group.layout-xl-row md-radio-button:last-of-type,html[dir=rtl] md-radio-group.layout-xs-row md-radio-button:last-of-type{margin-left:0}html:not([dir]) body:not([dir]) md-radio-group.layout-gt-lg-row md-radio-button:last-of-type,html:not([dir]) body:not([dir]) md-radio-group.layout-gt-md-row md-radio-button:last-of-type,html:not([dir]) body:not([dir]) md-radio-group.layout-gt-sm-row md-radio-button:last-of-type,html:not([dir]) body:not([dir]) md-radio-group.layout-gt-xs-row md-radio-button:last-of-type,html:not([dir]) body:not([dir]) md-radio-group.layout-lg-row md-radio-button:last-of-type,html:not([dir]) body:not([dir]) md-radio-group.layout-md-row md-radio-button:last-of-type,html:not([dir]) body:not([dir]) md-radio-group.layout-row md-radio-button:last-of-type,html:not([dir]) body:not([dir]) md-radio-group.layout-sm-row md-radio-button:last-of-type,html:not([dir]) body:not([dir]) md-radio-group.layout-xl-row md-radio-button:last-of-type,html:not([dir]) body:not([dir]) md-radio-group.layout-xs-row md-radio-button:last-of-type{margin-left:inherit}body[dir=ltr] md-radio-group.layout-gt-lg-row md-radio-button:last-of-type,body[dir=ltr] md-radio-group.layout-gt-md-row md-radio-button:last-of-type,body[dir=ltr] md-radio-group.layout-gt-sm-row md-radio-button:last-of-type,body[dir=ltr] md-radio-group.layout-gt-xs-row md-radio-button:last-of-type,body[dir=ltr] md-radio-group.layout-lg-row md-radio-button:last-of-type,body[dir=ltr] md-radio-group.layout-md-row md-radio-button:last-of-type,body[dir=ltr] md-radio-group.layout-row md-radio-button:last-of-type,body[dir=ltr] md-radio-group.layout-sm-row md-radio-button:last-of-type,body[dir=ltr] md-radio-group.layout-xl-row md-radio-button:last-of-type,body[dir=ltr] md-radio-group.layout-xs-row md-radio-button:last-of-type,html[dir=ltr] md-radio-group.layout-gt-lg-row md-radio-button:last-of-type,html[dir=ltr] md-radio-group.layout-gt-md-row md-radio-button:last-of-type,html[dir=ltr] md-radio-group.layout-gt-sm-row md-radio-button:last-of-type,html[dir=ltr] md-radio-group.layout-gt-xs-row md-radio-button:last-of-type,html[dir=ltr] md-radio-group.layout-lg-row md-radio-button:last-of-type,html[dir=ltr] md-radio-group.layout-md-row md-radio-button:last-of-type,html[dir=ltr] md-radio-group.layout-row md-radio-button:last-of-type,html[dir=ltr] md-radio-group.layout-sm-row md-radio-button:last-of-type,html[dir=ltr] md-radio-group.layout-xl-row md-radio-button:last-of-type,html[dir=ltr] md-radio-group.layout-xs-row md-radio-button:last-of-type{margin-right:0;unicode-bidi:embed}body[dir=rtl] md-radio-group.layout-gt-lg-row md-radio-button:last-of-type,body[dir=rtl] md-radio-group.layout-gt-md-row md-radio-button:last-of-type,body[dir=rtl] md-radio-group.layout-gt-sm-row md-radio-button:last-of-type,body[dir=rtl] md-radio-group.layout-gt-xs-row md-radio-button:last-of-type,body[dir=rtl] md-radio-group.layout-lg-row md-radio-button:last-of-type,body[dir=rtl] md-radio-group.layout-md-row md-radio-button:last-of-type,body[dir=rtl] md-radio-group.layout-row md-radio-button:last-of-type,body[dir=rtl] md-radio-group.layout-sm-row md-radio-button:last-of-type,body[dir=rtl] md-radio-group.layout-xl-row md-radio-button:last-of-type,body[dir=rtl] md-radio-group.layout-xs-row md-radio-button:last-of-type,html[dir=rtl] md-radio-group.layout-gt-lg-row md-radio-button:last-of-type,html[dir=rtl] md-radio-group.layout-gt-md-row md-radio-button:last-of-type,html[dir=rtl] md-radio-group.layout-gt-sm-row md-radio-button:last-of-type,html[dir=rtl] md-radio-group.layout-gt-xs-row md-radio-button:last-of-type,html[dir=rtl] md-radio-group.layout-lg-row md-radio-button:last-of-type,html[dir=rtl] md-radio-group.layout-md-row md-radio-button:last-of-type,html[dir=rtl] md-radio-group.layout-row md-radio-button:last-of-type,html[dir=rtl] md-radio-group.layout-sm-row md-radio-button:last-of-type,html[dir=rtl] md-radio-group.layout-xl-row md-radio-button:last-of-type,html[dir=rtl] md-radio-group.layout-xs-row md-radio-button:last-of-type{margin-right:inherit;unicode-bidi:embed}html:not([dir]) body:not([dir]) md-radio-group.layout-gt-lg-row md-radio-button:last-of-type,html:not([dir]) body:not([dir]) md-radio-group.layout-gt-md-row md-radio-button:last-of-type,html:not([dir]) body:not([dir]) md-radio-group.layout-gt-sm-row md-radio-button:last-of-type,html:not([dir]) body:not([dir]) md-radio-group.layout-gt-xs-row md-radio-button:last-of-type,html:not([dir]) body:not([dir]) md-radio-group.layout-lg-row md-radio-button:last-of-type,html:not([dir]) body:not([dir]) md-radio-group.layout-md-row md-radio-button:last-of-type,html:not([dir]) body:not([dir]) md-radio-group.layout-row md-radio-button:last-of-type,html:not([dir]) body:not([dir]) md-radio-group.layout-sm-row md-radio-button:last-of-type,html:not([dir]) body:not([dir]) md-radio-group.layout-xl-row md-radio-button:last-of-type,html:not([dir]) body:not([dir]) md-radio-group.layout-xs-row md-radio-button:last-of-type{margin-right:0;unicode-bidi:embed}md-radio-group.layout-gt-lg-row md-radio-button:last-of-type bdo[dir=rtl],md-radio-group.layout-gt-md-row md-radio-button:last-of-type bdo[dir=rtl],md-radio-group.layout-gt-sm-row md-radio-button:last-of-type bdo[dir=rtl],md-radio-group.layout-gt-xs-row md-radio-button:last-of-type bdo[dir=rtl],md-radio-group.layout-lg-row md-radio-button:last-of-type bdo[dir=rtl],md-radio-group.layout-md-row md-radio-button:last-of-type bdo[dir=rtl],md-radio-group.layout-row md-radio-button:last-of-type bdo[dir=rtl],md-radio-group.layout-sm-row md-radio-button:last-of-type bdo[dir=rtl],md-radio-group.layout-xl-row md-radio-button:last-of-type bdo[dir=rtl],md-radio-group.layout-xs-row md-radio-button:last-of-type bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}md-radio-group.layout-gt-lg-row md-radio-button:last-of-type bdo[dir=ltr],md-radio-group.layout-gt-md-row md-radio-button:last-of-type bdo[dir=ltr],md-radio-group.layout-gt-sm-row md-radio-button:last-of-type bdo[dir=ltr],md-radio-group.layout-gt-xs-row md-radio-button:last-of-type bdo[dir=ltr],md-radio-group.layout-lg-row md-radio-button:last-of-type bdo[dir=ltr],md-radio-group.layout-md-row md-radio-button:last-of-type bdo[dir=ltr],md-radio-group.layout-row md-radio-button:last-of-type bdo[dir=ltr],md-radio-group.layout-sm-row md-radio-button:last-of-type bdo[dir=ltr],md-radio-group.layout-xl-row md-radio-button:last-of-type bdo[dir=ltr],md-radio-group.layout-xs-row md-radio-button:last-of-type bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}md-radio-group:focus{outline:0}md-radio-group.md-focused .md-checked ._md-container:before{left:-8px;top:-8px;right:-8px;bottom:-8px}.md-inline-form md-radio-group{margin:18px 0 19px}.md-inline-form md-radio-group md-radio-button{display:inline-block;height:30px;padding:2px;box-sizing:border-box;margin-top:0;margin-bottom:0}@media screen and (-ms-high-contrast:active){md-radio-button.md-default-theme ._md-on{background-color:#fff}}
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/
function mdRadioGroupDirective(e,t,n,i){function r(r,o,a,d){function u(){o.hasClass("md-focused")||o.addClass("md-focused")}function c(n){var i=n.which||n.keyCode;if(i==t.KEY_CODE.ENTER||n.currentTarget==n.target)switch(i){case t.KEY_CODE.LEFT_ARROW:case t.KEY_CODE.UP_ARROW:n.preventDefault(),s.selectPrevious(),u();break;case t.KEY_CODE.RIGHT_ARROW:case t.KEY_CODE.DOWN_ARROW:n.preventDefault(),s.selectNext(),u();break;case t.KEY_CODE.ENTER:var r=angular.element(e.getClosest(o[0],"form"));r.length>0&&r.triggerHandler("submit")}}n(o);var s=d[0],l=d[1]||e.fakeNgModel();s.init(l),r.mouseActive=!1,o.attr({role:"radiogroup",tabIndex:o.attr("tabindex")||"0"}).on("keydown",c).on("mousedown",function(e){r.mouseActive=!0,i(function(){r.mouseActive=!1},100)}).on("focus",function(){r.mouseActive===!1&&s.$element.addClass("md-focused")}).on("blur",function(){s.$element.removeClass("md-focused")})}function o(e){this._radioButtonRenderFns=[],this.$element=e}function a(){return{init:function(e){this._ngModelCtrl=e,this._ngModelCtrl.$render=angular.bind(this,this.render)},add:function(e){this._radioButtonRenderFns.push(e)},remove:function(e){var t=this._radioButtonRenderFns.indexOf(e);-1!==t&&this._radioButtonRenderFns.splice(t,1)},render:function(){this._radioButtonRenderFns.forEach(function(e){e()})},setViewValue:function(e,t){this._ngModelCtrl.$setViewValue(e,t),this.render()},getViewValue:function(){return this._ngModelCtrl.$viewValue},selectNext:function(){return d(this.$element,1)},selectPrevious:function(){return d(this.$element,-1)},setActiveDescendant:function(e){this.$element.attr("aria-activedescendant",e)}}}function d(t,n){var i=e.iterator(t[0].querySelectorAll("md-radio-button"),!0);if(i.count()){var r=function(e){return!angular.element(e).attr("disabled")},o=t[0].querySelector("md-radio-button.md-checked"),a=i[0>n?"previous":"next"](o,r)||i.first();angular.element(a).triggerHandler("click")}}return o.prototype=a(),{restrict:"E",controller:["$element",o],require:["mdRadioGroup","?ngModel"],link:{pre:r}}}function mdRadioButtonDirective(e,t,n){function i(i,o,a,d){function u(e){if(!d)throw"RadioGroupController not found.";d.add(s),a.$observe("value",s),o.on("click",c).on("$destroy",function(){d.remove(s)})}function c(e){o[0].hasAttribute("disabled")||i.$apply(function(){d.setViewValue(a.value,e&&e.type)})}function s(){function e(e){"MD-RADIO-GROUP"!=o.parent()[0].nodeName&&o.parent()[e?"addClass":"removeClass"](r)}var t=d.getViewValue()==a.value;t!==m&&(m=t,o.attr("aria-checked",t),t?(e(!0),o.addClass(r),d.setActiveDescendant(o.attr("id"))):(e(!1),o.removeClass(r)))}function l(n,i){function r(){return a.id||"radio_"+t.nextUid()}i.ariaId=r(),n.attr({id:i.ariaId,role:"radio","aria-checked":"false"}),e.expectWithText(n,"aria-label")}var m;n(o),l(o,i),u()}var r="md-checked";return{restrict:"E",require:"^mdRadioGroup",transclude:!0,template:'<div class="_md-container" md-ink-ripple md-ink-ripple-checkbox><div class="_md-off"></div><div class="_md-on"></div></div><div ng-transclude class="_md-label"></div>',link:i}}goog.provide("ng.material.components.radioButton"),goog.require("ng.material.core"),angular.module("material.components.radioButton",["material.core"]).directive("mdRadioGroup",mdRadioGroupDirective).directive("mdRadioButton",mdRadioButtonDirective),mdRadioGroupDirective.$inject=["$mdUtil","$mdConstant","$mdTheming","$timeout"],mdRadioButtonDirective.$inject=["$mdAria","$mdUtil","$mdTheming"],ng.material.components.radioButton=angular.module("material.components.radioButton");
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
md-select.md-THEME_NAME-theme[disabled] .md-select-value {
border-bottom-color: transparent;
background-image: linear-gradient(to right, "{{foreground-3}}" 0%, "{{foreground-3}}" 33%, transparent 0%); }
md-select.md-THEME_NAME-theme .md-select-value {
border-bottom-color: '{{foreground-4}}'; }
md-select.md-THEME_NAME-theme .md-select-value.md-select-placeholder {
color: '{{foreground-3}}'; }
md-select.md-THEME_NAME-theme.ng-invalid.ng-dirty .md-select-value {
color: '{{warn-A700}}' !important;
border-bottom-color: '{{warn-A700}}' !important; }
md-select.md-THEME_NAME-theme:not([disabled]):focus .md-select-value {
border-bottom-color: '{{primary-color}}';
color: '{{ foreground-1 }}'; }
md-select.md-THEME_NAME-theme:not([disabled]):focus .md-select-value.md-select-placeholder {
color: '{{ foreground-1 }}'; }
md-select.md-THEME_NAME-theme:not([disabled]):focus.md-accent .md-select-value {
border-bottom-color: '{{accent-color}}'; }
md-select.md-THEME_NAME-theme:not([disabled]):focus.md-warn .md-select-value {
border-bottom-color: '{{warn-color}}'; }
md-select.md-THEME_NAME-theme[disabled] .md-select-value {
color: '{{foreground-3}}'; }
md-select.md-THEME_NAME-theme[disabled] .md-select-value.md-select-placeholder {
color: '{{foreground-3}}'; }
md-select-menu.md-THEME_NAME-theme md-option[disabled] {
color: '{{foreground-3}}'; }
md-select-menu.md-THEME_NAME-theme md-optgroup {
color: '{{foreground-2}}'; }
md-select-menu.md-THEME_NAME-theme md-optgroup md-option {
color: '{{foreground-1}}'; }
md-select-menu.md-THEME_NAME-theme md-option[selected] {
color: '{{primary-500}}'; }
md-select-menu.md-THEME_NAME-theme md-option[selected]:focus {
color: '{{primary-600}}'; }
md-select-menu.md-THEME_NAME-theme md-option[selected].md-accent {
color: '{{accent-500}}'; }
md-select-menu.md-THEME_NAME-theme md-option[selected].md-accent:focus {
color: '{{accent-600}}'; }
md-select-menu.md-THEME_NAME-theme md-option:focus:not([disabled]):not([selected]) {
background: '{{background-200}}'; }
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/md-select.md-THEME_NAME-theme[disabled] ._md-select-value{border-bottom-color:transparent;background-image:linear-gradient(to right,"{{foreground-3}}" 0,"{{foreground-3}}" 33%,transparent 0)}md-select.md-THEME_NAME-theme ._md-select-value{border-bottom-color:'{{foreground-4}}'}md-select.md-THEME_NAME-theme ._md-select-value._md-select-placeholder{color:'{{foreground-3}}'}md-select.md-THEME_NAME-theme.ng-invalid.ng-dirty ._md-select-value{color:'{{warn-A700}}'!important;border-bottom-color:'{{warn-A700}}'!important}md-select.md-THEME_NAME-theme:not([disabled]):focus ._md-select-value{border-bottom-color:'{{primary-color}}';color:'{{ foreground-1 }}'}md-select.md-THEME_NAME-theme:not([disabled]):focus ._md-select-value._md-select-placeholder{color:'{{ foreground-1 }}'}md-select.md-THEME_NAME-theme:not([disabled]):focus.md-accent ._md-select-value{border-bottom-color:'{{accent-color}}'}md-select.md-THEME_NAME-theme:not([disabled]):focus.md-warn ._md-select-value{border-bottom-color:'{{warn-color}}'}md-select-menu.md-THEME_NAME-theme md-option[disabled],md-select.md-THEME_NAME-theme[disabled] ._md-select-value,md-select.md-THEME_NAME-theme[disabled] ._md-select-value._md-select-placeholder{color:'{{foreground-3}}'}md-select-menu.md-THEME_NAME-theme md-optgroup{color:'{{foreground-2}}'}md-select-menu.md-THEME_NAME-theme md-optgroup md-option{color:'{{foreground-1}}'}md-select-menu.md-THEME_NAME-theme md-option[selected]{color:'{{primary-500}}'}md-select-menu.md-THEME_NAME-theme md-option[selected]:focus{color:'{{primary-600}}'}md-select-menu.md-THEME_NAME-theme md-option[selected].md-accent{color:'{{accent-500}}'}md-select-menu.md-THEME_NAME-theme md-option[selected].md-accent:focus{color:'{{accent-600}}'}md-select-menu.md-THEME_NAME-theme md-option:focus:not([disabled]):not([selected]){background:0 0}
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
.md-select-menu-container {
position: fixed;
left: 0;
top: 0;
z-index: 90;
opacity: 0;
display: none; }
.md-select-menu-container:not(.md-clickable) {
pointer-events: none; }
.md-select-menu-container md-progress-circular {
display: table;
margin: 24px auto !important; }
.md-select-menu-container.md-active {
display: block;
opacity: 1; }
.md-select-menu-container.md-active md-select-menu {
transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
transition-duration: 150ms; }
.md-select-menu-container.md-active md-select-menu > * {
opacity: 1;
transition: all 0.3s cubic-bezier(0.55, 0, 0.55, 0.2);
transition-duration: 150ms;
transition-delay: 100ms; }
.md-select-menu-container.md-leave {
opacity: 0;
transition: all 0.3s cubic-bezier(0.55, 0, 0.55, 0.2);
transition-duration: 250ms; }
md-input-container > md-select {
margin: 0;
-webkit-order: 2;
-ms-flex-order: 2;
order: 2; }
md-select {
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
margin: 20px 0 26px 0; }
md-select[disabled] .md-select-value {
background-position: 0 bottom;
background-size: 4px 1px;
background-repeat: repeat-x;
margin-bottom: -1px; }
md-select:focus {
outline: none; }
md-select[disabled]:hover {
cursor: default; }
md-select:not([disabled]):hover {
cursor: pointer; }
md-select:not([disabled]).ng-invalid.ng-dirty .md-select-value {
border-bottom: 2px solid;
padding-bottom: 0; }
md-select:not([disabled]):focus .md-select-value {
border-bottom-width: 2px;
border-bottom-style: solid;
padding-bottom: 0; }
.md-select-value {
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
padding: 2px 2px 1px;
border-bottom-width: 1px;
border-bottom-style: solid;
background-color: transparent;
position: relative;
box-sizing: content-box;
min-width: 64px;
min-height: 26px;
-webkit-flex-grow: 1;
-ms-flex-positive: 1;
flex-grow: 1; }
.md-select-value .md-text {
display: inline; }
.md-select-value *:first-child {
-webkit-flex: 1 0 auto;
-ms-flex: 1 0 auto;
flex: 1 0 auto;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
-webkit-transform: translate3d(0, 2px, 0);
transform: translate3d(0, 2px, 0); }
.md-select-value .md-select-icon {
display: block;
-webkit-align-items: flex-end;
-ms-flex-align: end;
align-items: flex-end;
text-align: end;
width: 24px;
margin: 0 4px;
-webkit-transform: translate3d(0, 1px, 0);
transform: translate3d(0, 1px, 0); }
.md-select-value .md-select-icon:after {
display: block;
content: '\25BC';
position: relative;
top: 2px;
speak: none;
-webkit-transform: scaleY(0.6) scaleX(1);
transform: scaleY(0.6) scaleX(1); }
.md-select-value.md-select-placeholder {
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-order: 1;
-ms-flex-order: 1;
order: 1;
pointer-events: none;
-webkit-font-smoothing: antialiased;
padding-left: 2px;
z-index: 1; }
md-select-menu {
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.2), 0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 2px 1px -1px rgba(0, 0, 0, 0.12);
max-height: 256px;
min-height: 48px;
overflow-y: hidden;
-webkit-transform-origin: left top;
transform-origin: left top;
-webkit-transform: scale(1);
transform: scale(1); }
md-select-menu.md-reverse {
-webkit-flex-direction: column-reverse;
-ms-flex-direction: column-reverse;
flex-direction: column-reverse; }
md-select-menu:not(.md-overflow) md-content {
padding-top: 8px;
padding-bottom: 8px; }
html[dir=rtl] md-select-menu {
-webkit-transform-origin: right top;
transform-origin: right top;
unicode-bidi: embed; }
body[dir=rtl] md-select-menu {
-webkit-transform-origin: right top;
transform-origin: right top;
unicode-bidi: embed; }
md-select-menu bdo[dir=rtl] {
direction: rtl;
unicode-bidi: bidi-override; }
md-select-menu bdo[dir=ltr] {
direction: ltr;
unicode-bidi: bidi-override; }
md-select-menu md-content {
min-width: 136px;
min-height: 48px;
max-height: 256px;
overflow-y: auto; }
md-select-menu > * {
opacity: 0; }
md-option {
cursor: pointer;
position: relative;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
width: auto;
padding: 0 16px 0 16px;
height: 48px; }
md-option[disabled] {
cursor: default; }
md-option:focus {
outline: none; }
md-option .md-text {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
width: auto;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 16px; }
md-optgroup {
display: block; }
md-optgroup label {
display: block;
font-size: 14px;
text-transform: uppercase;
padding: 16px;
font-weight: 500; }
md-optgroup md-option {
padding-left: 32px;
padding-right: 32px; }
@media screen and (-ms-high-contrast: active) {
.md-select-backdrop {
background-color: transparent; }
md-select-menu {
border: 1px solid #fff; } }
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
goog.provide('ng.material.components.select');
goog.require('ng.material.components.backdrop');
goog.require('ng.material.core');
/**
* @ngdoc module
* @name material.components.select
*/
/***************************************************
### TODO - POST RC1 ###
- [ ] Abstract placement logic in $mdSelect service to $mdMenu service
***************************************************/
var SELECT_EDGE_MARGIN = 8;
var selectNextId = 0;
angular.module('material.components.select', [
'material.core',
'material.components.backdrop'
])
.directive('mdSelect', SelectDirective)
.directive('mdSelectMenu', SelectMenuDirective)
.directive('mdOption', OptionDirective)
.directive('mdOptgroup', OptgroupDirective)
.provider('$mdSelect', SelectProvider);
/**
* @ngdoc directive
* @name mdSelect
* @restrict E
* @module material.components.select
*
* @description Displays a select box, bound to an ng-model.
*
* @param {expression} ng-model The model!
* @param {boolean=} multiple Whether it's multiple.
* @param {expression=} md-on-close Expression to be evaluated when the select is closed.
* @param {expression=} md-on-open Expression to be evaluated when opening the select.
* Will hide the select options and show a spinner until the evaluated promise resolves.
* @param {string=} placeholder Placeholder hint text.
* @param {string=} aria-label Optional label for accessibility. Only necessary if no placeholder or
* explicit label is present.
* @param {string=} md-container-class Class list to get applied to the `.md-select-menu-container`
* element (for custom styling).
*
* @usage
* With a placeholder (label and aria-label are added dynamically)
* <hljs lang="html">
* <md-input-container>
* <md-select
* ng-model="someModel"
* placeholder="Select a state">
* <md-option ng-value="opt" ng-repeat="opt in neighborhoods2">{{ opt }}</md-option>
* </md-select>
* </md-input-container>
* </hljs>
*
* With an explicit label
* <hljs lang="html">
* <md-input-container>
* <label>State</label>
* <md-select
* ng-model="someModel">
* <md-option ng-value="opt" ng-repeat="opt in neighborhoods2">{{ opt }}</md-option>
* </md-select>
* </md-input-container>
* </hljs>
*
* ## Selects and object equality
* When using a `md-select` to pick from a list of objects, it is important to realize how javascript handles
* equality. Consider the following example:
* <hljs lang="js">
* angular.controller('MyCtrl', function($scope) {
* $scope.users = [
* { id: 1, name: 'Bob' },
* { id: 2, name: 'Alice' },
* { id: 3, name: 'Steve' }
* ];
* $scope.selectedUser = { id: 1, name: 'Bob' };
* });
* </hljs>
* <hljs lang="html">
* <div ng-controller="MyCtrl">
* <md-select ng-model="selectedUser">
* <md-option ng-value="user" ng-repeat="user in users">{{ user.name }}</md-option>
* </md-select>
* </div>
* </hljs>
*
* At first one might expect that the select should be populated with "Bob" as the selected user. However,
* this is not true. To determine whether something is selected,
* `ngModelController` is looking at whether `$scope.selectedUser == (any user in $scope.users);`;
*
* Javascript's `==` operator does not check for deep equality (ie. that all properties
* on the object are the same), but instead whether the objects are *the same object in memory*.
* In this case, we have two instances of identical objects, but they exist in memory as unique
* entities. Because of this, the select will have no value populated for a selected user.
*
* To get around this, `ngModelController` provides a `track by` option that allows us to specify a different
* expression which will be used for the equality operator. As such, we can update our `html` to
* make use of this by specifying the `ng-model-options="{trackBy: '$value.id'}"` on the `md-select`
* element. This converts our equality expression to be
* `$scope.selectedUser.id == (any id in $scope.users.map(function(u) { return u.id; }));`
* which results in Bob being selected as desired.
*
* Working HTML:
* <hljs lang="html">
* <div ng-controller="MyCtrl">
* <md-select ng-model="selectedUser" ng-model-options="{trackBy: '$value.id'}">
* <md-option ng-value="user" ng-repeat="user in users">{{ user.name }}</md-option>
* </md-select>
* </div>
* </hljs>
*/
function SelectDirective($mdSelect, $mdUtil, $mdTheming, $mdAria, $compile, $parse) {
return {
restrict: 'E',
require: ['^?mdInputContainer', 'mdSelect', 'ngModel', '?^form'],
compile: compile,
controller: function() {
} // empty placeholder controller to be initialized in link
};
function compile(element, attr) {
// add the select value that will hold our placeholder or selected option value
var valueEl = angular.element('<md-select-value><span></span></md-select-value>');
valueEl.append('<span class="md-select-icon" aria-hidden="true"></span>');
valueEl.addClass('md-select-value');
if (!valueEl[0].hasAttribute('id')) {
valueEl.attr('id', 'select_value_label_' + $mdUtil.nextUid());
}
// There's got to be an md-content inside. If there's not one, let's add it.
if (!element.find('md-content').length) {
element.append(angular.element('<md-content>').append(element.contents()));
}
// Add progress spinner for md-options-loading
if (attr.mdOnOpen) {
// Show progress indicator while loading async
// Use ng-hide for `display:none` so the indicator does not interfere with the options list
element
.find('md-content')
.prepend(angular.element(
'<div>' +
' <md-progress-circular md-mode="{{progressMode}}" ng-hide="$$loadingAsyncDone"></md-progress-circular>' +
'</div>'
));
// Hide list [of item options] while loading async
element
.find('md-option')
.attr('ng-show', '$$loadingAsyncDone');
}
if (attr.name) {
var autofillClone = angular.element('<select class="md-visually-hidden">');
autofillClone.attr({
'name': '.' + attr.name,
'ng-model': attr.ngModel,
'aria-hidden': 'true',
'tabindex': '-1'
});
var opts = element.find('md-option');
angular.forEach(opts, function(el) {
var newEl = angular.element('<option>' + el.innerHTML + '</option>');
if (el.hasAttribute('ng-value')) newEl.attr('ng-value', el.getAttribute('ng-value'));
else if (el.hasAttribute('value')) newEl.attr('value', el.getAttribute('value'));
autofillClone.append(newEl);
});
element.parent().append(autofillClone);
}
// Use everything that's left inside element.contents() as the contents of the menu
var multiple = angular.isDefined(attr.multiple) ? 'multiple' : '';
var selectTemplate = '' +
'<div class="md-select-menu-container" aria-hidden="true">' +
'<md-select-menu {0}>{1}</md-select-menu>' +
'</div>';
selectTemplate = $mdUtil.supplant(selectTemplate, [multiple, element.html()]);
element.empty().append(valueEl);
element.append(selectTemplate);
attr.tabindex = attr.tabindex || '0';
return function postLink(scope, element, attr, ctrls) {
var untouched = true;
var isDisabled, ariaLabelBase;
var containerCtrl = ctrls[0];
var mdSelectCtrl = ctrls[1];
var ngModelCtrl = ctrls[2];
var formCtrl = ctrls[3];
// grab a reference to the select menu value label
var valueEl = element.find('md-select-value');
var isReadonly = angular.isDefined(attr.readonly);
if (containerCtrl) {
var isErrorGetter = containerCtrl.isErrorGetter || function() {
return ngModelCtrl.$invalid && ngModelCtrl.$touched;
};
if (containerCtrl.input) {
throw new Error("<md-input-container> can only have *one* child <input>, <textarea> or <select> element!");
}
containerCtrl.input = element;
if (!containerCtrl.label) {
$mdAria.expect(element, 'aria-label', element.attr('placeholder'));
}
scope.$watch(isErrorGetter, containerCtrl.setInvalid);
}
var selectContainer, selectScope, selectMenuCtrl;
findSelectContainer();
$mdTheming(element);
if (attr.name && formCtrl) {
var selectEl = element.parent()[0].querySelector('select[name=".' + attr.name + '"]');
$mdUtil.nextTick(function() {
var controller = angular.element(selectEl).controller('ngModel');
if (controller) {
formCtrl.$removeControl(controller);
}
});
}
if (formCtrl && angular.isDefined(attr.multiple)) {
$mdUtil.nextTick(function() {
var hasModelValue = ngModelCtrl.$modelValue || ngModelCtrl.$viewValue;
if (hasModelValue) {
formCtrl.$setPristine();
}
});
}
var originalRender = ngModelCtrl.$render;
ngModelCtrl.$render = function() {
originalRender();
syncLabelText();
syncAriaLabel();
inputCheckValue();
};
attr.$observe('placeholder', ngModelCtrl.$render);
mdSelectCtrl.setLabelText = function(text) {
mdSelectCtrl.setIsPlaceholder(!text);
// Use placeholder attribute, otherwise fallback to the md-input-container label
var tmpPlaceholder = attr.placeholder || (containerCtrl && containerCtrl.label ? containerCtrl.label.text() : '');
text = text || tmpPlaceholder || '';
var target = valueEl.children().eq(0);
target.html(text);
};
mdSelectCtrl.setIsPlaceholder = function(isPlaceholder) {
if (isPlaceholder) {
valueEl.addClass('md-select-placeholder');
if (containerCtrl && containerCtrl.label) {
containerCtrl.label.addClass('md-placeholder');
}
} else {
valueEl.removeClass('md-select-placeholder');
if (containerCtrl && containerCtrl.label) {
containerCtrl.label.removeClass('md-placeholder');
}
}
};
if (!isReadonly) {
element
.on('focus', function(ev) {
// only set focus on if we don't currently have a selected value. This avoids the "bounce"
// on the label transition because the focus will immediately switch to the open menu.
if (containerCtrl && containerCtrl.element.hasClass('md-input-has-value')) {
containerCtrl.setFocused(true);
}
});
// Wait until postDigest so that we attach after ngModel's
// blur listener so we can set untouched.
$mdUtil.nextTick(function () {
element.on('blur', function() {
if (untouched) {
untouched = false;
ngModelCtrl.$setUntouched();
}
if (selectScope.isOpen) return;
containerCtrl && containerCtrl.setFocused(false);
inputCheckValue();
});
});
}
mdSelectCtrl.triggerClose = function() {
$parse(attr.mdOnClose)(scope);
};
scope.$$postDigest(function() {
initAriaLabel();
syncLabelText();
syncAriaLabel();
});
function initAriaLabel() {
var labelText = element.attr('aria-label') || element.attr('placeholder');
if (!labelText && containerCtrl && containerCtrl.label) {
labelText = containerCtrl.label.text();
}
ariaLabelBase = labelText;
$mdAria.expect(element, 'aria-label', labelText);
}
scope.$watch(selectMenuCtrl.selectedLabels, syncLabelText);
function syncLabelText() {
if (selectContainer) {
selectMenuCtrl = selectMenuCtrl || selectContainer.find('md-select-menu').controller('mdSelectMenu');
mdSelectCtrl.setLabelText(selectMenuCtrl.selectedLabels());
}
}
function syncAriaLabel() {
if (!ariaLabelBase) return;
var ariaLabels = selectMenuCtrl.selectedLabels({mode: 'aria'});
element.attr('aria-label', ariaLabels.length ? ariaLabelBase + ': ' + ariaLabels : ariaLabelBase);
}
var deregisterWatcher;
attr.$observe('ngMultiple', function(val) {
if (deregisterWatcher) deregisterWatcher();
var parser = $parse(val);
deregisterWatcher = scope.$watch(function() {
return parser(scope);
}, function(multiple, prevVal) {
if (multiple === undefined && prevVal === undefined) return; // assume compiler did a good job
if (multiple) {
element.attr('multiple', 'multiple');
} else {
element.removeAttr('multiple');
}
element.attr('aria-multiselectable', multiple ? 'true' : 'false');
if (selectContainer) {
selectMenuCtrl.setMultiple(multiple);
originalRender = ngModelCtrl.$render;
ngModelCtrl.$render = function() {
originalRender();
syncLabelText();
syncAriaLabel();
inputCheckValue();
};
ngModelCtrl.$render();
}
});
});
attr.$observe('disabled', function(disabled) {
if (angular.isString(disabled)) {
disabled = true;
}
// Prevent click event being registered twice
if (isDisabled !== undefined && isDisabled === disabled) {
return;
}
isDisabled = disabled;
if (disabled) {
element.attr({'tabindex': -1, 'aria-disabled': 'true'});
element.off('click', openSelect);
element.off('keydown', handleKeypress);
} else {
element.attr({'tabindex': attr.tabindex, 'aria-disabled': 'false'});
element.on('click', openSelect);
element.on('keydown', handleKeypress);
}
});
if (!attr.disabled && !attr.ngDisabled) {
element.attr({'tabindex': attr.tabindex, 'aria-disabled': 'false'});
element.on('click', openSelect);
element.on('keydown', handleKeypress);
}
var ariaAttrs = {
role: 'listbox',
'aria-expanded': 'false',
'aria-multiselectable': attr.multiple !== undefined && !attr.ngMultiple ? 'true' : 'false'
};
if (!element[0].hasAttribute('id')) {
ariaAttrs.id = 'select_' + $mdUtil.nextUid();
}
var containerId = 'select_container_' + $mdUtil.nextUid();
selectContainer.attr('id', containerId);
ariaAttrs['aria-owns'] = containerId;
element.attr(ariaAttrs);
scope.$on('$destroy', function() {
$mdSelect
.destroy()
.finally(function() {
if (containerCtrl) {
containerCtrl.setFocused(false);
containerCtrl.setHasValue(false);
containerCtrl.input = null;
}
ngModelCtrl.$setTouched();
});
});
function inputCheckValue() {
// The select counts as having a value if one or more options are selected,
// or if the input's validity state says it has bad input (eg string in a number input)
containerCtrl && containerCtrl.setHasValue(selectMenuCtrl.selectedLabels().length > 0 || (element[0].validity || {}).badInput);
}
function findSelectContainer() {
selectContainer = angular.element(
element[0].querySelector('.md-select-menu-container')
);
selectScope = scope;
if (attr.mdContainerClass) {
var value = selectContainer[0].getAttribute('class') + ' ' + attr.mdContainerClass;
selectContainer[0].setAttribute('class', value);
}
selectMenuCtrl = selectContainer.find('md-select-menu').controller('mdSelectMenu');
selectMenuCtrl.init(ngModelCtrl, attr.ngModel);
element.on('$destroy', function() {
selectContainer.remove();
});
}
function handleKeypress(e) {
var allowedCodes = [32, 13, 38, 40];
if (allowedCodes.indexOf(e.keyCode) != -1) {
// prevent page scrolling on interaction
e.preventDefault();
openSelect(e);
} else {
if (e.keyCode <= 90 && e.keyCode >= 31) {
e.preventDefault();
var node = selectMenuCtrl.optNodeForKeyboardSearch(e);
if (!node) return;
var optionCtrl = angular.element(node).controller('mdOption');
if (!selectMenuCtrl.isMultiple) {
selectMenuCtrl.deselect(Object.keys(selectMenuCtrl.selected)[0]);
}
selectMenuCtrl.select(optionCtrl.hashKey, optionCtrl.value);
selectMenuCtrl.refreshViewValue();
}
}
}
function openSelect() {
selectScope.isOpen = true;
element.attr('aria-expanded', 'true');
$mdSelect.show({
scope: selectScope,
preserveScope: true,
skipCompile: true,
element: selectContainer,
target: element[0],
selectCtrl: mdSelectCtrl,
preserveElement: true,
hasBackdrop: true,
loadingAsync: attr.mdOnOpen ? scope.$eval(attr.mdOnOpen) || true : false
}).finally(function() {
selectScope.isOpen = false;
element.focus();
element.attr('aria-expanded', 'false');
ngModelCtrl.$setTouched();
});
}
};
}
}
SelectDirective.$inject = ["$mdSelect", "$mdUtil", "$mdTheming", "$mdAria", "$compile", "$parse"];
function SelectMenuDirective($parse, $mdUtil, $mdTheming) {
SelectMenuController.$inject = ["$scope", "$attrs", "$element"];
return {
restrict: 'E',
require: ['mdSelectMenu'],
scope: true,
controller: SelectMenuController,
link: {pre: preLink}
};
// We use preLink instead of postLink to ensure that the select is initialized before
// its child options run postLink.
function preLink(scope, element, attr, ctrls) {
var selectCtrl = ctrls[0];
$mdTheming(element);
element.on('click', clickListener);
element.on('keypress', keyListener);
function keyListener(e) {
if (e.keyCode == 13 || e.keyCode == 32) {
clickListener(e);
}
}
function clickListener(ev) {
var option = $mdUtil.getClosest(ev.target, 'md-option');
var optionCtrl = option && angular.element(option).data('$mdOptionController');
if (!option || !optionCtrl) return;
if (option.hasAttribute('disabled')) {
ev.stopImmediatePropagation();
return false;
}
var optionHashKey = selectCtrl.hashGetter(optionCtrl.value);
var isSelected = angular.isDefined(selectCtrl.selected[optionHashKey]);
scope.$apply(function() {
if (selectCtrl.isMultiple) {
if (isSelected) {
selectCtrl.deselect(optionHashKey);
} else {
selectCtrl.select(optionHashKey, optionCtrl.value);
}
} else {
if (!isSelected) {
selectCtrl.deselect(Object.keys(selectCtrl.selected)[0]);
selectCtrl.select(optionHashKey, optionCtrl.value);
}
}
selectCtrl.refreshViewValue();
});
}
}
function SelectMenuController($scope, $attrs, $element) {
var self = this;
self.isMultiple = angular.isDefined($attrs.multiple);
// selected is an object with keys matching all of the selected options' hashed values
self.selected = {};
// options is an object with keys matching every option's hash value,
// and values matching every option's controller.
self.options = {};
$scope.$watchCollection(function() {
return self.options;
}, function() {
self.ngModel.$render();
});
var deregisterCollectionWatch;
var defaultIsEmpty;
self.setMultiple = function(isMultiple) {
var ngModel = self.ngModel;
defaultIsEmpty = defaultIsEmpty || ngModel.$isEmpty;
self.isMultiple = isMultiple;
if (deregisterCollectionWatch) deregisterCollectionWatch();
if (self.isMultiple) {
ngModel.$validators['md-multiple'] = validateArray;
ngModel.$render = renderMultiple;
// watchCollection on the model because by default ngModel only watches the model's
// reference. This allowed the developer to also push and pop from their array.
$scope.$watchCollection(self.modelBinding, function(value) {
if (validateArray(value)) renderMultiple(value);
self.ngModel.$setPristine();
});
ngModel.$isEmpty = function(value) {
return !value || value.length === 0;
};
} else {
delete ngModel.$validators['md-multiple'];
ngModel.$render = renderSingular;
}
function validateArray(modelValue, viewValue) {
// If a value is truthy but not an array, reject it.
// If value is undefined/falsy, accept that it's an empty array.
return angular.isArray(modelValue || viewValue || []);
}
};
var searchStr = '';
var clearSearchTimeout, optNodes, optText;
var CLEAR_SEARCH_AFTER = 300;
self.optNodeForKeyboardSearch = function(e) {
clearSearchTimeout && clearTimeout(clearSearchTimeout);
clearSearchTimeout = setTimeout(function() {
clearSearchTimeout = undefined;
searchStr = '';
optText = undefined;
optNodes = undefined;
}, CLEAR_SEARCH_AFTER);
searchStr += String.fromCharCode(e.keyCode);
var search = new RegExp('^' + searchStr, 'i');
if (!optNodes) {
optNodes = $element.find('md-option');
optText = new Array(optNodes.length);
angular.forEach(optNodes, function(el, i) {
optText[i] = el.textContent.trim();
});
}
for (var i = 0; i < optText.length; ++i) {
if (search.test(optText[i])) {
return optNodes[i];
}
}
};
self.init = function(ngModel, binding) {
self.ngModel = ngModel;
self.modelBinding = binding;
// Allow users to provide `ng-model="foo" ng-model-options="{trackBy: 'foo.id'}"` so
// that we can properly compare objects set on the model to the available options
if (ngModel.$options && ngModel.$options.trackBy) {
var trackByLocals = {};
var trackByParsed = $parse(ngModel.$options.trackBy);
self.hashGetter = function(value, valueScope) {
trackByLocals.$value = value;
return trackByParsed(valueScope || $scope, trackByLocals);
};
// If the user doesn't provide a trackBy, we automatically generate an id for every
// value passed in
} else {
self.hashGetter = function getHashValue(value) {
if (angular.isObject(value)) {
return 'object_' + (value.$$mdSelectId || (value.$$mdSelectId = ++selectNextId));
}
return value;
};
}
self.setMultiple(self.isMultiple);
};
self.selectedLabels = function(opts) {
opts = opts || {};
var mode = opts.mode || 'html';
var selectedOptionEls = $mdUtil.nodesToArray($element[0].querySelectorAll('md-option[selected]'));
if (selectedOptionEls.length) {
var mapFn;
if (mode == 'html') {
// Map the given element to its innerHTML string. If the element has a child ripple
// container remove it from the HTML string, before returning the string.
mapFn = function(el) {
var html = el.innerHTML;
// Remove the ripple container from the selected option, copying it would cause a CSP violation.
var rippleContainer = el.querySelector('.md-ripple-container');
return rippleContainer ? html.replace(rippleContainer.outerHTML, '') : html;
};
} else if (mode == 'aria') {
mapFn = function(el) { return el.hasAttribute('aria-label') ? el.getAttribute('aria-label') : el.textContent; };
}
return selectedOptionEls.map(mapFn).join(', ');
} else {
return '';
}
};
self.select = function(hashKey, hashedValue) {
var option = self.options[hashKey];
option && option.setSelected(true);
self.selected[hashKey] = hashedValue;
};
self.deselect = function(hashKey) {
var option = self.options[hashKey];
option && option.setSelected(false);
delete self.selected[hashKey];
};
self.addOption = function(hashKey, optionCtrl) {
if (angular.isDefined(self.options[hashKey])) {
throw new Error('Duplicate md-option values are not allowed in a select. ' +
'Duplicate value "' + optionCtrl.value + '" found.');
}
self.options[hashKey] = optionCtrl;
// If this option's value was already in our ngModel, go ahead and select it.
if (angular.isDefined(self.selected[hashKey])) {
self.select(hashKey, optionCtrl.value);
self.refreshViewValue();
}
};
self.removeOption = function(hashKey) {
delete self.options[hashKey];
// Don't deselect an option when it's removed - the user's ngModel should be allowed
// to have values that do not match a currently available option.
};
self.refreshViewValue = function() {
var values = [];
var option;
for (var hashKey in self.selected) {
// If this hashKey has an associated option, push that option's value to the model.
if ((option = self.options[hashKey])) {
values.push(option.value);
} else {
// Otherwise, the given hashKey has no associated option, and we got it
// from an ngModel value at an earlier time. Push the unhashed value of
// this hashKey to the model.
// This allows the developer to put a value in the model that doesn't yet have
// an associated option.
values.push(self.selected[hashKey]);
}
}
var usingTrackBy = self.ngModel.$options && self.ngModel.$options.trackBy;
var newVal = self.isMultiple ? values : values[0];
var prevVal = self.ngModel.$modelValue;
if (usingTrackBy ? !angular.equals(prevVal, newVal) : prevVal != newVal) {
self.ngModel.$setViewValue(newVal);
self.ngModel.$render();
}
};
function renderMultiple() {
var newSelectedValues = self.ngModel.$modelValue || self.ngModel.$viewValue || [];
if (!angular.isArray(newSelectedValues)) return;
var oldSelected = Object.keys(self.selected);
var newSelectedHashes = newSelectedValues.map(self.hashGetter);
var deselected = oldSelected.filter(function(hash) {
return newSelectedHashes.indexOf(hash) === -1;
});
deselected.forEach(self.deselect);
newSelectedHashes.forEach(function(hashKey, i) {
self.select(hashKey, newSelectedValues[i]);
});
}
function renderSingular() {
var value = self.ngModel.$viewValue || self.ngModel.$modelValue;
Object.keys(self.selected).forEach(self.deselect);
self.select(self.hashGetter(value), value);
}
}
}
SelectMenuDirective.$inject = ["$parse", "$mdUtil", "$mdTheming"];
function OptionDirective($mdButtonInkRipple, $mdUtil) {
OptionController.$inject = ["$element"];
return {
restrict: 'E',
require: ['mdOption', '^^mdSelectMenu'],
controller: OptionController,
compile: compile
};
function compile(element, attr) {
// Manual transclusion to avoid the extra inner <span> that ng-transclude generates
element.append(angular.element('<div class="md-text">').append(element.contents()));
element.attr('tabindex', attr.tabindex || '0');
return postLink;
}
function postLink(scope, element, attr, ctrls) {
var optionCtrl = ctrls[0];
var selectCtrl = ctrls[1];
if (angular.isDefined(attr.ngValue)) {
scope.$watch(attr.ngValue, setOptionValue);
} else if (angular.isDefined(attr.value)) {
setOptionValue(attr.value);
} else {
scope.$watch(function() {
return element.text().trim();
}, setOptionValue);
}
attr.$observe('disabled', function(disabled) {
if (disabled) {
element.attr('tabindex', '-1');
} else {
element.attr('tabindex', '0');
}
});
scope.$$postDigest(function() {
attr.$observe('selected', function(selected) {
if (!angular.isDefined(selected)) return;
if (typeof selected == 'string') selected = true;
if (selected) {
if (!selectCtrl.isMultiple) {
selectCtrl.deselect(Object.keys(selectCtrl.selected)[0]);
}
selectCtrl.select(optionCtrl.hashKey, optionCtrl.value);
} else {
selectCtrl.deselect(optionCtrl.hashKey);
}
selectCtrl.refreshViewValue();
});
});
$mdButtonInkRipple.attach(scope, element);
configureAria();
function setOptionValue(newValue, oldValue, prevAttempt) {
if (!selectCtrl.hashGetter) {
if (!prevAttempt) {
scope.$$postDigest(function() {
setOptionValue(newValue, oldValue, true);
});
}
return;
}
var oldHashKey = selectCtrl.hashGetter(oldValue, scope);
var newHashKey = selectCtrl.hashGetter(newValue, scope);
optionCtrl.hashKey = newHashKey;
optionCtrl.value = newValue;
selectCtrl.removeOption(oldHashKey, optionCtrl);
selectCtrl.addOption(newHashKey, optionCtrl);
}
scope.$on('$destroy', function() {
selectCtrl.removeOption(optionCtrl.hashKey, optionCtrl);
});
function configureAria() {
var ariaAttrs = {
'role': 'option',
'aria-selected': 'false'
};
if (!element[0].hasAttribute('id')) {
ariaAttrs.id = 'select_option_' + $mdUtil.nextUid();
}
element.attr(ariaAttrs);
}
}
function OptionController($element) {
this.selected = false;
this.setSelected = function(isSelected) {
if (isSelected && !this.selected) {
$element.attr({
'selected': 'selected',
'aria-selected': 'true'
});
} else if (!isSelected && this.selected) {
$element.removeAttr('selected');
$element.attr('aria-selected', 'false');
}
this.selected = isSelected;
};
}
}
OptionDirective.$inject = ["$mdButtonInkRipple", "$mdUtil"];
function OptgroupDirective() {
return {
restrict: 'E',
compile: compile
};
function compile(el, attrs) {
var labelElement = el.find('label');
if (!labelElement.length) {
labelElement = angular.element('<label>');
el.prepend(labelElement);
}
labelElement.addClass('md-container-ignore');
if (attrs.label) labelElement.text(attrs.label);
}
}
function SelectProvider($$interimElementProvider) {
selectDefaultOptions.$inject = ["$mdSelect", "$mdConstant", "$mdUtil", "$window", "$q", "$$rAF", "$animateCss", "$animate", "$document"];
return $$interimElementProvider('$mdSelect')
.setDefaults({
methods: ['target'],
options: selectDefaultOptions
});
/* ngInject */
function selectDefaultOptions($mdSelect, $mdConstant, $mdUtil, $window, $q, $$rAF, $animateCss, $animate, $document) {
var ERRROR_TARGET_EXPECTED = "$mdSelect.show() expected a target element in options.target but got '{0}'!";
var animator = $mdUtil.dom.animator;
return {
parent: 'body',
themable: true,
onShow: onShow,
onRemove: onRemove,
hasBackdrop: true,
disableParentScroll: true
};
/**
* Interim-element onRemove logic....
*/
function onRemove(scope, element, opts) {
opts = opts || { };
opts.cleanupInteraction();
opts.cleanupResizing();
opts.hideBackdrop();
// For navigation $destroy events, do a quick, non-animated removal,
// but for normal closes (from clicks, etc) animate the removal
return (opts.$destroy === true) ? cleanElement() : animateRemoval().then( cleanElement );
/**
* For normal closes (eg clicks), animate the removal.
* For forced closes (like $destroy events from navigation),
* skip the animations
*/
function animateRemoval() {
return $animateCss(element, {addClass: 'md-leave'}).start();
}
/**
* Restore the element to a closed state
*/
function cleanElement() {
element.removeClass('md-active');
element.attr('aria-hidden', 'true');
element[0].style.display = 'none';
announceClosed(opts);
if (!opts.$destroy && opts.restoreFocus) {
opts.target.focus();
}
}
}
/**
* Interim-element onShow logic....
*/
function onShow(scope, element, opts) {
watchAsyncLoad();
sanitizeAndConfigure(scope, opts);
opts.hideBackdrop = showBackdrop(scope, element, opts);
return showDropDown(scope, element, opts)
.then(function(response) {
element.attr('aria-hidden', 'false');
opts.alreadyOpen = true;
opts.cleanupInteraction = activateInteraction();
opts.cleanupResizing = activateResizing();
return response;
}, opts.hideBackdrop);
// ************************************
// Closure Functions
// ************************************
/**
* Attach the select DOM element(s) and animate to the correct positions
* and scalings...
*/
function showDropDown(scope, element, opts) {
opts.parent.append(element);
return $q(function(resolve, reject) {
try {
$animateCss(element, {removeClass: 'md-leave', duration: 0})
.start()
.then(positionAndFocusMenu)
.then(resolve);
} catch (e) {
reject(e);
}
});
}
/**
* Initialize container and dropDown menu positions/scale, then animate
* to show... and autoFocus.
*/
function positionAndFocusMenu() {
return $q(function(resolve) {
if (opts.isRemoved) return $q.reject(false);
var info = calculateMenuPositions(scope, element, opts);
info.container.element.css(animator.toCss(info.container.styles));
info.dropDown.element.css(animator.toCss(info.dropDown.styles));
$$rAF(function() {
element.addClass('md-active');
info.dropDown.element.css(animator.toCss({transform: ''}));
autoFocus(opts.focusedNode);
resolve();
});
});
}
/**
* Show modal backdrop element...
*/
function showBackdrop(scope, element, options) {
// If we are not within a dialog...
if (options.disableParentScroll && !$mdUtil.getClosest(options.target, 'MD-DIALOG')) {
// !! DO this before creating the backdrop; since disableScrollAround()
// configures the scroll offset; which is used by mdBackDrop postLink()
options.restoreScroll = $mdUtil.disableScrollAround(options.element, options.parent);
} else {
options.disableParentScroll = false;
}
if (options.hasBackdrop) {
// Override duration to immediately show invisible backdrop
options.backdrop = $mdUtil.createBackdrop(scope, "md-select-backdrop md-click-catcher");
$animate.enter(options.backdrop, $document[0].body, null, {duration: 0});
}
/**
* Hide modal backdrop element...
*/
return function hideBackdrop() {
if (options.backdrop) options.backdrop.remove();
if (options.disableParentScroll) options.restoreScroll();
delete options.restoreScroll;
};
}
/**
*
*/
function autoFocus(focusedNode) {
if (focusedNode && !focusedNode.hasAttribute('disabled')) {
focusedNode.focus();
}
}
/**
* Check for valid opts and set some sane defaults
*/
function sanitizeAndConfigure(scope, options) {
var selectEl = element.find('md-select-menu');
if (!options.target) {
throw new Error($mdUtil.supplant(ERRROR_TARGET_EXPECTED, [options.target]));
}
angular.extend(options, {
isRemoved: false,
target: angular.element(options.target), //make sure it's not a naked dom node
parent: angular.element(options.parent),
selectEl: selectEl,
contentEl: element.find('md-content'),
optionNodes: selectEl[0].getElementsByTagName('md-option')
});
}
/**
* Configure various resize listeners for screen changes
*/
function activateResizing() {
var debouncedOnResize = (function(scope, target, options) {
return function() {
if (options.isRemoved) return;
var updates = calculateMenuPositions(scope, target, options);
var container = updates.container;
var dropDown = updates.dropDown;
container.element.css(animator.toCss(container.styles));
dropDown.element.css(animator.toCss(dropDown.styles));
};
})(scope, element, opts);
var window = angular.element($window);
window.on('resize', debouncedOnResize);
window.on('orientationchange', debouncedOnResize);
// Publish deactivation closure...
return function deactivateResizing() {
// Disable resizing handlers
window.off('resize', debouncedOnResize);
window.off('orientationchange', debouncedOnResize);
};
}
/**
* If asynchronously loading, watch and update internal
* '$$loadingAsyncDone' flag
*/
function watchAsyncLoad() {
if (opts.loadingAsync && !opts.isRemoved) {
scope.$$loadingAsyncDone = false;
scope.progressMode = 'indeterminate';
$q.when(opts.loadingAsync)
.then(function() {
scope.$$loadingAsyncDone = true;
scope.progressMode = '';
delete opts.loadingAsync;
}).then(function() {
$$rAF(positionAndFocusMenu);
});
}
}
/**
*
*/
function activateInteraction() {
if (opts.isRemoved) return;
var dropDown = opts.selectEl;
var selectCtrl = dropDown.controller('mdSelectMenu') || {};
element.addClass('md-clickable');
// Close on backdrop click
opts.backdrop && opts.backdrop.on('click', onBackdropClick);
// Escape to close
// Cycling of options, and closing on enter
dropDown.on('keydown', onMenuKeyDown);
dropDown.on('click', checkCloseMenu);
return function cleanupInteraction() {
opts.backdrop && opts.backdrop.off('click', onBackdropClick);
dropDown.off('keydown', onMenuKeyDown);
dropDown.off('click', checkCloseMenu);
element.removeClass('md-clickable');
opts.isRemoved = true;
};
// ************************************
// Closure Functions
// ************************************
function onBackdropClick(e) {
e.preventDefault();
e.stopPropagation();
opts.restoreFocus = false;
$mdUtil.nextTick($mdSelect.hide, true);
}
function onMenuKeyDown(ev) {
var keyCodes = $mdConstant.KEY_CODE;
ev.preventDefault();
ev.stopPropagation();
switch (ev.keyCode) {
case keyCodes.UP_ARROW:
return focusPrevOption();
case keyCodes.DOWN_ARROW:
return focusNextOption();
case keyCodes.SPACE:
case keyCodes.ENTER:
var option = $mdUtil.getClosest(ev.target, 'md-option');
if (option) {
dropDown.triggerHandler({
type: 'click',
target: option
});
ev.preventDefault();
}
checkCloseMenu(ev);
break;
case keyCodes.TAB:
case keyCodes.ESCAPE:
ev.stopPropagation();
ev.preventDefault();
opts.restoreFocus = true;
$mdUtil.nextTick($mdSelect.hide, true);
break;
default:
if (ev.keyCode >= 31 && ev.keyCode <= 90) {
var optNode = dropDown.controller('mdSelectMenu').optNodeForKeyboardSearch(ev);
opts.focusedNode = optNode || opts.focusedNode;
optNode && optNode.focus();
}
}
}
function focusOption(direction) {
var optionsArray = $mdUtil.nodesToArray(opts.optionNodes);
var index = optionsArray.indexOf(opts.focusedNode);
var newOption;
do {
if (index === -1) {
// We lost the previously focused element, reset to first option
index = 0;
} else if (direction === 'next' && index < optionsArray.length - 1) {
index++;
} else if (direction === 'prev' && index > 0) {
index--;
}
newOption = optionsArray[index];
if (newOption.hasAttribute('disabled')) newOption = undefined;
} while (!newOption && index < optionsArray.length - 1 && index > 0)
newOption && newOption.focus();
opts.focusedNode = newOption;
}
function focusNextOption() {
focusOption('next');
}
function focusPrevOption() {
focusOption('prev');
}
function checkCloseMenu(ev) {
if (ev && ( ev.type == 'click') && (ev.currentTarget != dropDown[0])) return;
if ( mouseOnScrollbar() ) return;
var option = $mdUtil.getClosest(ev.target, 'md-option');
if (option && option.hasAttribute && !option.hasAttribute('disabled')) {
ev.preventDefault();
ev.stopPropagation();
if (!selectCtrl.isMultiple) {
opts.restoreFocus = true;
$mdUtil.nextTick(function () {
$mdSelect.hide(selectCtrl.ngModel.$viewValue);
}, true);
}
}
/**
* check if the mouseup event was on a scrollbar
*/
function mouseOnScrollbar() {
var clickOnScrollbar = false;
if (ev && (ev.currentTarget.children.length > 0)) {
var child = ev.currentTarget.children[0];
var hasScrollbar = child.scrollHeight > child.clientHeight;
if (hasScrollbar && child.children.length > 0) {
var relPosX = ev.pageX - ev.currentTarget.getBoundingClientRect().left;
if (relPosX > child.querySelector('md-option').offsetWidth)
clickOnScrollbar = true;
}
}
return clickOnScrollbar;
}
}
}
}
/**
* To notify listeners that the Select menu has closed,
* trigger the [optional] user-defined expression
*/
function announceClosed(opts) {
var mdSelect = opts.selectCtrl;
if (mdSelect) {
var menuController = opts.selectEl.controller('mdSelectMenu');
mdSelect.setLabelText(menuController.selectedLabels());
mdSelect.triggerClose();
}
}
/**
* Calculate the
*/
function calculateMenuPositions(scope, element, opts) {
var
containerNode = element[0],
targetNode = opts.target[0].children[0], // target the label
parentNode = $document[0].body,
selectNode = opts.selectEl[0],
contentNode = opts.contentEl[0],
parentRect = parentNode.getBoundingClientRect(),
targetRect = targetNode.getBoundingClientRect(),
shouldOpenAroundTarget = false,
bounds = {
left: parentRect.left + SELECT_EDGE_MARGIN,
top: SELECT_EDGE_MARGIN,
bottom: parentRect.height - SELECT_EDGE_MARGIN,
right: parentRect.width - SELECT_EDGE_MARGIN - ($mdUtil.floatingScrollbars() ? 16 : 0)
},
spaceAvailable = {
top: targetRect.top - bounds.top,
left: targetRect.left - bounds.left,
right: bounds.right - (targetRect.left + targetRect.width),
bottom: bounds.bottom - (targetRect.top + targetRect.height)
},
maxWidth = parentRect.width - SELECT_EDGE_MARGIN * 2,
selectedNode = selectNode.querySelector('md-option[selected]'),
optionNodes = selectNode.getElementsByTagName('md-option'),
optgroupNodes = selectNode.getElementsByTagName('md-optgroup'),
isScrollable = calculateScrollable(element, contentNode),
centeredNode;
var loading = isPromiseLike(opts.loadingAsync);
if (!loading) {
// If a selected node, center around that
if (selectedNode) {
centeredNode = selectedNode;
// If there are option groups, center around the first option group
} else if (optgroupNodes.length) {
centeredNode = optgroupNodes[0];
// Otherwise - if we are not loading async - center around the first optionNode
} else if (optionNodes.length) {
centeredNode = optionNodes[0];
// In case there are no options, center on whatever's in there... (eg progress indicator)
} else {
centeredNode = contentNode.firstElementChild || contentNode;
}
} else {
// If loading, center on progress indicator
centeredNode = contentNode.firstElementChild || contentNode;
}
if (contentNode.offsetWidth > maxWidth) {
contentNode.style['max-width'] = maxWidth + 'px';
} else {
contentNode.style.maxWidth = null;
}
if (shouldOpenAroundTarget) {
contentNode.style['min-width'] = targetRect.width + 'px';
}
// Remove padding before we compute the position of the menu
if (isScrollable) {
selectNode.classList.add('md-overflow');
}
var focusedNode = centeredNode;
if ((focusedNode.tagName || '').toUpperCase() === 'MD-OPTGROUP') {
focusedNode = optionNodes[0] || contentNode.firstElementChild || contentNode;
centeredNode = focusedNode;
}
// Cache for autoFocus()
opts.focusedNode = focusedNode;
// Get the selectMenuRect *after* max-width is possibly set above
containerNode.style.display = 'block';
var selectMenuRect = selectNode.getBoundingClientRect();
var centeredRect = getOffsetRect(centeredNode);
if (centeredNode) {
var centeredStyle = $window.getComputedStyle(centeredNode);
centeredRect.paddingLeft = parseInt(centeredStyle.paddingLeft, 10) || 0;
centeredRect.paddingRight = parseInt(centeredStyle.paddingRight, 10) || 0;
}
if (isScrollable) {
var scrollBuffer = contentNode.offsetHeight / 2;
contentNode.scrollTop = centeredRect.top + centeredRect.height / 2 - scrollBuffer;
if (spaceAvailable.top < scrollBuffer) {
contentNode.scrollTop = Math.min(
centeredRect.top,
contentNode.scrollTop + scrollBuffer - spaceAvailable.top
);
} else if (spaceAvailable.bottom < scrollBuffer) {
contentNode.scrollTop = Math.max(
centeredRect.top + centeredRect.height - selectMenuRect.height,
contentNode.scrollTop - scrollBuffer + spaceAvailable.bottom
);
}
}
var left, top, transformOrigin, minWidth;
if (shouldOpenAroundTarget) {
left = targetRect.left;
top = targetRect.top + targetRect.height;
transformOrigin = '50% 0';
if (top + selectMenuRect.height > bounds.bottom) {
top = targetRect.top - selectMenuRect.height;
transformOrigin = '50% 100%';
}
} else {
left = (targetRect.left + centeredRect.left - centeredRect.paddingLeft) + 2;
top = Math.floor(targetRect.top + targetRect.height / 2 - centeredRect.height / 2 -
centeredRect.top + contentNode.scrollTop) + 2;
transformOrigin = (centeredRect.left + targetRect.width / 2) + 'px ' +
(centeredRect.top + centeredRect.height / 2 - contentNode.scrollTop) + 'px 0px';
minWidth = Math.min(targetRect.width + centeredRect.paddingLeft + centeredRect.paddingRight, maxWidth);
}
// Keep left and top within the window
var containerRect = containerNode.getBoundingClientRect();
var scaleX = Math.round(100 * Math.min(targetRect.width / selectMenuRect.width, 1.0)) / 100;
var scaleY = Math.round(100 * Math.min(targetRect.height / selectMenuRect.height, 1.0)) / 100;
return {
container: {
element: angular.element(containerNode),
styles: {
left: Math.floor(clamp(bounds.left, left, bounds.right - containerRect.width)),
top: Math.floor(clamp(bounds.top, top, bounds.bottom - containerRect.height)),
'min-width': minWidth
}
},
dropDown: {
element: angular.element(selectNode),
styles: {
transformOrigin: transformOrigin,
transform: !opts.alreadyOpen ? $mdUtil.supplant('scale({0},{1})', [scaleX, scaleY]) : ""
}
}
};
}
}
function isPromiseLike(obj) {
return obj && angular.isFunction(obj.then);
}
function clamp(min, n, max) {
return Math.max(min, Math.min(n, max));
}
function getOffsetRect(node) {
return node ? {
left: node.offsetLeft,
top: node.offsetTop,
width: node.offsetWidth,
height: node.offsetHeight
} : {left: 0, top: 0, width: 0, height: 0};
}
function calculateScrollable(element, contentNode) {
var isScrollable = false;
try {
var oldDisplay = element[0].style.display;
// Set the element's display to block so that this calculation is correct
element[0].style.display = 'block';
isScrollable = contentNode.scrollHeight > contentNode.offsetHeight;
// Reset it back afterwards
element[0].style.display = oldDisplay;
} finally {
// Nothing to do
}
return isScrollable;
}
}
SelectProvider.$inject = ["$$interimElementProvider"];
ng.material.components.select = angular.module("material.components.select");
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/._md-select-menu-container{position:fixed;left:0;top:0;z-index:90;opacity:0;display:none}._md-select-menu-container:not(._md-clickable){pointer-events:none}._md-select-menu-container md-progress-circular{display:table;margin:24px auto!important}._md-select-menu-container._md-active{display:block;opacity:1}._md-select-menu-container._md-active md-select-menu{transition:all .4s cubic-bezier(.25,.8,.25,1);transition-duration:150ms}._md-select-menu-container._md-active md-select-menu>*{opacity:1;transition:all .3s cubic-bezier(.55,0,.55,.2);transition-duration:150ms;transition-delay:100ms}._md-select-menu-container._md-leave{opacity:0;transition:all .3s cubic-bezier(.55,0,.55,.2);transition-duration:250ms}md-input-container>md-select{margin:0;-webkit-order:2;-ms-flex-order:2;order:2}md-select{display:-webkit-flex;display:-ms-flexbox;display:flex;margin:20px 0 26px}md-select[disabled] ._md-select-value{background-position:0 bottom;background-size:4px 1px;background-repeat:repeat-x;margin-bottom:-1px}md-select:focus{outline:0}md-select[disabled]:hover{cursor:default}md-select:not([disabled]):hover{cursor:pointer}md-select:not([disabled]).ng-invalid.ng-dirty ._md-select-value{border-bottom:2px solid;padding-bottom:0}md-select:not([disabled]):focus ._md-select-value{border-bottom-width:2px;border-bottom-style:solid;padding-bottom:0}._md-select-value{display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-ms-flex-align:center;align-items:center;padding:2px 2px 1px;border-bottom-width:1px;border-bottom-style:solid;background-color:transparent;position:relative;box-sizing:content-box;min-width:64px;min-height:26px;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1}._md-select-value ._md-text{display:inline}._md-select-value :first-child{-webkit-flex:1 0 auto;-ms-flex:1 0 auto;flex:1 0 auto;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;-webkit-transform:translate3d(0,2px,0);transform:translate3d(0,2px,0)}._md-select-value ._md-select-icon{display:block;-webkit-align-items:flex-end;-ms-flex-align:end;align-items:flex-end;text-align:end;width:24px;margin:0 4px;-webkit-transform:translate3d(0,1px,0);transform:translate3d(0,1px,0)}._md-select-value ._md-select-icon:after{display:block;content:'\25BC';position:relative;top:2px;speak:none;-webkit-transform:scaleY(.6) scaleX(1);transform:scaleY(.6) scaleX(1)}._md-select-value._md-select-placeholder{display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-order:1;-ms-flex-order:1;order:1;pointer-events:none;-webkit-font-smoothing:antialiased;padding-left:2px;z-index:1}md-select-menu{display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12);max-height:256px;min-height:48px;overflow-y:hidden;-webkit-transform:scale(1);transform:scale(1)}md-select-menu.md-reverse{-webkit-flex-direction:column-reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}md-select-menu:not(._md-overflow) md-content{padding-top:8px;padding-bottom:8px}body[dir=ltr] md-select-menu,html[dir=ltr] md-select-menu{-webkit-transform-origin:left top;transform-origin:left top;unicode-bidi:embed}body[dir=rtl] md-select-menu,html[dir=rtl] md-select-menu{-webkit-transform-origin:right top;transform-origin:right top;unicode-bidi:embed}html:not([dir]) body:not([dir]) md-select-menu{-webkit-transform-origin:left top;transform-origin:left top;unicode-bidi:embed}md-select-menu bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}md-select-menu bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}md-select-menu md-content{min-width:136px;min-height:48px;max-height:256px;overflow-y:auto}md-select-menu>*{opacity:0}md-option{cursor:pointer;position:relative;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-ms-flex-align:center;align-items:center;width:auto;padding:0 16px;height:48px}md-option[disabled]{cursor:default}md-option:focus{outline:0}md-option ._md-text{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:16px}md-optgroup{display:block}md-optgroup label{display:block;font-size:14px;text-transform:uppercase;padding:16px;font-weight:500}md-optgroup md-option{padding-left:32px;padding-right:32px}@media screen and (-ms-high-contrast:active){._md-select-backdrop{background-color:transparent}md-select-menu{border:1px solid #fff}}
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/
function SelectDirective(e,t,n,r,a,o){function l(a,l){var i=angular.element("<md-select-value><span></span></md-select-value>");if(i.append('<span class="_md-select-icon" aria-hidden="true"></span>'),i.addClass("_md-select-value"),i[0].hasAttribute("id")||i.attr("id","select_value_label_"+t.nextUid()),a.find("md-content").length||a.append(angular.element("<md-content>").append(a.contents())),l.mdOnOpen&&(a.find("md-content").prepend(angular.element('<div> <md-progress-circular md-mode="{{progressMode}}" ng-hide="$$loadingAsyncDone"></md-progress-circular></div>')),a.find("md-option").attr("ng-show","$$loadingAsyncDone")),l.name){var d=angular.element('<select class="_md-visually-hidden">');d.attr({name:"."+l.name,"ng-model":l.ngModel,"aria-hidden":"true",tabindex:"-1"});var c=a.find("md-option");angular.forEach(c,function(e){var t=angular.element("<option>"+e.innerHTML+"</option>");e.hasAttribute("ng-value")?t.attr("ng-value",e.getAttribute("ng-value")):e.hasAttribute("value")&&t.attr("value",e.getAttribute("value")),d.append(t)}),a.parent().append(d)}var s=t.parseAttributeBoolean(l.multiple),u=s?"multiple":"",p='<div class="_md-select-menu-container" aria-hidden="true"><md-select-menu {0}>{1}</md-select-menu></div>';return p=t.supplant(p,[u,a.html()]),a.empty().append(i),a.append(p),l.tabindex=l.tabindex||"0",function(a,l,i,d){function c(){var e=l.attr("aria-label")||l.attr("placeholder");!e&&y&&y.label&&(e=y.label.text()),b=e,r.expect(l,"aria-label",e)}function u(){x&&(A=A||x.find("md-select-menu").controller("mdSelectMenu"),C.setLabelText(A.selectedLabels()))}function p(){if(b){var e=A.selectedLabels({mode:"aria"});l.attr("aria-label",e.length?b+": "+e:b)}}function f(){y&&y.setHasValue(A.selectedLabels().length>0||(l[0].validity||{}).badInput)}function m(){if(x=angular.element(l[0].querySelector("._md-select-menu-container")),D=a,i.mdContainerClass){var e=x[0].getAttribute("class")+" "+i.mdContainerClass;x[0].setAttribute("class",e)}A=x.find("md-select-menu").controller("mdSelectMenu"),A.init(M,i.ngModel),l.on("$destroy",function(){x.remove()})}function h(e){var t=[32,13,38,40];if(-1!=t.indexOf(e.keyCode))e.preventDefault(),g(e);else if(e.keyCode<=90&&e.keyCode>=31){e.preventDefault();var n=A.optNodeForKeyboardSearch(e);if(!n)return;var r=angular.element(n).controller("mdOption");A.isMultiple||A.deselect(Object.keys(A.selected)[0]),A.select(r.hashKey,r.value),A.refreshViewValue()}}function g(){D.isOpen=!0,l.attr("aria-expanded","true"),e.show({scope:D,preserveScope:!0,skipCompile:!0,element:x,target:l[0],selectCtrl:C,preserveElement:!0,hasBackdrop:!0,loadingAsync:i.mdOnOpen?a.$eval(i.mdOnOpen)||!0:!1})["finally"](function(){D.isOpen=!1,l.focus(),l.attr("aria-expanded","false"),M.$setTouched()})}var v,b,$=!0,y=d[0],C=d[1],M=d[2],k=d[3],w=l.find("md-select-value"),E=angular.isDefined(i.readonly);if(y){var S=y.isErrorGetter||function(){return M.$invalid&&M.$touched};if(y.input)throw new Error("<md-input-container> can only have *one* child <input>, <textarea> or <select> element!");y.input=l,y.label||r.expect(l,"aria-label",l.attr("placeholder")),a.$watch(S,y.setInvalid)}var x,D,A;if(m(),n(l),i.name&&k){var O=l.parent()[0].querySelector('select[name=".'+i.name+'"]');t.nextTick(function(){var e=angular.element(O).controller("ngModel");e&&k.$removeControl(e)})}k&&angular.isDefined(i.multiple)&&t.nextTick(function(){var e=M.$modelValue||M.$viewValue;e&&k.$setPristine()});var T=M.$render;M.$render=function(){T(),u(),p(),f()},i.$observe("placeholder",M.$render),C.setLabelText=function(e){C.setIsPlaceholder(!e);var t=i.placeholder||(y&&y.label?y.label.text():"");e=e||t||"";var n=w.children().eq(0);n.html(e)},C.setIsPlaceholder=function(e){e?(w.addClass("_md-select-placeholder"),y&&y.label&&y.label.addClass("_md-placeholder")):(w.removeClass("_md-select-placeholder"),y&&y.label&&y.label.removeClass("_md-placeholder"))},E||(l.on("focus",function(e){y&&y.element.hasClass("md-input-has-value")&&y.setFocused(!0)}),t.nextTick(function(){l.on("blur",function(){$&&($=!1,M.$setUntouched()),D.isOpen||(y&&y.setFocused(!1),f())})})),C.triggerClose=function(){o(i.mdOnClose)(a)},a.$$postDigest(function(){c(),u(),p()}),a.$watch(A.selectedLabels,u);var _;i.$observe("ngMultiple",function(e){_&&_();var t=o(e);_=a.$watch(function(){return t(a)},function(e,t){void 0===e&&void 0===t||(e?l.attr("multiple","multiple"):l.removeAttr("multiple"),l.attr("aria-multiselectable",e?"true":"false"),x&&(A.setMultiple(e),T=M.$render,M.$render=function(){T(),u(),p(),f()},M.$render()))})}),i.$observe("disabled",function(e){angular.isString(e)&&(e=!0),void 0!==v&&v===e||(v=e,e?(l.attr({tabindex:-1,"aria-disabled":"true"}),l.off("click",g),l.off("keydown",h)):(l.attr({tabindex:i.tabindex,"aria-disabled":"false"}),l.on("click",g),l.on("keydown",h)))}),i.disabled||i.ngDisabled||(l.attr({tabindex:i.tabindex,"aria-disabled":"false"}),l.on("click",g),l.on("keydown",h));var R={role:"listbox","aria-expanded":"false","aria-multiselectable":s&&!i.ngMultiple?"true":"false"};l[0].hasAttribute("id")||(R.id="select_"+t.nextUid());var L="select_container_"+t.nextUid();x.attr("id",L),R["aria-owns"]=L,l.attr(R),a.$on("$destroy",function(){e.destroy()["finally"](function(){y&&(y.setFocused(!1),y.setHasValue(!1),y.input=null),M.$setTouched()})})}}return{restrict:"E",require:["^?mdInputContainer","mdSelect","ngModel","?^form"],compile:l,controller:function(){}}}function SelectMenuDirective(e,t,n){function r(e,r,a,o){function l(e){13!=e.keyCode&&32!=e.keyCode||i(e)}function i(n){var r=t.getClosest(n.target,"md-option"),a=r&&angular.element(r).data("$mdOptionController");if(r&&a){if(r.hasAttribute("disabled"))return n.stopImmediatePropagation(),!1;var o=d.hashGetter(a.value),l=angular.isDefined(d.selected[o]);e.$apply(function(){d.isMultiple?l?d.deselect(o):d.select(o,a.value):l||(d.deselect(Object.keys(d.selected)[0]),d.select(o,a.value)),d.refreshViewValue()})}}var d=o[0];n(r),r.on("click",i),r.on("keypress",l)}function a(n,r,a){function o(){var e=i.ngModel.$modelValue||i.ngModel.$viewValue||[];if(angular.isArray(e)){var t=Object.keys(i.selected),n=e.map(i.hashGetter),r=t.filter(function(e){return-1===n.indexOf(e)});r.forEach(i.deselect),n.forEach(function(t,n){i.select(t,e[n])})}}function l(){var e=i.ngModel.$viewValue||i.ngModel.$modelValue;Object.keys(i.selected).forEach(i.deselect),i.select(i.hashGetter(e),e)}var i=this;i.isMultiple=angular.isDefined(r.multiple),i.selected={},i.options={},n.$watchCollection(function(){return i.options},function(){i.ngModel.$render()});var d,c;i.setMultiple=function(e){function t(e,t){return angular.isArray(e||t||[])}var r=i.ngModel;c=c||r.$isEmpty,i.isMultiple=e,d&&d(),i.isMultiple?(r.$validators["md-multiple"]=t,r.$render=o,n.$watchCollection(i.modelBinding,function(e){t(e)&&o(e),i.ngModel.$setPristine()}),r.$isEmpty=function(e){return!e||0===e.length}):(delete r.$validators["md-multiple"],r.$render=l)};var s,u,p,f="",m=300;i.optNodeForKeyboardSearch=function(e){s&&clearTimeout(s),s=setTimeout(function(){s=void 0,f="",p=void 0,u=void 0},m),f+=String.fromCharCode(e.keyCode);var t=new RegExp("^"+f,"i");u||(u=a.find("md-option"),p=new Array(u.length),angular.forEach(u,function(e,t){p[t]=e.textContent.trim()}));for(var n=0;n<p.length;++n)if(t.test(p[n]))return u[n]},i.init=function(t,r){if(i.ngModel=t,i.modelBinding=r,t.$options&&t.$options.trackBy){var a={},o=e(t.$options.trackBy);i.hashGetter=function(e,t){return a.$value=e,o(t||n,a)}}else i.hashGetter=function(e){return angular.isObject(e)?"object_"+(e.$$mdSelectId||(e.$$mdSelectId=++selectNextId)):e};i.setMultiple(i.isMultiple)},i.selectedLabels=function(e){e=e||{};var n=e.mode||"html",r=t.nodesToArray(a[0].querySelectorAll("md-option[selected]"));if(r.length){var o;return"html"==n?o=function(e){var t=e.innerHTML,n=e.querySelector(".md-ripple-container");return n?t.replace(n.outerHTML,""):t}:"aria"==n&&(o=function(e){return e.hasAttribute("aria-label")?e.getAttribute("aria-label"):e.textContent}),r.map(o).join(", ")}return""},i.select=function(e,t){var n=i.options[e];n&&n.setSelected(!0),i.selected[e]=t},i.deselect=function(e){var t=i.options[e];t&&t.setSelected(!1),delete i.selected[e]},i.addOption=function(e,t){if(angular.isDefined(i.options[e]))throw new Error('Duplicate md-option values are not allowed in a select. Duplicate value "'+t.value+'" found.');i.options[e]=t,angular.isDefined(i.selected[e])&&(i.select(e,t.value),i.refreshViewValue())},i.removeOption=function(e){delete i.options[e]},i.refreshViewValue=function(){var e,t=[];for(var n in i.selected)(e=i.options[n])?t.push(e.value):t.push(i.selected[n]);var r=i.ngModel.$options&&i.ngModel.$options.trackBy,a=i.isMultiple?t:t[0],o=i.ngModel.$modelValue;(r?angular.equals(o,a):o==a)||(i.ngModel.$setViewValue(a),i.ngModel.$render())}}return a.$inject=["$scope","$attrs","$element"],{restrict:"E",require:["mdSelectMenu"],scope:!0,controller:a,link:{pre:r}}}function OptionDirective(e,t){function n(e,t){return e.append(angular.element('<div class="_md-text">').append(e.contents())),e.attr("tabindex",t.tabindex||"0"),r}function r(n,r,a,o){function l(e,t,r){if(!c.hashGetter)return void(r||n.$$postDigest(function(){l(e,t,!0)}));var a=c.hashGetter(t,n),o=c.hashGetter(e,n);d.hashKey=o,d.value=e,c.removeOption(a,d),c.addOption(o,d)}function i(){var e={role:"option","aria-selected":"false"};r[0].hasAttribute("id")||(e.id="select_option_"+t.nextUid()),r.attr(e)}var d=o[0],c=o[1];angular.isDefined(a.ngValue)?n.$watch(a.ngValue,l):angular.isDefined(a.value)?l(a.value):n.$watch(function(){return r.text().trim()},l),a.$observe("disabled",function(e){e?r.attr("tabindex","-1"):r.attr("tabindex","0")}),n.$$postDigest(function(){a.$observe("selected",function(e){angular.isDefined(e)&&("string"==typeof e&&(e=!0),e?(c.isMultiple||c.deselect(Object.keys(c.selected)[0]),c.select(d.hashKey,d.value)):c.deselect(d.hashKey),c.refreshViewValue())})}),e.attach(n,r),i(),n.$on("$destroy",function(){c.removeOption(d.hashKey,d)})}function a(e){this.selected=!1,this.setSelected=function(t){t&&!this.selected?e.attr({selected:"selected","aria-selected":"true"}):!t&&this.selected&&(e.removeAttr("selected"),e.attr("aria-selected","false")),this.selected=t}}return a.$inject=["$element"],{restrict:"E",require:["mdOption","^^mdSelectMenu"],controller:a,compile:n}}function OptgroupDirective(){function e(e,t){var n=e.find("label");n.length||(n=angular.element("<label>"),e.prepend(n)),n.addClass("_md-container-ignore"),t.label&&n.text(t.label)}return{restrict:"E",compile:e}}function SelectProvider(e){function t(e,t,l,i,d,c,s,u,p){function f(e,t,n){function r(){return s(t,{addClass:"_md-leave"}).start()}function a(){t.removeClass("_md-active"),t.attr("aria-hidden","true"),t[0].style.display="none",h(n),!n.$destroy&&n.restoreFocus&&n.target.focus()}return n=n||{},n.cleanupInteraction(),n.cleanupResizing(),n.hideBackdrop(),n.$destroy===!0?a():r().then(a)}function m(n,r,a){function o(e,t,n){return n.parent.append(t),d(function(e,n){try{s(t,{removeClass:"_md-leave",duration:0}).start().then(f).then(e)}catch(r){n(r)}})}function f(){return d(function(e){if(a.isRemoved)return d.reject(!1);var t=g(n,r,a);t.container.element.css(b.toCss(t.container.styles)),t.dropDown.element.css(b.toCss(t.dropDown.styles)),c(function(){r.addClass("_md-active"),t.dropDown.element.css(b.toCss({transform:""})),h(a.focusedNode),e()})})}function m(e,t,n){return n.disableParentScroll&&!l.getClosest(n.target,"MD-DIALOG")?n.restoreScroll=l.disableScrollAround(n.element,n.parent):n.disableParentScroll=!1,n.hasBackdrop&&(n.backdrop=l.createBackdrop(e,"_md-select-backdrop _md-click-catcher"),u.enter(n.backdrop,p[0].body,null,{duration:0})),function(){n.backdrop&&n.backdrop.remove(),n.disableParentScroll&&n.restoreScroll(),delete n.restoreScroll}}function h(e){e&&!e.hasAttribute("disabled")&&e.focus()}function $(e,t){var n=r.find("md-select-menu");if(!t.target)throw new Error(l.supplant(v,[t.target]));angular.extend(t,{isRemoved:!1,target:angular.element(t.target),parent:angular.element(t.parent),selectEl:n,contentEl:r.find("md-content"),optionNodes:n[0].getElementsByTagName("md-option")})}function y(){var e=function(e,t,n){return function(){if(!n.isRemoved){var r=g(e,t,n),a=r.container,o=r.dropDown;a.element.css(b.toCss(a.styles)),o.element.css(b.toCss(o.styles))}}}(n,r,a),t=angular.element(i);return t.on("resize",e),t.on("orientationchange",e),function(){t.off("resize",e),t.off("orientationchange",e)}}function C(){a.loadingAsync&&!a.isRemoved&&(n.$$loadingAsyncDone=!1,n.progressMode="indeterminate",d.when(a.loadingAsync).then(function(){n.$$loadingAsyncDone=!0,n.progressMode="",delete a.loadingAsync}).then(function(){c(f)}))}function M(){function n(t){t.preventDefault(),t.stopPropagation(),a.restoreFocus=!1,l.nextTick(e.hide,!0)}function o(n){var r=t.KEY_CODE;switch(n.preventDefault(),n.stopPropagation(),n.keyCode){case r.UP_ARROW:return c();case r.DOWN_ARROW:return d();case r.SPACE:case r.ENTER:var o=l.getClosest(n.target,"md-option");o&&(u.triggerHandler({type:"click",target:o}),n.preventDefault()),s(n);break;case r.TAB:case r.ESCAPE:n.stopPropagation(),n.preventDefault(),a.restoreFocus=!0,l.nextTick(e.hide,!0);break;default:if(n.keyCode>=31&&n.keyCode<=90){var i=u.controller("mdSelectMenu").optNodeForKeyboardSearch(n);a.focusedNode=i||a.focusedNode,i&&i.focus()}}}function i(e){var t,n=l.nodesToArray(a.optionNodes),r=n.indexOf(a.focusedNode);do-1===r?r=0:"next"===e&&r<n.length-1?r++:"prev"===e&&r>0&&r--,t=n[r],t.hasAttribute("disabled")&&(t=void 0);while(!t&&r<n.length-1&&r>0);t&&t.focus(),a.focusedNode=t}function d(){i("next")}function c(){i("prev")}function s(t){function n(){var e=!1;if(t&&t.currentTarget.children.length>0){var n=t.currentTarget.children[0],r=n.scrollHeight>n.clientHeight;if(r&&n.children.length>0){var a=t.pageX-t.currentTarget.getBoundingClientRect().left;a>n.querySelector("md-option").offsetWidth&&(e=!0)}}return e}if(!(t&&"click"==t.type&&t.currentTarget!=u[0]||n())){var r=l.getClosest(t.target,"md-option");r&&r.hasAttribute&&!r.hasAttribute("disabled")&&(t.preventDefault(),t.stopPropagation(),p.isMultiple||(a.restoreFocus=!0,l.nextTick(function(){e.hide(p.ngModel.$viewValue)},!0)))}}if(!a.isRemoved){var u=a.selectEl,p=u.controller("mdSelectMenu")||{};return r.addClass("_md-clickable"),a.backdrop&&a.backdrop.on("click",n),u.on("keydown",o),u.on("click",s),function(){a.backdrop&&a.backdrop.off("click",n),u.off("keydown",o),u.off("click",s),r.removeClass("_md-clickable"),a.isRemoved=!0}}}return C(),$(n,a),a.hideBackdrop=m(n,r,a),o(n,r,a).then(function(e){return r.attr("aria-hidden","false"),a.alreadyOpen=!0,a.cleanupInteraction=M(),a.cleanupResizing=y(),e},a.hideBackdrop)}function h(e){var t=e.selectCtrl;if(t){var n=e.selectEl.controller("mdSelectMenu");t.setLabelText(n.selectedLabels()),t.triggerClose()}}function g(e,t,d){var c,s=t[0],u=d.target[0].children[0],f=p[0].body,m=d.selectEl[0],h=d.contentEl[0],g=f.getBoundingClientRect(),v=u.getBoundingClientRect(),b=!1,$={left:g.left+SELECT_EDGE_MARGIN,top:SELECT_EDGE_MARGIN,bottom:g.height-SELECT_EDGE_MARGIN,right:g.width-SELECT_EDGE_MARGIN-(l.floatingScrollbars()?16:0)},y={top:v.top-$.top,left:v.left-$.left,right:$.right-(v.left+v.width),bottom:$.bottom-(v.top+v.height)},C=g.width-2*SELECT_EDGE_MARGIN,M=m.querySelector("md-option[selected]"),k=m.getElementsByTagName("md-option"),w=m.getElementsByTagName("md-optgroup"),E=o(t,h),S=n(d.loadingAsync);c=S?h.firstElementChild||h:M?M:w.length?w[0]:k.length?k[0]:h.firstElementChild||h,h.offsetWidth>C?h.style["max-width"]=C+"px":h.style.maxWidth=null,b&&(h.style["min-width"]=v.width+"px"),E&&m.classList.add("_md-overflow");var x=c;"MD-OPTGROUP"===(x.tagName||"").toUpperCase()&&(x=k[0]||h.firstElementChild||h,c=x),d.focusedNode=x,s.style.display="block";var D=m.getBoundingClientRect(),A=a(c);if(c){var O=i.getComputedStyle(c);A.paddingLeft=parseInt(O.paddingLeft,10)||0,A.paddingRight=parseInt(O.paddingRight,10)||0}if(E){var T=h.offsetHeight/2;h.scrollTop=A.top+A.height/2-T,y.top<T?h.scrollTop=Math.min(A.top,h.scrollTop+T-y.top):y.bottom<T&&(h.scrollTop=Math.max(A.top+A.height-D.height,h.scrollTop-T+y.bottom))}var _,R,L,N;b?(_=v.left,R=v.top+v.height,L="50% 0",R+D.height>$.bottom&&(R=v.top-D.height,L="50% 100%")):(_=v.left+A.left-A.paddingLeft+2,R=Math.floor(v.top+v.height/2-A.height/2-A.top+h.scrollTop)+2,L=A.left+v.width/2+"px "+(A.top+A.height/2-h.scrollTop)+"px 0px",N=Math.min(v.width+A.paddingLeft+A.paddingRight,C));var V=s.getBoundingClientRect(),B=Math.round(100*Math.min(v.width/D.width,1))/100,G=Math.round(100*Math.min(v.height/D.height,1))/100;return{container:{element:angular.element(s),styles:{left:Math.floor(r($.left,_,$.right-V.width)),top:Math.floor(r($.top,R,$.bottom-V.height)),"min-width":N}},dropDown:{element:angular.element(m),styles:{transformOrigin:L,transform:d.alreadyOpen?"":l.supplant("scale({0},{1})",[B,G])}}}}var v="$mdSelect.show() expected a target element in options.target but got '{0}'!",b=l.dom.animator;return{parent:"body",themable:!0,onShow:m,onRemove:f,hasBackdrop:!0,disableParentScroll:!0}}function n(e){return e&&angular.isFunction(e.then)}function r(e,t,n){return Math.max(e,Math.min(t,n))}function a(e){return e?{left:e.offsetLeft,top:e.offsetTop,width:e.offsetWidth,height:e.offsetHeight}:{left:0,top:0,width:0,height:0}}function o(e,t){var n=!1;try{var r=e[0].style.display;e[0].style.display="block",n=t.scrollHeight>t.offsetHeight,e[0].style.display=r}finally{}return n}return t.$inject=["$mdSelect","$mdConstant","$mdUtil","$window","$q","$$rAF","$animateCss","$animate","$document"],e("$mdSelect").setDefaults({methods:["target"],options:t})}goog.provide("ng.material.components.select"),goog.require("ng.material.components.backdrop"),goog.require("ng.material.core");var SELECT_EDGE_MARGIN=8,selectNextId=0;angular.module("material.components.select",["material.core","material.components.backdrop"]).directive("mdSelect",SelectDirective).directive("mdSelectMenu",SelectMenuDirective).directive("mdOption",OptionDirective).directive("mdOptgroup",OptgroupDirective).provider("$mdSelect",SelectProvider),SelectDirective.$inject=["$mdSelect","$mdUtil","$mdTheming","$mdAria","$compile","$parse"],SelectMenuDirective.$inject=["$parse","$mdUtil","$mdTheming"],OptionDirective.$inject=["$mdButtonInkRipple","$mdUtil"],SelectProvider.$inject=["$$interimElementProvider"],ng.material.components.select=angular.module("material.components.select");
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
goog.provide('ng.material.components.showHide');
goog.require('ng.material.core');
/**
* @ngdoc module
* @name material.components.showHide
*/
// Add additional handlers to ng-show and ng-hide that notify directives
// contained within that they should recompute their size.
// These run in addition to Angular's built-in ng-hide and ng-show directives.
angular.module('material.components.showHide', [
'material.core'
])
.directive('ngShow', createDirective('ngShow', true))
.directive('ngHide', createDirective('ngHide', false));
function createDirective(name, targetValue) {
return ['$mdUtil', function($mdUtil) {
return {
restrict: 'A',
multiElement: true,
link: function($scope, $element, $attr) {
var unregister = $scope.$on('$md-resize-enable', function() {
unregister();
$scope.$watch($attr[name], function(value) {
if (!!value === targetValue) {
$mdUtil.nextTick(function() {
$scope.$broadcast('$md-resize');
});
$mdUtil.dom.animator.waitTransitionEnd($element).then(function() {
$scope.$broadcast('$md-resize');
});
}
});
});
}
};
}];
}
ng.material.components.showHide = angular.module("material.components.showHide");
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/
function createDirective(e,i){return["$mdUtil",function(n){return{restrict:"A",multiElement:!0,link:function(t,o,r){var a=t.$on("$md-resize-enable",function(){a(),t.$watch(r[e],function(e){!!e===i&&(n.nextTick(function(){t.$broadcast("$md-resize")}),n.dom.animator.waitTransitionEnd(o).then(function(){t.$broadcast("$md-resize")}))})})}}}]}goog.provide("ng.material.components.showHide"),goog.require("ng.material.core"),angular.module("material.components.showHide",["material.core"]).directive("ngShow",createDirective("ngShow",!0)).directive("ngHide",createDirective("ngHide",!1)),ng.material.components.showHide=angular.module("material.components.showHide");
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
md-sidenav.md-THEME_NAME-theme {
background-color: '{{background-color}}'; }
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/md-sidenav.md-THEME_NAME-theme{background-color:'{{background-color}}'}
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
md-sidenav {
box-sizing: border-box;
position: absolute;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
z-index: 60;
width: 320px;
max-width: 320px;
bottom: 0;
overflow: auto; }
md-sidenav ul {
list-style: none; }
md-sidenav.md-closed {
display: none; }
md-sidenav.md-closed-add, md-sidenav.md-closed-remove {
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
transition: 0.2s ease-in all; }
md-sidenav.md-closed-add.md-closed-add-active, md-sidenav.md-closed-remove.md-closed-remove-active {
transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); }
md-sidenav.md-locked-open-add, md-sidenav.md-locked-open-remove {
position: static;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0); }
md-sidenav.md-locked-open, md-sidenav.md-locked-open.md-closed, md-sidenav.md-locked-open.md-closed.md-sidenav-left, md-sidenav.md-locked-open.md-closed, md-sidenav.md-locked-open.md-closed.md-sidenav-right, md-sidenav.md-locked-open-remove.md-closed {
position: static;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0); }
md-sidenav.md-locked-open-remove-active {
transition: width 0.3s cubic-bezier(0.55, 0, 0.55, 0.2), min-width 0.3s cubic-bezier(0.55, 0, 0.55, 0.2);
width: 0;
min-width: 0; }
md-sidenav.md-closed.md-locked-open-add {
width: 0;
min-width: 0;
-webkit-transform: translate3d(0%, 0, 0);
transform: translate3d(0%, 0, 0); }
md-sidenav.md-closed.md-locked-open-add-active {
transition: width 0.3s cubic-bezier(0.55, 0, 0.55, 0.2), min-width 0.3s cubic-bezier(0.55, 0, 0.55, 0.2);
width: 320px;
min-width: 320px;
-webkit-transform: translate3d(0%, 0, 0);
transform: translate3d(0%, 0, 0); }
.md-sidenav-backdrop.md-locked-open {
display: none; }
.md-sidenav-left, md-sidenav {
left: 0;
top: 0;
-webkit-transform: translate3d(0%, 0, 0);
transform: translate3d(0%, 0, 0); }
.md-sidenav-left.md-closed, md-sidenav.md-closed {
-webkit-transform: translate3d(-100%, 0, 0);
transform: translate3d(-100%, 0, 0); }
.md-sidenav-right {
left: 100%;
top: 0;
-webkit-transform: translate3d(-100%, 0, 0);
transform: translate3d(-100%, 0, 0); }
.md-sidenav-right.md-closed {
-webkit-transform: translate3d(0%, 0, 0);
transform: translate3d(0%, 0, 0); }
@media screen and (min-width: 600px) {
md-sidenav {
max-width: 400px; } }
@media screen and (max-width: 456px) {
md-sidenav {
width: calc(100% - 56px);
min-width: calc(100% - 56px);
max-width: calc(100% - 56px); } }
@media screen and (-ms-high-contrast: active) {
.md-sidenav-left, md-sidenav {
border-right: 1px solid #fff; }
.md-sidenav-right {
border-left: 1px solid #fff; } }
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
goog.provide('ng.material.components.sidenav');
goog.require('ng.material.components.backdrop');
goog.require('ng.material.core');
/**
* @ngdoc module
* @name material.components.sidenav
*
* @description
* A Sidenav QP component.
*/
angular
.module('material.components.sidenav', [
'material.core',
'material.components.backdrop'
])
.factory('$mdSidenav', SidenavService )
.directive('mdSidenav', SidenavDirective)
.directive('mdSidenavFocus', SidenavFocusDirective)
.controller('$mdSidenavController', SidenavController);
/**
* @ngdoc service
* @name $mdSidenav
* @module material.components.sidenav
*
* @description
* `$mdSidenav` makes it easy to interact with multiple sidenavs
* in an app.
*
* @usage
* <hljs lang="js">
* // Async lookup for sidenav instance; will resolve when the instance is available
* $mdSidenav(componentId).then(function(instance) {
* $log.debug( componentId + "is now ready" );
* });
* // Async toggle the given sidenav;
* // when instance is known ready and lazy lookup is not needed.
* $mdSidenav(componentId)
* .toggle()
* .then(function(){
* $log.debug('toggled');
* });
* // Async open the given sidenav
* $mdSidenav(componentId)
* .open()
* .then(function(){
* $log.debug('opened');
* });
* // Async close the given sidenav
* $mdSidenav(componentId)
* .close()
* .then(function(){
* $log.debug('closed');
* });
* // Sync check to see if the specified sidenav is set to be open
* $mdSidenav(componentId).isOpen();
* // Sync check to whether given sidenav is locked open
* // If this is true, the sidenav will be open regardless of close()
* $mdSidenav(componentId).isLockedOpen();
* </hljs>
*/
function SidenavService($mdComponentRegistry, $q) {
return function(handle) {
// Lookup the controller instance for the specified sidNav instance
var self;
var errorMsg = "SideNav '" + handle + "' is not available!";
var instance = $mdComponentRegistry.get(handle);
if(!instance) {
$mdComponentRegistry.notFoundError(handle);
}
return self = {
// -----------------
// Sync methods
// -----------------
isOpen: function() {
return instance && instance.isOpen();
},
isLockedOpen: function() {
return instance && instance.isLockedOpen();
},
// -----------------
// Async methods
// -----------------
toggle: function() {
return instance ? instance.toggle() : $q.reject(errorMsg);
},
open: function() {
return instance ? instance.open() : $q.reject(errorMsg);
},
close: function() {
return instance ? instance.close() : $q.reject(errorMsg);
},
then : function( callbackFn ) {
var promise = instance ? $q.when(instance) : waitForInstance();
return promise.then( callbackFn || angular.noop );
}
};
/**
* Deferred lookup of component instance using $component registry
*/
function waitForInstance() {
return $mdComponentRegistry
.when(handle)
.then(function( it ){
instance = it;
return it;
});
}
};
}
SidenavService.$inject = ["$mdComponentRegistry", "$q"];
/**
* @ngdoc directive
* @name mdSidenavFocus
* @module material.components.sidenav
*
* @restrict A
*
* @description
* `mdSidenavFocus` provides a way to specify the focused element when a sidenav opens.
* This is completely optional, as the sidenav itself is focused by default.
*
* @usage
* <hljs lang="html">
* <md-sidenav>
* <form>
* <md-input-container>
* <label for="testInput">Label</label>
* <input id="testInput" type="text" md-sidenav-focus>
* </md-input-container>
* </form>
* </md-sidenav>
* </hljs>
**/
function SidenavFocusDirective() {
return {
restrict: 'A',
require: '^mdSidenav',
link: function(scope, element, attr, sidenavCtrl) {
// @see $mdUtil.findFocusTarget(...)
}
};
}
/**
* @ngdoc directive
* @name mdSidenav
* @module material.components.sidenav
* @restrict E
*
* @description
*
* A Sidenav component that can be opened and closed programatically.
*
* By default, upon opening it will slide out on top of the main content area.
*
* For keyboard and screen reader accessibility, focus is sent to the sidenav wrapper by default.
* It can be overridden with the `md-autofocus` directive on the child element you want focused.
*
* @usage
* <hljs lang="html">
* <div layout="row" ng-controller="MyController">
* <md-sidenav md-component-id="left" class="md-sidenav-left">
* Left Nav!
* </md-sidenav>
*
* <md-content>
* Center Content
* <md-button ng-click="openLeftMenu()">
* Open Left Menu
* </md-button>
* </md-content>
*
* <md-sidenav md-component-id="right"
* md-is-locked-open="$mdMedia('min-width: 333px')"
* class="md-sidenav-right">
* <form>
* <md-input-container>
* <label for="testInput">Test input</label>
* <input id="testInput" type="text"
* ng-model="data" md-autofocus>
* </md-input-container>
* </form>
* </md-sidenav>
* </div>
* </hljs>
*
* <hljs lang="js">
* var app = angular.module('myApp', ['ngMaterial']);
* app.controller('MyController', function($scope, $mdSidenav) {
* $scope.openLeftMenu = function() {
* $mdSidenav('left').toggle();
* };
* });
* </hljs>
*
* @param {expression=} md-is-open A model bound to whether the sidenav is opened.
* @param {string=} md-component-id componentId to use with $mdSidenav service.
* @param {expression=} md-is-locked-open When this expression evalutes to true,
* the sidenav 'locks open': it falls into the content's flow instead
* of appearing over it. This overrides the `md-is-open` attribute.
*
* The $mdMedia() service is exposed to the is-locked-open attribute, which
* can be given a media query or one of the `sm`, `gt-sm`, `md`, `gt-md`, `lg` or `gt-lg` presets.
* Examples:
*
* - `<md-sidenav md-is-locked-open="shouldLockOpen"></md-sidenav>`
* - `<md-sidenav md-is-locked-open="$mdMedia('min-width: 1000px')"></md-sidenav>`
* - `<md-sidenav md-is-locked-open="$mdMedia('sm')"></md-sidenav>` (locks open on small screens)
*/
function SidenavDirective($mdMedia, $mdUtil, $mdConstant, $mdTheming, $animate, $compile, $parse, $log, $q, $document) {
return {
restrict: 'E',
scope: {
isOpen: '=?mdIsOpen'
},
controller: '$mdSidenavController',
compile: function(element) {
element.addClass('md-closed');
element.attr('tabIndex', '-1');
return postLink;
}
};
/**
* Directive Post Link function...
*/
function postLink(scope, element, attr, sidenavCtrl) {
var lastParentOverFlow;
var triggeringElement = null;
var promise = $q.when(true);
var isLockedOpenParsed = $parse(attr.mdIsLockedOpen);
var isLocked = function() {
return isLockedOpenParsed(scope.$parent, {
$media: function(arg) {
$log.warn("$media is deprecated for is-locked-open. Use $mdMedia instead.");
return $mdMedia(arg);
},
$mdMedia: $mdMedia
});
};
var backdrop = $mdUtil.createBackdrop(scope, "md-sidenav-backdrop md-opaque ng-enter");
$mdTheming.inherit(backdrop, element);
element.on('$destroy', function() {
backdrop.remove();
sidenavCtrl.destroy();
});
scope.$on('$destroy', function(){
backdrop.remove()
});
scope.$watch(isLocked, updateIsLocked);
scope.$watch('isOpen', updateIsOpen);
// Publish special accessor for the Controller instance
sidenavCtrl.$toggleOpen = toggleOpen;
/**
* Toggle the DOM classes to indicate `locked`
* @param isLocked
*/
function updateIsLocked(isLocked, oldValue) {
scope.isLockedOpen = isLocked;
if (isLocked === oldValue) {
element.toggleClass('md-locked-open', !!isLocked);
} else {
$animate[isLocked ? 'addClass' : 'removeClass'](element, 'md-locked-open');
}
backdrop.toggleClass('md-locked-open', !!isLocked);
}
/**
* Toggle the SideNav view and attach/detach listeners
* @param isOpen
*/
function updateIsOpen(isOpen) {
// Support deprecated md-sidenav-focus attribute as fallback
var focusEl = $mdUtil.findFocusTarget(element) || $mdUtil.findFocusTarget(element,'[md-sidenav-focus]') || element;
var parent = element.parent();
parent[isOpen ? 'on' : 'off']('keydown', onKeyDown);
backdrop[isOpen ? 'on' : 'off']('click', close);
if ( isOpen ) {
// Capture upon opening..
triggeringElement = $document[0].activeElement;
}
disableParentScroll(isOpen);
return promise = $q.all([
isOpen ? $animate.enter(backdrop, parent) : $animate.leave(backdrop),
$animate[isOpen ? 'removeClass' : 'addClass'](element, 'md-closed')
])
.then(function() {
// Perform focus when animations are ALL done...
if (scope.isOpen) {
focusEl && focusEl.focus();
}
});
}
/**
* Prevent parent scrolling (when the SideNav is open)
*/
function disableParentScroll(disabled) {
var parent = element.parent();
if ( disabled && !lastParentOverFlow ) {
lastParentOverFlow = parent.css('overflow');
parent.css('overflow', 'hidden');
} else if (angular.isDefined(lastParentOverFlow)) {
parent.css('overflow', lastParentOverFlow);
lastParentOverFlow = undefined;
}
}
/**
* Toggle the sideNav view and publish a promise to be resolved when
* the view animation finishes.
*
* @param isOpen
* @returns {*}
*/
function toggleOpen( isOpen ) {
if (scope.isOpen == isOpen ) {
return $q.when(true);
} else {
return $q(function(resolve){
// Toggle value to force an async `updateIsOpen()` to run
scope.isOpen = isOpen;
$mdUtil.nextTick(function() {
// When the current `updateIsOpen()` animation finishes
promise.then(function(result) {
if ( !scope.isOpen ) {
// reset focus to originating element (if available) upon close
triggeringElement && triggeringElement.focus();
triggeringElement = null;
}
resolve(result);
});
});
});
}
}
/**
* Auto-close sideNav when the `escape` key is pressed.
* @param evt
*/
function onKeyDown(ev) {
var isEscape = (ev.keyCode === $mdConstant.KEY_CODE.ESCAPE);
return isEscape ? close(ev) : $q.when(true);
}
/**
* With backdrop `clicks` or `escape` key-press, immediately
* apply the CSS close transition... Then notify the controller
* to close() and perform its own actions.
*/
function close(ev) {
ev.preventDefault();
return sidenavCtrl.close();
}
}
}
SidenavDirective.$inject = ["$mdMedia", "$mdUtil", "$mdConstant", "$mdTheming", "$animate", "$compile", "$parse", "$log", "$q", "$document"];
/*
* @private
* @ngdoc controller
* @name SidenavController
* @module material.components.sidenav
*
*/
function SidenavController($scope, $element, $attrs, $mdComponentRegistry, $q) {
var self = this;
// Use Default internal method until overridden by directive postLink
// Synchronous getters
self.isOpen = function() { return !!$scope.isOpen; };
self.isLockedOpen = function() { return !!$scope.isLockedOpen; };
// Async actions
self.open = function() { return self.$toggleOpen( true ); };
self.close = function() { return self.$toggleOpen( false ); };
self.toggle = function() { return self.$toggleOpen( !$scope.isOpen ); };
self.$toggleOpen = function(value) { return $q.when($scope.isOpen = value); };
self.destroy = $mdComponentRegistry.register(self, $attrs.mdComponentId);
}
SidenavController.$inject = ["$scope", "$element", "$attrs", "$mdComponentRegistry", "$q"];
ng.material.components.sidenav = angular.module("material.components.sidenav");
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/md-sidenav{box-sizing:border-box;position:absolute;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;z-index:60;width:320px;max-width:320px;bottom:0;overflow:auto}md-sidenav ul{list-style:none}md-sidenav._md-closed{display:none}md-sidenav._md-closed-add,md-sidenav._md-closed-remove{display:-webkit-flex;display:-ms-flexbox;display:flex;transition:.2s ease-in all}md-sidenav._md-closed-add._md-closed-add-active,md-sidenav._md-closed-remove._md-closed-remove-active{transition:all .4s cubic-bezier(.25,.8,.25,1)}md-sidenav._md-locked-open,md-sidenav._md-locked-open-add,md-sidenav._md-locked-open-remove,md-sidenav._md-locked-open-remove._md-closed,md-sidenav._md-locked-open._md-closed,md-sidenav._md-locked-open._md-closed.md-sidenav-left,md-sidenav._md-locked-open._md-closed.md-sidenav-right{position:static;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}md-sidenav._md-locked-open-remove-active{transition:width .3s cubic-bezier(.55,0,.55,.2),min-width .3s cubic-bezier(.55,0,.55,.2);width:0;min-width:0}md-sidenav._md-closed._md-locked-open-add{width:0;min-width:0;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}md-sidenav._md-closed._md-locked-open-add-active{transition:width .3s cubic-bezier(.55,0,.55,.2),min-width .3s cubic-bezier(.55,0,.55,.2);width:320px;min-width:320px;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.md-sidenav-backdrop._md-locked-open{display:none}.md-sidenav-left,md-sidenav{left:0;top:0;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.md-sidenav-left._md-closed,md-sidenav._md-closed{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.md-sidenav-right{left:100%;top:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.md-sidenav-right._md-closed{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}@media (min-width:600px){md-sidenav{max-width:400px}}@media (max-width:456px){md-sidenav{width:calc(100% - 56px);min-width:calc(100% - 56px);max-width:calc(100% - 56px)}}@media screen and (-ms-high-contrast:active){.md-sidenav-left,md-sidenav{border-right:1px solid #fff}.md-sidenav-right{border-left:1px solid #fff}}
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/
function SidenavService(e,n){return function(o){function t(){return e.when(o).then(function(e){return c=e,e})}var r,i="SideNav '"+o+"' is not available!",c=e.get(o);return c||e.notFoundError(o),r={isOpen:function(){return c&&c.isOpen()},isLockedOpen:function(){return c&&c.isLockedOpen()},toggle:function(){return c?c.toggle():n.reject(i)},open:function(){return c?c.open():n.reject(i)},close:function(){return c?c.close():n.reject(i)},then:function(e){var o=c?n.when(c):t();return o.then(e||angular.noop)}}}}function SidenavFocusDirective(){return{restrict:"A",require:"^mdSidenav",link:function(e,n,o,t){}}}function SidenavDirective(e,n,o,t,r,i,c,a,d,s){function u(i,u,l,m){function p(e,n){i.isLockedOpen=e,e===n?u.toggleClass("_md-locked-open",!!e):r[e?"addClass":"removeClass"](u,"_md-locked-open"),y.toggleClass("_md-locked-open",!!e)}function v(e){var o=n.findFocusTarget(u)||n.findFocusTarget(u,"[md-sidenav-focus]")||u,t=u.parent();return t[e?"on":"off"]("keydown",$),y[e?"on":"off"]("click",O),e&&(k=s[0].activeElement),f(e),C=d.all([e?r.enter(y,t):r.leave(y),r[e?"removeClass":"addClass"](u,"_md-closed")]).then(function(){i.isOpen&&o&&o.focus()})}function f(e){var n=u.parent();e&&!S?(S=n.css("overflow"),n.css("overflow","hidden")):angular.isDefined(S)&&(n.css("overflow",S),S=void 0)}function g(e){return i.isOpen==e?d.when(!0):d(function(o){i.isOpen=e,n.nextTick(function(){C.then(function(e){i.isOpen||(k&&k.focus(),k=null),o(e)})})})}function $(e){var n=e.keyCode===o.KEY_CODE.ESCAPE;return n?O(e):d.when(!0)}function O(e){return e.preventDefault(),m.close()}var S,k=null,C=d.when(!0),h=c(l.mdIsLockedOpen),w=function(){return h(i.$parent,{$media:function(n){return a.warn("$media is deprecated for is-locked-open. Use $mdMedia instead."),e(n)},$mdMedia:e})},y=n.createBackdrop(i,"_md-sidenav-backdrop md-opaque ng-enter");t.inherit(y,u),u.on("$destroy",function(){y.remove(),m.destroy()}),i.$on("$destroy",function(){y.remove()}),i.$watch(w,p),i.$watch("isOpen",v),m.$toggleOpen=g}return{restrict:"E",scope:{isOpen:"=?mdIsOpen"},controller:"$mdSidenavController",compile:function(e){return e.addClass("_md-closed"),e.attr("tabIndex","-1"),u}}}function SidenavController(e,n,o,t,r){var i=this;i.isOpen=function(){return!!e.isOpen},i.isLockedOpen=function(){return!!e.isLockedOpen},i.open=function(){return i.$toggleOpen(!0)},i.close=function(){return i.$toggleOpen(!1)},i.toggle=function(){return i.$toggleOpen(!e.isOpen)},i.$toggleOpen=function(n){return r.when(e.isOpen=n)},i.destroy=t.register(i,o.mdComponentId)}goog.provide("ng.material.components.sidenav"),goog.require("ng.material.components.backdrop"),goog.require("ng.material.core"),angular.module("material.components.sidenav",["material.core","material.components.backdrop"]).factory("$mdSidenav",SidenavService).directive("mdSidenav",SidenavDirective).directive("mdSidenavFocus",SidenavFocusDirective).controller("$mdSidenavController",SidenavController),SidenavService.$inject=["$mdComponentRegistry","$q"],SidenavDirective.$inject=["$mdMedia","$mdUtil","$mdConstant","$mdTheming","$animate","$compile","$parse","$log","$q","$document"],SidenavController.$inject=["$scope","$element","$attrs","$mdComponentRegistry","$q"],ng.material.components.sidenav=angular.module("material.components.sidenav");
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
md-slider.md-THEME_NAME-theme .md-track {
background-color: '{{foreground-3}}'; }
md-slider.md-THEME_NAME-theme .md-track-ticks {
background-color: '{{foreground-4}}'; }
md-slider.md-THEME_NAME-theme .md-focus-thumb {
background-color: '{{foreground-2}}'; }
md-slider.md-THEME_NAME-theme .md-focus-ring {
background-color: '{{accent-color}}'; }
md-slider.md-THEME_NAME-theme .md-disabled-thumb {
border-color: '{{background-color}}'; }
md-slider.md-THEME_NAME-theme.md-min .md-thumb:after {
background-color: '{{background-color}}'; }
md-slider.md-THEME_NAME-theme .md-track.md-track-fill {
background-color: '{{accent-color}}'; }
md-slider.md-THEME_NAME-theme .md-thumb:after {
border-color: '{{accent-color}}';
background-color: '{{accent-color}}'; }
md-slider.md-THEME_NAME-theme .md-sign {
background-color: '{{accent-color}}'; }
md-slider.md-THEME_NAME-theme .md-sign:after {
border-top-color: '{{accent-color}}'; }
md-slider.md-THEME_NAME-theme .md-thumb-text {
color: '{{accent-contrast}}'; }
md-slider.md-THEME_NAME-theme.md-warn .md-focus-ring {
background-color: '{{warn-color}}'; }
md-slider.md-THEME_NAME-theme.md-warn .md-track.md-track-fill {
background-color: '{{warn-color}}'; }
md-slider.md-THEME_NAME-theme.md-warn .md-thumb:after {
border-color: '{{warn-color}}';
background-color: '{{warn-color}}'; }
md-slider.md-THEME_NAME-theme.md-warn .md-sign {
background-color: '{{warn-color}}'; }
md-slider.md-THEME_NAME-theme.md-warn .md-sign:after {
border-top-color: '{{warn-color}}'; }
md-slider.md-THEME_NAME-theme.md-warn .md-thumb-text {
color: '{{warn-contrast}}'; }
md-slider.md-THEME_NAME-theme.md-primary .md-focus-ring {
background-color: '{{primary-color}}'; }
md-slider.md-THEME_NAME-theme.md-primary .md-track.md-track-fill {
background-color: '{{primary-color}}'; }
md-slider.md-THEME_NAME-theme.md-primary .md-thumb:after {
border-color: '{{primary-color}}';
background-color: '{{primary-color}}'; }
md-slider.md-THEME_NAME-theme.md-primary .md-sign {
background-color: '{{primary-color}}'; }
md-slider.md-THEME_NAME-theme.md-primary .md-sign:after {
border-top-color: '{{primary-color}}'; }
md-slider.md-THEME_NAME-theme.md-primary .md-thumb-text {
color: '{{primary-contrast}}'; }
md-slider.md-THEME_NAME-theme[disabled] .md-thumb:after {
border-color: '{{foreground-3}}'; }
md-slider.md-THEME_NAME-theme[disabled]:not(.md-min) .md-thumb:after {
background-color: '{{foreground-3}}'; }
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/md-slider.md-THEME_NAME-theme ._md-track{background-color:'{{foreground-3}}'}md-slider.md-THEME_NAME-theme ._md-track-ticks{background-color:'{{foreground-4}}'}md-slider.md-THEME_NAME-theme ._md-focus-thumb{background-color:'{{foreground-2}}'}md-slider.md-THEME_NAME-theme ._md-focus-ring{background-color:'{{accent-color}}'}md-slider.md-THEME_NAME-theme ._md-disabled-thumb{border-color:'{{background-color}}'}md-slider.md-THEME_NAME-theme._md-min ._md-thumb:after{background-color:'{{background-color}}'}md-slider.md-THEME_NAME-theme ._md-track._md-track-fill{background-color:'{{accent-color}}'}md-slider.md-THEME_NAME-theme ._md-thumb:after{border-color:'{{accent-color}}';background-color:'{{accent-color}}'}md-slider.md-THEME_NAME-theme ._md-sign{background-color:'{{accent-color}}'}md-slider.md-THEME_NAME-theme ._md-sign:after{border-top-color:'{{accent-color}}'}md-slider.md-THEME_NAME-theme ._md-thumb-text{color:'{{accent-contrast}}'}md-slider.md-THEME_NAME-theme.md-warn ._md-focus-ring,md-slider.md-THEME_NAME-theme.md-warn ._md-track._md-track-fill{background-color:'{{warn-color}}'}md-slider.md-THEME_NAME-theme.md-warn ._md-thumb:after{border-color:'{{warn-color}}';background-color:'{{warn-color}}'}md-slider.md-THEME_NAME-theme.md-warn ._md-sign{background-color:'{{warn-color}}'}md-slider.md-THEME_NAME-theme.md-warn ._md-sign:after{border-top-color:'{{warn-color}}'}md-slider.md-THEME_NAME-theme.md-warn ._md-thumb-text{color:'{{warn-contrast}}'}md-slider.md-THEME_NAME-theme.md-primary ._md-focus-ring,md-slider.md-THEME_NAME-theme.md-primary ._md-track._md-track-fill{background-color:'{{primary-color}}'}md-slider.md-THEME_NAME-theme.md-primary ._md-thumb:after{border-color:'{{primary-color}}';background-color:'{{primary-color}}'}md-slider.md-THEME_NAME-theme.md-primary ._md-sign{background-color:'{{primary-color}}'}md-slider.md-THEME_NAME-theme.md-primary ._md-sign:after{border-top-color:'{{primary-color}}'}md-slider.md-THEME_NAME-theme.md-primary ._md-thumb-text{color:'{{primary-contrast}}'}md-slider.md-THEME_NAME-theme[disabled] ._md-thumb:after{border-color:'{{foreground-3}}'}md-slider.md-THEME_NAME-theme[disabled]:not(._md-min) ._md-thumb:after{background-color:'{{foreground-3}}'}
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
@-webkit-keyframes sliderFocusThumb {
0% {
opacity: 0;
-webkit-transform: scale(0);
transform: scale(0); }
50% {
-webkit-transform: scale(1);
transform: scale(1);
opacity: 1; }
100% {
opacity: 0; } }
@keyframes sliderFocusThumb {
0% {
opacity: 0;
-webkit-transform: scale(0);
transform: scale(0); }
50% {
-webkit-transform: scale(1);
transform: scale(1);
opacity: 1; }
100% {
opacity: 0; } }
md-slider {
height: 48px;
position: relative;
display: block;
margin-left: 4px;
margin-right: 4px;
padding: 0;
/**
* Track
*/
/**
* Slider thumb
*/
/* The sign that's focused in discrete mode */
/**
* The border/background that comes in when focused in non-discrete mode
*/
/* Don't animate left/right while panning */ }
md-slider *, md-slider *:after {
box-sizing: border-box; }
md-slider .md-slider-wrapper {
position: relative; }
md-slider .md-track-container {
width: 100%;
position: absolute;
top: 23px;
height: 2px; }
md-slider .md-track {
position: absolute;
left: 0;
right: 0;
height: 100%; }
md-slider .md-track-fill {
transition: width 0.05s linear; }
md-slider .md-track-ticks {
position: absolute;
left: 0;
right: 0;
height: 100%; }
md-slider .md-track-ticks canvas {
width: 100%; }
md-slider .md-thumb-container {
position: absolute;
left: 0;
top: 50%;
-webkit-transform: translate3d(-50%, -50%, 0);
transform: translate3d(-50%, -50%, 0);
transition: left 0.1s linear; }
md-slider .md-thumb {
z-index: 1;
position: absolute;
left: -19px;
top: 5px;
width: 38px;
height: 38px;
border-radius: 38px;
-webkit-transform: scale(0.5);
transform: scale(0.5);
transition: all 0.1s linear; }
md-slider .md-thumb:after {
content: '';
position: absolute;
left: 3px;
top: 3px;
width: 32px;
height: 32px;
border-radius: 32px;
border-width: 3px;
border-style: solid; }
md-slider .md-sign {
/* Center the children (slider-thumb-text) */
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
position: absolute;
left: -14px;
top: -20px;
width: 28px;
height: 28px;
border-radius: 28px;
-webkit-transform: scale(0.4) translate3d(0, 70px, 0);
transform: scale(0.4) translate3d(0, 70px, 0);
transition: all 0.2s ease-in-out;
/* The arrow pointing down under the sign */ }
md-slider .md-sign:after {
position: absolute;
content: '';
left: 0px;
border-radius: 16px;
top: 19px;
border-left: 14px solid transparent;
border-right: 14px solid transparent;
border-top-width: 16px;
border-top-style: solid;
opacity: 0;
-webkit-transform: translate3d(0, -8px, 0);
transform: translate3d(0, -8px, 0);
transition: all 0.2s ease-in-out; }
md-slider .md-sign .md-thumb-text {
z-index: 1;
font-size: 12px;
font-weight: bold; }
md-slider .md-focus-thumb {
position: absolute;
left: -24px;
top: 0px;
width: 48px;
height: 48px;
border-radius: 48px;
display: none;
opacity: 0;
background-color: #C0C0C0;
-webkit-animation: sliderFocusThumb 0.4s linear;
animation: sliderFocusThumb 0.4s linear; }
md-slider .md-focus-ring {
position: absolute;
left: -24px;
top: 0px;
width: 48px;
height: 48px;
border-radius: 48px;
-webkit-transform: scale(0);
transform: scale(0);
transition: all 0.2s linear;
opacity: 0.26; }
md-slider .md-disabled-thumb {
position: absolute;
left: -22px;
top: 2px;
width: 44px;
height: 44px;
border-radius: 44px;
-webkit-transform: scale(0.35);
transform: scale(0.35);
border-width: 6px;
border-style: solid;
display: none; }
md-slider.md-min .md-thumb:after {
background-color: white; }
md-slider.md-min .md-sign {
opacity: 0; }
md-slider:focus {
outline: none; }
md-slider.md-dragging .md-thumb-container,
md-slider.md-dragging .md-track-fill {
transition: none; }
md-slider:not([md-discrete]) {
/* Hide the sign and ticks in non-discrete mode */ }
md-slider:not([md-discrete]) .md-track-ticks,
md-slider:not([md-discrete]) .md-sign {
display: none; }
md-slider:not([md-discrete]):not([disabled]):hover .md-thumb {
-webkit-transform: scale(0.6);
transform: scale(0.6); }
md-slider:not([md-discrete]):not([disabled]):focus .md-focus-thumb, md-slider:not([md-discrete]):not([disabled]).md-active .md-focus-thumb {
display: block; }
md-slider:not([md-discrete]):not([disabled]):focus .md-focus-ring, md-slider:not([md-discrete]):not([disabled]).md-active .md-focus-ring {
-webkit-transform: scale(1);
transform: scale(1); }
md-slider:not([md-discrete]):not([disabled]):focus .md-thumb, md-slider:not([md-discrete]):not([disabled]).md-active .md-thumb {
-webkit-transform: scale(0.85);
transform: scale(0.85); }
md-slider[md-discrete] {
/* Hide the focus thumb in discrete mode */ }
md-slider[md-discrete] .md-focus-thumb,
md-slider[md-discrete] .md-focus-ring {
display: none; }
md-slider[md-discrete]:not([disabled]):focus .md-sign,
md-slider[md-discrete]:not([disabled]):focus .md-sign:after, md-slider[md-discrete]:not([disabled]).md-active .md-sign,
md-slider[md-discrete]:not([disabled]).md-active .md-sign:after {
opacity: 1;
-webkit-transform: translate3d(0, 0, 0) scale(1);
transform: translate3d(0, 0, 0) scale(1); }
md-slider[disabled] .md-track-fill {
display: none; }
md-slider[disabled] .md-sign {
display: none; }
md-slider[disabled] .md-thumb {
-webkit-transform: scale(0.35);
transform: scale(0.35); }
md-slider[disabled] .md-disabled-thumb {
display: block; }
@media screen and (-ms-high-contrast: active) {
md-slider.md-default-theme .md-track {
border-bottom: 1px solid #fff; } }
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
goog.provide('ng.material.components.slider');
goog.require('ng.material.core');
/**
* @ngdoc module
* @name material.components.slider
*/
angular.module('material.components.slider', [
'material.core'
])
.directive('mdSlider', SliderDirective);
/**
* @ngdoc directive
* @name mdSlider
* @module material.components.slider
* @restrict E
* @description
* The `<md-slider>` component allows the user to choose from a range of
* values.
*
* As per the [material design spec](http://www.google.com/design/spec/style/color.html#color-ui-color-application)
* the slider is in the accent color by default. The primary color palette may be used with
* the `md-primary` class.
*
* It has two modes: 'normal' mode, where the user slides between a wide range
* of values, and 'discrete' mode, where the user slides between only a few
* select values.
*
* To enable discrete mode, add the `md-discrete` attribute to a slider,
* and use the `step` attribute to change the distance between
* values the user is allowed to pick.
*
* @usage
* <h4>Normal Mode</h4>
* <hljs lang="html">
* <md-slider ng-model="myValue" min="5" max="500">
* </md-slider>
* </hljs>
* <h4>Discrete Mode</h4>
* <hljs lang="html">
* <md-slider md-discrete ng-model="myDiscreteValue" step="10" min="10" max="130">
* </md-slider>
* </hljs>
*
* @param {boolean=} md-discrete Whether to enable discrete mode.
* @param {number=} step The distance between values the user is allowed to pick. Default 1.
* @param {number=} min The minimum value the user is allowed to pick. Default 0.
* @param {number=} max The maximum value the user is allowed to pick. Default 100.
*/
function SliderDirective($$rAF, $window, $mdAria, $mdUtil, $mdConstant, $mdTheming, $mdGesture, $parse, $log) {
return {
scope: {},
require: '?ngModel',
template:
'<div class="md-slider-wrapper">' +
'<div class="md-track-container">' +
'<div class="md-track"></div>' +
'<div class="md-track md-track-fill"></div>' +
'<div class="md-track-ticks"></div>' +
'</div>' +
'<div class="md-thumb-container">' +
'<div class="md-thumb"></div>' +
'<div class="md-focus-thumb"></div>' +
'<div class="md-focus-ring"></div>' +
'<div class="md-sign">' +
'<span class="md-thumb-text"></span>' +
'</div>' +
'<div class="md-disabled-thumb"></div>' +
'</div>' +
'</div>',
compile: compile
};
// **********************************************************
// Private Methods
// **********************************************************
function compile (tElement, tAttrs) {
if (!tAttrs.tabindex) tElement.attr('tabindex', 0);
tElement.attr('role', 'slider');
$mdAria.expect(tElement, 'aria-label');
return postLink;
}
function postLink(scope, element, attr, ngModelCtrl) {
$mdTheming(element);
ngModelCtrl = ngModelCtrl || {
// Mock ngModelController if it doesn't exist to give us
// the minimum functionality needed
$setViewValue: function(val) {
this.$viewValue = val;
this.$viewChangeListeners.forEach(function(cb) { cb(); });
},
$parsers: [],
$formatters: [],
$viewChangeListeners: []
};
var isDisabledGetter = angular.noop;
if (attr.disabled != null) {
isDisabledGetter = function() { return true; };
} else if (attr.ngDisabled) {
isDisabledGetter = angular.bind(null, $parse(attr.ngDisabled), scope.$parent);
}
var thumb = angular.element(element[0].querySelector('.md-thumb'));
var thumbText = angular.element(element[0].querySelector('.md-thumb-text'));
var thumbContainer = thumb.parent();
var trackContainer = angular.element(element[0].querySelector('.md-track-container'));
var activeTrack = angular.element(element[0].querySelector('.md-track-fill'));
var tickContainer = angular.element(element[0].querySelector('.md-track-ticks'));
var throttledRefreshDimensions = $mdUtil.throttle(refreshSliderDimensions, 5000);
// Default values, overridable by attrs
angular.isDefined(attr.min) ? attr.$observe('min', updateMin) : updateMin(0);
angular.isDefined(attr.max) ? attr.$observe('max', updateMax) : updateMax(100);
angular.isDefined(attr.step)? attr.$observe('step', updateStep) : updateStep(1);
// We have to manually stop the $watch on ngDisabled because it exists
// on the parent scope, and won't be automatically destroyed when
// the component is destroyed.
var stopDisabledWatch = angular.noop;
if (attr.ngDisabled) {
stopDisabledWatch = scope.$parent.$watch(attr.ngDisabled, updateAriaDisabled);
}
$mdGesture.register(element, 'drag');
element
.on('keydown', keydownListener)
.on('$md.pressdown', onPressDown)
.on('$md.pressup', onPressUp)
.on('$md.dragstart', onDragStart)
.on('$md.drag', onDrag)
.on('$md.dragend', onDragEnd);
// On resize, recalculate the slider's dimensions and re-render
function updateAll() {
refreshSliderDimensions();
ngModelRender();
redrawTicks();
}
setTimeout(updateAll, 0);
var debouncedUpdateAll = $$rAF.throttle(updateAll);
angular.element($window).on('resize', debouncedUpdateAll);
scope.$on('$destroy', function() {
angular.element($window).off('resize', debouncedUpdateAll);
stopDisabledWatch();
});
ngModelCtrl.$render = ngModelRender;
ngModelCtrl.$viewChangeListeners.push(ngModelRender);
ngModelCtrl.$formatters.push(minMaxValidator);
ngModelCtrl.$formatters.push(stepValidator);
/**
* Attributes
*/
var min;
var max;
var step;
function updateMin(value) {
min = parseFloat(value);
element.attr('aria-valuemin', value);
updateAll();
}
function updateMax(value) {
max = parseFloat(value);
element.attr('aria-valuemax', value);
updateAll();
}
function updateStep(value) {
step = parseFloat(value);
redrawTicks();
}
function updateAriaDisabled(isDisabled) {
element.attr('aria-disabled', !!isDisabled);
}
// Draw the ticks with canvas.
// The alternative to drawing ticks with canvas is to draw one element for each tick,
// which could quickly become a performance bottleneck.
var tickCanvas, tickCtx;
function redrawTicks() {
if (!angular.isDefined(attr.mdDiscrete)) return;
if ( angular.isUndefined(step) ) return;
if ( step <= 0 ) {
var msg = 'Slider step value must be greater than zero when in discrete mode';
$log.error(msg);
throw new Error(msg);
}
var numSteps = Math.floor( (max - min) / step );
if (!tickCanvas) {
tickCanvas = angular.element('<canvas>').css('position', 'absolute');
tickContainer.append(tickCanvas);
var trackTicksStyle = $window.getComputedStyle(tickContainer[0]);
tickCtx = tickCanvas[0].getContext('2d');
tickCtx.fillStyle = trackTicksStyle.backgroundColor || 'black';
}
var dimensions = getSliderDimensions();
tickCanvas[0].width = dimensions.width;
tickCanvas[0].height = dimensions.height;
var distance;
for (var i = 0; i <= numSteps; i++) {
distance = Math.floor(dimensions.width * (i / numSteps));
tickCtx.fillRect(distance - 1, 0, 2, dimensions.height);
}
}
/**
* Refreshing Dimensions
*/
var sliderDimensions = {};
refreshSliderDimensions();
function refreshSliderDimensions() {
sliderDimensions = trackContainer[0].getBoundingClientRect();
}
function getSliderDimensions() {
throttledRefreshDimensions();
return sliderDimensions;
}
/**
* left/right arrow listener
*/
function keydownListener(ev) {
if(element[0].hasAttribute('disabled')) {
return;
}
var changeAmount;
if (ev.keyCode === $mdConstant.KEY_CODE.LEFT_ARROW) {
changeAmount = -step;
} else if (ev.keyCode === $mdConstant.KEY_CODE.RIGHT_ARROW) {
changeAmount = step;
}
if (changeAmount) {
if (ev.metaKey || ev.ctrlKey || ev.altKey) {
changeAmount *= 4;
}
ev.preventDefault();
ev.stopPropagation();
scope.$evalAsync(function() {
setModelValue(ngModelCtrl.$viewValue + changeAmount);
});
}
}
/**
* ngModel setters and validators
*/
function setModelValue(value) {
ngModelCtrl.$setViewValue( minMaxValidator(stepValidator(value)) );
}
function ngModelRender() {
if (isNaN(ngModelCtrl.$viewValue)) {
ngModelCtrl.$viewValue = ngModelCtrl.$modelValue;
}
var percent = (ngModelCtrl.$viewValue - min) / (max - min);
scope.modelValue = ngModelCtrl.$viewValue;
element.attr('aria-valuenow', ngModelCtrl.$viewValue);
setSliderPercent(percent);
thumbText.text( ngModelCtrl.$viewValue );
}
function minMaxValidator(value) {
if (angular.isNumber(value)) {
return Math.max(min, Math.min(max, value));
}
}
function stepValidator(value) {
if (angular.isNumber(value)) {
var formattedValue = (Math.round((value - min) / step) * step + min);
// Format to 3 digits after the decimal point - fixes #2015.
return (Math.round(formattedValue * 1000) / 1000);
}
}
/**
* @param percent 0-1
*/
function setSliderPercent(percent) {
percent = clamp(percent);
var percentStr = (percent * 100) + '%';
activeTrack.css('width', percentStr);
thumbContainer.css('left',percentStr);
element.toggleClass('md-min', percent === 0);
element.toggleClass('md-max', percent === 1);
}
/**
* Slide listeners
*/
var isDragging = false;
var isDiscrete = angular.isDefined(attr.mdDiscrete);
function onPressDown(ev) {
if (isDisabledGetter()) return;
element.addClass('md-active');
element[0].focus();
refreshSliderDimensions();
var exactVal = percentToValue( positionToPercent( ev.pointer.x ));
var closestVal = minMaxValidator( stepValidator(exactVal) );
scope.$apply(function() {
setModelValue( closestVal );
setSliderPercent( valueToPercent(closestVal));
});
}
function onPressUp(ev) {
if (isDisabledGetter()) return;
element.removeClass('md-dragging md-active');
var exactVal = percentToValue( positionToPercent( ev.pointer.x ));
var closestVal = minMaxValidator( stepValidator(exactVal) );
scope.$apply(function() {
setModelValue(closestVal);
ngModelRender();
});
}
function onDragStart(ev) {
if (isDisabledGetter()) return;
isDragging = true;
ev.stopPropagation();
element.addClass('md-dragging');
setSliderFromEvent(ev);
}
function onDrag(ev) {
if (!isDragging) return;
ev.stopPropagation();
setSliderFromEvent(ev);
}
function onDragEnd(ev) {
if (!isDragging) return;
ev.stopPropagation();
isDragging = false;
}
function setSliderFromEvent(ev) {
// While panning discrete, update only the
// visual positioning but not the model value.
if ( isDiscrete ) adjustThumbPosition( ev.pointer.x );
else doSlide( ev.pointer.x );
}
/**
* Slide the UI by changing the model value
* @param x
*/
function doSlide( x ) {
scope.$evalAsync( function() {
setModelValue( percentToValue( positionToPercent(x) ));
});
}
/**
* Slide the UI without changing the model (while dragging/panning)
* @param x
*/
function adjustThumbPosition( x ) {
var exactVal = percentToValue( positionToPercent( x ));
var closestVal = minMaxValidator( stepValidator(exactVal) );
setSliderPercent( positionToPercent(x) );
thumbText.text( closestVal );
}
/**
* Clamps the value to be between 0 and 1.
* @param {number} value The value to clamp.
* @returns {number}
*/
function clamp(value) {
return Math.max(0, Math.min(value || 0, 1));
}
/**
* Convert horizontal position on slider to percentage value of offset from beginning...
* @param x
* @returns {number}
*/
function positionToPercent( x ) {
return Math.max(0, Math.min(1, (x - sliderDimensions.left) / (sliderDimensions.width)));
}
/**
* Convert percentage offset on slide to equivalent model value
* @param percent
* @returns {*}
*/
function percentToValue( percent ) {
return (min + percent * (max - min));
}
function valueToPercent( val ) {
return (val - min)/(max - min);
}
}
}
SliderDirective.$inject = ["$$rAF", "$window", "$mdAria", "$mdUtil", "$mdConstant", "$mdTheming", "$mdGesture", "$parse", "$log"];
ng.material.components.slider = angular.module("material.components.slider");
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/@-webkit-keyframes sliderFocusThumb{0%{opacity:0;-webkit-transform:scale(0);transform:scale(0)}50%{-webkit-transform:scale(1);transform:scale(1);opacity:1}100%{opacity:0}}@keyframes sliderFocusThumb{0%{opacity:0;-webkit-transform:scale(0);transform:scale(0)}50%{-webkit-transform:scale(1);transform:scale(1);opacity:1}100%{opacity:0}}md-slider{height:48px;position:relative;display:block;margin-left:4px;margin-right:4px;padding:0}md-slider *,md-slider :after{box-sizing:border-box}md-slider ._md-slider-wrapper{position:relative}md-slider ._md-track-container{width:100%;position:absolute;top:23px;height:2px}md-slider ._md-track{position:absolute;left:0;right:0;height:100%}md-slider ._md-track-fill{transition:width .05s linear}md-slider ._md-track-ticks{position:absolute;left:0;right:0;height:100%}md-slider ._md-track-ticks canvas{width:100%}md-slider ._md-thumb-container{position:absolute;left:0;top:50%;-webkit-transform:translate3d(-50%,-50%,0);transform:translate3d(-50%,-50%,0);transition:left .1s linear}md-slider ._md-thumb{z-index:1;position:absolute;left:-19px;top:5px;width:38px;height:38px;border-radius:38px;-webkit-transform:scale(.5);transform:scale(.5);transition:all .1s linear}md-slider ._md-thumb:after{content:'';position:absolute;left:3px;top:3px;width:32px;height:32px;border-radius:32px;border-width:3px;border-style:solid}md-slider ._md-sign{display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;position:absolute;left:-14px;top:-20px;width:28px;height:28px;border-radius:28px;-webkit-transform:scale(.4) translate3d(0,70px,0);transform:scale(.4) translate3d(0,70px,0);transition:all .2s ease-in-out}md-slider ._md-sign:after{position:absolute;content:'';left:0;border-radius:16px;top:19px;border-left:14px solid transparent;border-right:14px solid transparent;border-top-width:16px;border-top-style:solid;opacity:0;-webkit-transform:translate3d(0,-8px,0);transform:translate3d(0,-8px,0);transition:all .2s ease-in-out}md-slider ._md-sign ._md-thumb-text{z-index:1;font-size:12px;font-weight:700}md-slider ._md-focus-thumb{position:absolute;left:-24px;top:0;width:48px;height:48px;border-radius:48px;display:none;opacity:0;background-color:silver;-webkit-animation:sliderFocusThumb .4s linear;animation:sliderFocusThumb .4s linear}md-slider ._md-focus-ring{position:absolute;left:-24px;top:0;width:48px;height:48px;border-radius:48px;-webkit-transform:scale(0);transform:scale(0);transition:all .2s linear;opacity:.26}md-slider ._md-disabled-thumb{position:absolute;left:-22px;top:2px;width:44px;height:44px;border-radius:44px;-webkit-transform:scale(.35);transform:scale(.35);border-width:6px;border-style:solid;display:none}md-slider._md-min ._md-thumb:after{background-color:#fff}md-slider._md-min ._md-sign{opacity:0}md-slider:focus{outline:0}md-slider._md-dragging ._md-thumb-container,md-slider._md-dragging ._md-track-fill{transition:none}md-slider:not([md-discrete]) ._md-sign,md-slider:not([md-discrete]) ._md-track-ticks{display:none}md-slider:not([md-discrete]):not([disabled]):hover ._md-thumb{-webkit-transform:scale(.6);transform:scale(.6)}md-slider:not([md-discrete]):not([disabled])._md-active ._md-focus-thumb,md-slider:not([md-discrete]):not([disabled]):focus ._md-focus-thumb{display:block}md-slider:not([md-discrete]):not([disabled])._md-active ._md-focus-ring,md-slider:not([md-discrete]):not([disabled]):focus ._md-focus-ring{-webkit-transform:scale(1);transform:scale(1)}md-slider:not([md-discrete]):not([disabled])._md-active ._md-thumb,md-slider:not([md-discrete]):not([disabled]):focus ._md-thumb{-webkit-transform:scale(.85);transform:scale(.85)}md-slider[md-discrete] ._md-focus-ring,md-slider[md-discrete] ._md-focus-thumb{display:none}md-slider[md-discrete]:not([disabled])._md-active ._md-sign,md-slider[md-discrete]:not([disabled])._md-active ._md-sign:after,md-slider[md-discrete]:not([disabled]):focus ._md-sign,md-slider[md-discrete]:not([disabled]):focus ._md-sign:after{opacity:1;-webkit-transform:translate3d(0,0,0) scale(1);transform:translate3d(0,0,0) scale(1)}md-slider[disabled] ._md-sign,md-slider[disabled] ._md-track-fill{display:none}md-slider[disabled] ._md-thumb{-webkit-transform:scale(.35);transform:scale(.35)}md-slider[disabled] ._md-disabled-thumb{display:block}@media screen and (-ms-high-contrast:active){md-slider.md-default-theme ._md-track{border-bottom:1px solid #fff}}
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/
function SliderDirective(e,t,a,n,i,r,o,l,s){function d(e,t){return t.tabindex||e.attr("tabindex",0),e.attr("role","slider"),a.expect(e,"aria-label"),u}function u(a,l,d,u){function c(){$(),b(),p()}function m(e){Y=parseFloat(e),l.attr("aria-valuemin",e),c()}function v(e){j=parseFloat(e),l.attr("aria-valuemax",e),c()}function f(e){H=parseFloat(e),p()}function g(){l.attr("aria-disabled",!!N)}function p(){if(angular.isDefined(d.mdDiscrete)&&!angular.isUndefined(H)){if(0>=H){var e="Slider step value must be greater than zero when in discrete mode";throw s.error(e),new Error(e)}var a=Math.floor((j-Y)/H);if(!I){I=angular.element("<canvas>").css("position","absolute"),G.append(I);var n=t.getComputedStyle(G[0]);J=I[0].getContext("2d"),J.fillStyle=n.backgroundColor||"black"}var i=h();I[0].width=i.width,I[0].height=i.height;for(var r,o=0;a>=o;o++)r=Math.floor(i.width*(o/a)),J.fillRect(r-1,0,2,i.height)}}function $(){Q=z[0].getBoundingClientRect()}function h(){return U(),Q}function _(e){if(!N){var t;e.keyCode===i.KEY_CODE.LEFT_ARROW?t=-H:e.keyCode===i.KEY_CODE.RIGHT_ARROW&&(t=H),t&&((e.metaKey||e.ctrlKey||e.altKey)&&(t*=4),e.preventDefault(),e.stopPropagation(),a.$evalAsync(function(){w(u.$viewValue+t)}))}}function w(e){u.$setViewValue(x(y(e)))}function b(){isNaN(u.$viewValue)&&(u.$viewValue=u.$modelValue);var e=(u.$viewValue-Y)/(j-Y);a.modelValue=u.$viewValue,l.attr("aria-valuenow",u.$viewValue),C(e),P.text(u.$viewValue)}function x(e){return angular.isNumber(e)?Math.max(Y,Math.min(j,e)):void 0}function y(e){if(angular.isNumber(e)){var t=Math.round((e-Y)/H)*H+Y;return Math.round(1e3*t)/1e3}}function C(e){e=R(e);var t=100*e+"%";B.css("width",t),T.css("left",t),l.toggleClass("_md-min",0===e),l.toggleClass("_md-max",1===e)}function k(e){if(!N){l.addClass("_md-active"),l[0].focus(),$();var t=K(F(e.pointer.x)),n=x(y(t));a.$apply(function(){w(n),C(L(n))})}}function V(e){if(!N){l.removeClass("_md-dragging _md-active");var t=K(F(e.pointer.x)),n=x(y(t));a.$apply(function(){w(n),b()})}}function D(e){N||(X=!0,e.stopPropagation(),l.addClass("_md-dragging"),q(e))}function S(e){X&&(e.stopPropagation(),q(e))}function M(e){X&&(e.stopPropagation(),X=!1)}function q(e){Z?E(e.pointer.x):A(e.pointer.x)}function A(e){a.$evalAsync(function(){w(K(F(e)))})}function E(e){var t=K(F(e)),a=x(y(t));C(F(e)),P.text(a)}function R(e){return Math.max(0,Math.min(e||0,1))}function F(e){return Math.max(0,Math.min(1,(e-Q.left)/Q.width))}function K(e){return Y+e*(j-Y)}function L(e){return(e-Y)/(j-Y)}r(l),u=u||{$setViewValue:function(e){this.$viewValue=e,this.$viewChangeListeners.forEach(function(e){e()})},$parsers:[],$formatters:[],$viewChangeListeners:[]};var N=!1;d.$observe("disabled",function(e){N=n.parseAttributeBoolean(e,!1),g()});var O=angular.element(l[0].querySelector("._md-thumb")),P=angular.element(l[0].querySelector("._md-thumb-text")),T=O.parent(),z=angular.element(l[0].querySelector("._md-track-container")),B=angular.element(l[0].querySelector("._md-track-fill")),G=angular.element(l[0].querySelector("._md-track-ticks")),U=n.throttle($,5e3);angular.isDefined(d.min)?d.$observe("min",m):m(0),angular.isDefined(d.max)?d.$observe("max",v):v(100),angular.isDefined(d.step)?d.$observe("step",f):f(1),o.register(l,"drag"),l.on("keydown",_).on("$md.pressdown",k).on("$md.pressup",V).on("$md.dragstart",D).on("$md.drag",S).on("$md.dragend",M),setTimeout(c,0);var W=e.throttle(c);angular.element(t).on("resize",W),a.$on("$destroy",function(){angular.element(t).off("resize",W)}),u.$render=b,u.$viewChangeListeners.push(b),u.$formatters.push(x),u.$formatters.push(y);var Y,j,H,I,J,Q={};$();var X=!1,Z=angular.isDefined(d.mdDiscrete)}return{scope:{},require:"?ngModel",template:'<div class="_md-slider-wrapper"><div class="_md-track-container"><div class="_md-track"></div><div class="_md-track _md-track-fill"></div><div class="_md-track-ticks"></div></div><div class="_md-thumb-container"><div class="_md-thumb"></div><div class="_md-focus-thumb"></div><div class="_md-focus-ring"></div><div class="_md-sign"><span class="_md-thumb-text"></span></div><div class="_md-disabled-thumb"></div></div></div>',compile:d}}goog.provide("ng.material.components.slider"),goog.require("ng.material.core"),angular.module("material.components.slider",["material.core"]).directive("mdSlider",SliderDirective),SliderDirective.$inject=["$$rAF","$window","$mdAria","$mdUtil","$mdConstant","$mdTheming","$mdGesture","$parse","$log"],ng.material.components.slider=angular.module("material.components.slider");
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
.md-sticky-clone {
z-index: 2;
top: 0;
left: 0;
right: 0;
position: absolute !important;
-webkit-transform: translate3d(-9999px, -9999px, 0);
transform: translate3d(-9999px, -9999px, 0); }
.md-sticky-clone[sticky-state="active"] {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0); }
.md-sticky-clone[sticky-state="active"]:not(.md-sticky-no-effect) .md-subheader-inner {
-webkit-animation: subheaderStickyHoverIn 0.3s ease-out both;
animation: subheaderStickyHoverIn 0.3s ease-out both; }
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
goog.provide('ng.material.components.sticky');
goog.require('ng.material.components.content');
goog.require('ng.material.core');
/**
* @ngdoc module
* @name material.components.sticky
* @description
* Sticky effects for md
*
*/
angular
.module('material.components.sticky', [
'material.core',
'material.components.content'
])
.factory('$mdSticky', MdSticky);
/**
* @ngdoc service
* @name $mdSticky
* @module material.components.sticky
*
* @description
* The `$mdSticky`service provides a mixin to make elements sticky.
*
* By default the `$mdSticky` service compiles the cloned element, when not specified through the `elementClone`
* parameter, in the same scope as the actual element lives.
*
*
* <h3>Notes</h3>
* When using an element which is containing a compiled directive, which changed its DOM structure during compilation,
* you should compile the clone yourself using the plain template.<br/><br/>
* See the right usage below:
* <hljs lang="js">
* angular.module('myModule')
* .directive('stickySelect', function($mdSticky, $compile) {
* var SELECT_TEMPLATE =
* '<md-select ng-model="selected">' +
* '<md-option>Option 1</md-option>' +
* '</md-select>';
*
* return {
* restrict: 'E',
* replace: true,
* template: SELECT_TEMPLATE,
* link: function(scope,element) {
* $mdSticky(scope, element, $compile(SELECT_TEMPLATE)(scope));
* }
* };
* });
* </hljs>
*
* @usage
* <hljs lang="js">
* angular.module('myModule')
* .directive('stickyText', function($mdSticky, $compile) {
* return {
* restrict: 'E',
* template: '<span>Sticky Text</span>',
* link: function(scope,element) {
* $mdSticky(scope, element);
* }
* };
* });
* </hljs>
*
* @returns A `$mdSticky` function that takes three arguments:
* - `scope`
* - `element`: The element that will be 'sticky'
* - `elementClone`: A clone of the element, that will be shown
* when the user starts scrolling past the original element.
* If not provided, it will use the result of `element.clone()` and compiles it in the given scope.
*/
function MdSticky($document, $mdConstant, $$rAF, $mdUtil, $compile) {
var browserStickySupport = checkStickySupport();
/**
* Registers an element as sticky, used internally by directives to register themselves
*/
return function registerStickyElement(scope, element, stickyClone) {
var contentCtrl = element.controller('mdContent');
if (!contentCtrl) return;
if (browserStickySupport) {
element.css({
position: browserStickySupport,
top: 0,
'z-index': 2
});
} else {
var $$sticky = contentCtrl.$element.data('$$sticky');
if (!$$sticky) {
$$sticky = setupSticky(contentCtrl);
contentCtrl.$element.data('$$sticky', $$sticky);
}
// Compile our cloned element, when cloned in this service, into the given scope.
var cloneElement = stickyClone || $compile(element.clone())(scope);
var deregister = $$sticky.add(element, cloneElement);
scope.$on('$destroy', deregister);
}
};
function setupSticky(contentCtrl) {
var contentEl = contentCtrl.$element;
// Refresh elements is very expensive, so we use the debounced
// version when possible.
var debouncedRefreshElements = $$rAF.throttle(refreshElements);
// setupAugmentedScrollEvents gives us `$scrollstart` and `$scroll`,
// more reliable than `scroll` on android.
setupAugmentedScrollEvents(contentEl);
contentEl.on('$scrollstart', debouncedRefreshElements);
contentEl.on('$scroll', onScroll);
var self;
return self = {
prev: null,
current: null, //the currently stickied item
next: null,
items: [],
add: add,
refreshElements: refreshElements
};
/***************
* Public
***************/
// Add an element and its sticky clone to this content's sticky collection
function add(element, stickyClone) {
stickyClone.addClass('md-sticky-clone');
var item = {
element: element,
clone: stickyClone
};
self.items.push(item);
$mdUtil.nextTick(function() {
contentEl.prepend(item.clone);
});
debouncedRefreshElements();
return function remove() {
self.items.forEach(function(item, index) {
if (item.element[0] === element[0]) {
self.items.splice(index, 1);
item.clone.remove();
}
});
debouncedRefreshElements();
};
}
function refreshElements() {
// Sort our collection of elements by their current position in the DOM.
// We need to do this because our elements' order of being added may not
// be the same as their order of display.
self.items.forEach(refreshPosition);
self.items = self.items.sort(function(a, b) {
return a.top < b.top ? -1 : 1;
});
// Find which item in the list should be active,
// based upon the content's current scroll position
var item;
var currentScrollTop = contentEl.prop('scrollTop');
for (var i = self.items.length - 1; i >= 0; i--) {
if (currentScrollTop > self.items[i].top) {
item = self.items[i];
break;
}
}
setCurrentItem(item);
}
/***************
* Private
***************/
// Find the `top` of an item relative to the content element,
// and also the height.
function refreshPosition(item) {
// Find the top of an item by adding to the offsetHeight until we reach the
// content element.
var current = item.element[0];
item.top = 0;
item.left = 0;
while (current && current !== contentEl[0]) {
item.top += current.offsetTop;
item.left += current.offsetLeft;
if ( current.offsetParent ){
item.right += current.offsetParent.offsetWidth - current.offsetWidth - current.offsetLeft; //Compute offsetRight
}
current = current.offsetParent;
}
item.height = item.element.prop('offsetHeight');
item.clone.css('margin-left', item.left + 'px');
if ($mdUtil.floatingScrollbars()) {
item.clone.css('margin-right', '0');
}
}
// As we scroll, push in and select the correct sticky element.
function onScroll() {
var scrollTop = contentEl.prop('scrollTop');
var isScrollingDown = scrollTop > (onScroll.prevScrollTop || 0);
// Store the previous scroll so we know which direction we are scrolling
onScroll.prevScrollTop = scrollTop;
//
// AT TOP (not scrolling)
//
if (scrollTop === 0) {
// If we're at the top, just clear the current item and return
setCurrentItem(null);
return;
}
//
// SCROLLING DOWN (going towards the next item)
//
if (isScrollingDown) {
// If we've scrolled down past the next item's position, sticky it and return
if (self.next && self.next.top <= scrollTop) {
setCurrentItem(self.next);
return;
}
// If the next item is close to the current one, push the current one up out of the way
if (self.current && self.next && self.next.top - scrollTop <= self.next.height) {
translate(self.current, scrollTop + (self.next.top - self.next.height - scrollTop));
return;
}
}
//
// SCROLLING UP (not at the top & not scrolling down; must be scrolling up)
//
if (!isScrollingDown) {
// If we've scrolled up past the previous item's position, sticky it and return
if (self.current && self.prev && scrollTop < self.current.top) {
setCurrentItem(self.prev);
return;
}
// If the next item is close to the current one, pull the current one down into view
if (self.next && self.current && (scrollTop >= (self.next.top - self.current.height))) {
translate(self.current, scrollTop + (self.next.top - scrollTop - self.current.height));
return;
}
}
//
// Otherwise, just move the current item to the proper place (scrolling up or down)
//
if (self.current) {
translate(self.current, scrollTop);
}
}
function setCurrentItem(item) {
if (self.current === item) return;
// Deactivate currently active item
if (self.current) {
translate(self.current, null);
setStickyState(self.current, null);
}
// Activate new item if given
if (item) {
setStickyState(item, 'active');
}
self.current = item;
var index = self.items.indexOf(item);
// If index === -1, index + 1 = 0. It works out.
self.next = self.items[index + 1];
self.prev = self.items[index - 1];
setStickyState(self.next, 'next');
setStickyState(self.prev, 'prev');
}
function setStickyState(item, state) {
if (!item || item.state === state) return;
if (item.state) {
item.clone.attr('sticky-prev-state', item.state);
item.element.attr('sticky-prev-state', item.state);
}
item.clone.attr('sticky-state', state);
item.element.attr('sticky-state', state);
item.state = state;
}
function translate(item, amount) {
if (!item) return;
if (amount === null || amount === undefined) {
if (item.translateY) {
item.translateY = null;
item.clone.css($mdConstant.CSS.TRANSFORM, '');
}
} else {
item.translateY = amount;
item.clone.css(
$mdConstant.CSS.TRANSFORM,
'translate3d(' + item.left + 'px,' + amount + 'px,0)'
);
}
}
}
// Function to check for browser sticky support
function checkStickySupport($el) {
var stickyProp;
var testEl = angular.element('<div>');
$document[0].body.appendChild(testEl[0]);
var stickyProps = ['sticky', '-webkit-sticky'];
for (var i = 0; i < stickyProps.length; ++i) {
testEl.css({position: stickyProps[i], top: 0, 'z-index': 2});
if (testEl.css('position') == stickyProps[i]) {
stickyProp = stickyProps[i];
break;
}
}
testEl.remove();
return stickyProp;
}
// Android 4.4 don't accurately give scroll events.
// To fix this problem, we setup a fake scroll event. We say:
// > If a scroll or touchmove event has happened in the last DELAY milliseconds,
// then send a `$scroll` event every animationFrame.
// Additionally, we add $scrollstart and $scrollend events.
function setupAugmentedScrollEvents(element) {
var SCROLL_END_DELAY = 200;
var isScrolling;
var lastScrollTime;
element.on('scroll touchmove', function() {
if (!isScrolling) {
isScrolling = true;
$$rAF.throttle(loopScrollEvent);
element.triggerHandler('$scrollstart');
}
element.triggerHandler('$scroll');
lastScrollTime = +$mdUtil.now();
});
function loopScrollEvent() {
if (+$mdUtil.now() - lastScrollTime > SCROLL_END_DELAY) {
isScrolling = false;
element.triggerHandler('$scrollend');
} else {
element.triggerHandler('$scroll');
$$rAF.throttle(loopScrollEvent);
}
}
}
}
MdSticky.$inject = ["$document", "$mdConstant", "$$rAF", "$mdUtil", "$compile"];
ng.material.components.sticky = angular.module("material.components.sticky");
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/._md-sticky-clone{z-index:2;top:0;left:0;right:0;position:absolute!important;-webkit-transform:translate3d(-9999px,-9999px,0);transform:translate3d(-9999px,-9999px,0)}._md-sticky-clone[sticky-state=active]{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}._md-sticky-clone[sticky-state=active]:not(.md-sticky-no-effect) ._md-subheader-inner{-webkit-animation:subheaderStickyHoverIn .3s ease-out both;animation:subheaderStickyHoverIn .3s ease-out both}
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/
function MdSticky(t,e,n,r,o){function i(t){function o(t,e){e.addClass("_md-sticky-clone");var n={element:t,clone:e};return d.items.push(n),r.nextTick(function(){p.prepend(n.clone)}),m(),function(){d.items.forEach(function(e,n){e.element[0]===t[0]&&(d.items.splice(n,1),e.clone.remove())}),m()}}function i(){d.items.forEach(l),d.items=d.items.sort(function(t,e){return t.top<e.top?-1:1});for(var t,e=p.prop("scrollTop"),n=d.items.length-1;n>=0;n--)if(e>d.items[n].top){t=d.items[n];break}s(t)}function l(t){var e=t.element[0];for(t.top=0,t.left=0,t.right=0;e&&e!==p[0];)t.top+=e.offsetTop,t.left+=e.offsetLeft,e.offsetParent&&(t.right+=e.offsetParent.offsetWidth-e.offsetWidth-e.offsetLeft),e=e.offsetParent;t.height=t.element.prop("offsetHeight");var n=r.floatingScrollbars()?"0":void 0;r.bidi(t.clone,"margin-left",t.left,n),r.bidi(t.clone,"margin-right",n,t.right)}function a(){var t=p.prop("scrollTop"),e=t>(a.prevScrollTop||0);if(a.prevScrollTop=t,0===t)return void s(null);if(e){if(d.next&&d.next.top<=t)return void s(d.next);if(d.current&&d.next&&d.next.top-t<=d.next.height)return void u(d.current,t+(d.next.top-d.next.height-t))}if(!e){if(d.current&&d.prev&&t<d.current.top)return void s(d.prev);if(d.next&&d.current&&t>=d.next.top-d.current.height)return void u(d.current,t+(d.next.top-t-d.current.height))}d.current&&u(d.current,t)}function s(t){if(d.current!==t){d.current&&(u(d.current,null),f(d.current,null)),t&&f(t,"active"),d.current=t;var e=d.items.indexOf(t);d.next=d.items[e+1],d.prev=d.items[e-1],f(d.next,"next"),f(d.prev,"prev")}}function f(t,e){t&&t.state!==e&&(t.state&&(t.clone.attr("sticky-prev-state",t.state),t.element.attr("sticky-prev-state",t.state)),t.clone.attr("sticky-state",e),t.element.attr("sticky-state",e),t.state=e)}function u(t,n){t&&(null===n||void 0===n?t.translateY&&(t.translateY=null,t.clone.css(e.CSS.TRANSFORM,"")):(t.translateY=n,r.bidi(t.clone,e.CSS.TRANSFORM,"translate3d("+t.left+"px,"+n+"px,0)","translateY("+n+"px)")))}var p=t.$element,m=n.throttle(i);c(p),p.on("$scrollstart",m),p.on("$scroll",a);var d;return d={prev:null,current:null,next:null,items:[],add:o,refreshElements:i}}function l(e){var n,r=angular.element("<div>");t[0].body.appendChild(r[0]);for(var o=["sticky","-webkit-sticky"],i=0;i<o.length;++i)if(r.css({position:o[i],top:0,"z-index":2}),r.css("position")==o[i]){n=o[i];break}return r.remove(),n}function c(t){function e(){+r.now()-i>l?(o=!1,t.triggerHandler("$scrollend")):(t.triggerHandler("$scroll"),n.throttle(e))}var o,i,l=200;t.on("scroll touchmove",function(){o||(o=!0,n.throttle(e),t.triggerHandler("$scrollstart")),t.triggerHandler("$scroll"),i=+r.now()})}var a=l();return function(t,e,n){var r=e.controller("mdContent");if(r)if(a)e.css({position:a,top:0,"z-index":2});else{var l=r.$element.data("$$sticky");l||(l=i(r),r.$element.data("$$sticky",l));var c=n||o(e.clone())(t),s=l.add(e,c);t.$on("$destroy",s)}}}goog.provide("ng.material.components.sticky"),goog.require("ng.material.components.content"),goog.require("ng.material.core"),angular.module("material.components.sticky",["material.core","material.components.content"]).factory("$mdSticky",MdSticky),MdSticky.$inject=["$document","$mdConstant","$$rAF","$mdUtil","$compile"],ng.material.components.sticky=angular.module("material.components.sticky");
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
.md-subheader.md-THEME_NAME-theme {
color: '{{ foreground-2-0.23 }}';
background-color: '{{background-color}}'; }
.md-subheader.md-THEME_NAME-theme.md-primary {
color: '{{primary-color}}'; }
.md-subheader.md-THEME_NAME-theme.md-accent {
color: '{{accent-color}}'; }
.md-subheader.md-THEME_NAME-theme.md-warn {
color: '{{warn-color}}'; }
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/.md-subheader.md-THEME_NAME-theme{color:'{{ foreground-2-0.23 }}';background-color:'{{background-color}}'}.md-subheader.md-THEME_NAME-theme.md-primary{color:'{{primary-color}}'}.md-subheader.md-THEME_NAME-theme.md-accent{color:'{{accent-color}}'}.md-subheader.md-THEME_NAME-theme.md-warn{color:'{{warn-color}}'}
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
@-webkit-keyframes subheaderStickyHoverIn {
0% {
box-shadow: 0 0 0 0 transparent; }
100% {
box-shadow: 0px 2px 4px 0 rgba(0, 0, 0, 0.16); } }
@keyframes subheaderStickyHoverIn {
0% {
box-shadow: 0 0 0 0 transparent; }
100% {
box-shadow: 0px 2px 4px 0 rgba(0, 0, 0, 0.16); } }
@-webkit-keyframes subheaderStickyHoverOut {
0% {
box-shadow: 0px 2px 4px 0 rgba(0, 0, 0, 0.16); }
100% {
box-shadow: 0 0 0 0 transparent; } }
@keyframes subheaderStickyHoverOut {
0% {
box-shadow: 0px 2px 4px 0 rgba(0, 0, 0, 0.16); }
100% {
box-shadow: 0 0 0 0 transparent; } }
.md-subheader-wrapper:not(.md-sticky-no-effect) {
transition: 0.2s ease-out margin; }
.md-subheader-wrapper:not(.md-sticky-no-effect) .md-subheader {
margin: 0; }
.md-subheader-wrapper:not(.md-sticky-no-effect).md-sticky-clone {
z-index: 2; }
.md-subheader-wrapper:not(.md-sticky-no-effect)[sticky-state="active"] {
margin-top: -2px; }
.md-subheader-wrapper:not(.md-sticky-no-effect):not(.md-sticky-clone)[sticky-prev-state="active"] .md-subheader-inner:after {
-webkit-animation: subheaderStickyHoverOut 0.3s ease-out both;
animation: subheaderStickyHoverOut 0.3s ease-out both; }
.md-subheader {
display: block;
font-size: 14px;
font-weight: 500;
line-height: 1em;
margin: 0 0 0 0;
position: relative; }
.md-subheader .md-subheader-inner {
display: block;
padding: 16px; }
.md-subheader .md-subheader-content {
display: block;
z-index: 1;
position: relative; }
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
goog.provide('ng.material.components.subheader');
goog.require('ng.material.components.sticky');
goog.require('ng.material.core');
/**
* @ngdoc module
* @name material.components.subheader
* @description
* SubHeader module
*
* Subheaders are special list tiles that delineate distinct sections of a
* list or grid list and are typically related to the current filtering or
* sorting criteria. Subheader tiles are either displayed inline with tiles or
* can be associated with content, for example, in an adjacent column.
*
* Upon scrolling, subheaders remain pinned to the top of the screen and remain
* pinned until pushed on or off screen by the next subheader. @see [Material
* Design Specifications](https://www.google.com/design/spec/components/subheaders.html)
*
* > To improve the visual grouping of content, use the system color for your subheaders.
*
*/
angular
.module('material.components.subheader', [
'material.core',
'material.components.sticky'
])
.directive('mdSubheader', MdSubheaderDirective);
/**
* @ngdoc directive
* @name mdSubheader
* @module material.components.subheader
*
* @restrict E
*
* @description
* The `<md-subheader>` directive is a subheader for a section. By default it is sticky.
* You can make it not sticky by applying the `md-no-sticky` class to the subheader.
*
*
* @usage
* <hljs lang="html">
* <md-subheader>Online Friends</md-subheader>
* </hljs>
*/
function MdSubheaderDirective($mdSticky, $compile, $mdTheming, $mdUtil) {
return {
restrict: 'E',
replace: true,
transclude: true,
template: (
'<div class="md-subheader">' +
' <div class="md-subheader-inner">' +
' <span class="md-subheader-content"></span>' +
' </div>' +
'</div>'
),
link: function postLink(scope, element, attr, controllers, transclude) {
$mdTheming(element);
var outerHTML = element[0].outerHTML;
function getContent(el) {
return angular.element(el[0].querySelector('.md-subheader-content'));
}
// Transclude the user-given contents of the subheader
// the conventional way.
transclude(scope, function(clone) {
getContent(element).append(clone);
});
// Create another clone, that uses the outer and inner contents
// of the element, that will be 'stickied' as the user scrolls.
if (!element.hasClass('md-no-sticky')) {
transclude(scope, function(clone) {
// If the user adds an ng-if or ng-repeat directly to the md-subheader element, the
// compiled clone below will only be a comment tag (since they replace their elements with
// a comment) which cannot be properly passed to the $mdSticky; so we wrap it in our own
// DIV to ensure we have something $mdSticky can use
var wrapperHtml = '<div class="md-subheader-wrapper">' + outerHTML + '</div>';
var stickyClone = $compile(wrapperHtml)(scope);
// Append the sticky
$mdSticky(scope, element, stickyClone);
// Delay initialization until after any `ng-if`/`ng-repeat`/etc has finished before
// attempting to create the clone
$mdUtil.nextTick(function() {
getContent(stickyClone).append(clone);
});
});
}
}
}
}
MdSubheaderDirective.$inject = ["$mdSticky", "$compile", "$mdTheming", "$mdUtil"];
ng.material.components.subheader = angular.module("material.components.subheader");
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/@-webkit-keyframes subheaderStickyHoverIn{0%{box-shadow:0 0 0 0 transparent}100%{box-shadow:0 2px 4px 0 rgba(0,0,0,.16)}}@keyframes subheaderStickyHoverIn{0%{box-shadow:0 0 0 0 transparent}100%{box-shadow:0 2px 4px 0 rgba(0,0,0,.16)}}@-webkit-keyframes subheaderStickyHoverOut{0%{box-shadow:0 2px 4px 0 rgba(0,0,0,.16)}100%{box-shadow:0 0 0 0 transparent}}@keyframes subheaderStickyHoverOut{0%{box-shadow:0 2px 4px 0 rgba(0,0,0,.16)}100%{box-shadow:0 0 0 0 transparent}}._md-subheader-wrapper:not(.md-sticky-no-effect){transition:.2s ease-out margin}._md-subheader-wrapper:not(.md-sticky-no-effect) .md-subheader{margin:0}._md-subheader-wrapper:not(.md-sticky-no-effect).md-sticky-clone{z-index:2}._md-subheader-wrapper:not(.md-sticky-no-effect)[sticky-state=active]{margin-top:-2px}._md-subheader-wrapper:not(.md-sticky-no-effect):not(.md-sticky-clone)[sticky-prev-state=active] ._md-subheader-inner:after{-webkit-animation:subheaderStickyHoverOut .3s ease-out both;animation:subheaderStickyHoverOut .3s ease-out both}.md-subheader{display:block;font-size:14px;font-weight:500;line-height:1em;margin:0;position:relative}.md-subheader ._md-subheader-inner{display:block;padding:16px}.md-subheader ._md-subheader-content{display:block;z-index:1;position:relative}
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/
function MdSubheaderDirective(e,a,r,n){return{restrict:"E",replace:!0,transclude:!0,template:'<div class="md-subheader"> <div class="_md-subheader-inner"> <span class="_md-subheader-content"></span> </div></div>',link:function(t,i,d,c,o){function s(e){return angular.element(e[0].querySelector("._md-subheader-content"))}r(i);var u=i[0].outerHTML;o(t,function(e){s(i).append(e)}),i.hasClass("md-no-sticky")||o(t,function(r){var d='<div class="_md-subheader-wrapper">'+u+"</div>",c=a(d)(t);e(t,i,c),n.nextTick(function(){s(c).append(r)})})}}}goog.provide("ng.material.components.subheader"),goog.require("ng.material.components.sticky"),goog.require("ng.material.core"),angular.module("material.components.subheader",["material.core","material.components.sticky"]).directive("mdSubheader",MdSubheaderDirective),MdSubheaderDirective.$inject=["$mdSticky","$compile","$mdTheming","$mdUtil"],ng.material.components.subheader=angular.module("material.components.subheader");
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
goog.provide('ng.material.components.swipe');
goog.require('ng.material.core');
/**
* @ngdoc module
* @name material.components.swipe
* @description Swipe module!
*/
/**
* @ngdoc directive
* @module material.components.swipe
* @name mdSwipeLeft
*
* @restrict A
*
* @description
* The md-swipe-left directive allows you to specify custom behavior when an element is swiped
* left.
*
* @usage
* <hljs lang="html">
* <div md-swipe-left="onSwipeLeft()">Swipe me left!</div>
* </hljs>
*/
/**
* @ngdoc directive
* @module material.components.swipe
* @name mdSwipeRight
*
* @restrict A
*
* @description
* The md-swipe-right directive allows you to specify custom behavior when an element is swiped
* right.
*
* @usage
* <hljs lang="html">
* <div md-swipe-right="onSwipeRight()">Swipe me right!</div>
* </hljs>
*/
/**
* @ngdoc directive
* @module material.components.swipe
* @name mdSwipeUp
*
* @restrict A
*
* @description
* The md-swipe-up directive allows you to specify custom behavior when an element is swiped
* up.
*
* @usage
* <hljs lang="html">
* <div md-swipe-up="onSwipeUp()">Swipe me up!</div>
* </hljs>
*/
/**
* @ngdoc directive
* @module material.components.swipe
* @name mdSwipeDown
*
* @restrict A
*
* @description
* The md-swipe-down directive allows you to specify custom behavior when an element is swiped
* down.
*
* @usage
* <hljs lang="html">
* <div md-swipe-down="onSwipDown()">Swipe me down!</div>
* </hljs>
*/
angular.module('material.components.swipe', ['material.core'])
.directive('mdSwipeLeft', getDirective('SwipeLeft'))
.directive('mdSwipeRight', getDirective('SwipeRight'))
.directive('mdSwipeUp', getDirective('SwipeUp'))
.directive('mdSwipeDown', getDirective('SwipeDown'));
function getDirective(name) {
var directiveName = 'md' + name;
var eventName = '$md.' + name.toLowerCase();
DirectiveFactory.$inject = ["$parse"];
return DirectiveFactory;
/* ngInject */
function DirectiveFactory($parse) {
return { restrict: 'A', link: postLink };
function postLink(scope, element, attr) {
var fn = $parse(attr[directiveName]);
element.on(eventName, function(ev) {
scope.$apply(function() { fn(scope, { $event: ev }); });
});
}
}
}
ng.material.components.swipe = angular.module("material.components.swipe");
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/
function getDirective(e){function i(e){function i(i,n,o){var c=e(o[t]);n.on(r,function(e){i.$apply(function(){c(i,{$event:e})})})}return{restrict:"A",link:i}}var t="md"+e,r="$md."+e.toLowerCase();return i.$inject=["$parse"],i}goog.provide("ng.material.components.swipe"),goog.require("ng.material.core"),angular.module("material.components.swipe",["material.core"]).directive("mdSwipeLeft",getDirective("SwipeLeft")).directive("mdSwipeRight",getDirective("SwipeRight")).directive("mdSwipeUp",getDirective("SwipeUp")).directive("mdSwipeDown",getDirective("SwipeDown")),ng.material.components.swipe=angular.module("material.components.swipe");
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
md-switch.md-THEME_NAME-theme .md-ink-ripple {
color: '{{background-500}}'; }
md-switch.md-THEME_NAME-theme .md-thumb {
background-color: '{{background-50}}'; }
md-switch.md-THEME_NAME-theme .md-bar {
background-color: '{{background-500}}'; }
md-switch.md-THEME_NAME-theme.md-checked .md-ink-ripple {
color: '{{accent-color}}'; }
md-switch.md-THEME_NAME-theme.md-checked .md-thumb {
background-color: '{{accent-color}}'; }
md-switch.md-THEME_NAME-theme.md-checked .md-bar {
background-color: '{{accent-color-0.5}}'; }
md-switch.md-THEME_NAME-theme.md-checked.md-focused .md-thumb:before {
background-color: '{{accent-color-0.26}}'; }
md-switch.md-THEME_NAME-theme.md-checked.md-primary .md-ink-ripple {
color: '{{primary-color}}'; }
md-switch.md-THEME_NAME-theme.md-checked.md-primary .md-thumb {
background-color: '{{primary-color}}'; }
md-switch.md-THEME_NAME-theme.md-checked.md-primary .md-bar {
background-color: '{{primary-color-0.5}}'; }
md-switch.md-THEME_NAME-theme.md-checked.md-primary.md-focused .md-thumb:before {
background-color: '{{primary-color-0.26}}'; }
md-switch.md-THEME_NAME-theme.md-checked.md-warn .md-ink-ripple {
color: '{{warn-color}}'; }
md-switch.md-THEME_NAME-theme.md-checked.md-warn .md-thumb {
background-color: '{{warn-color}}'; }
md-switch.md-THEME_NAME-theme.md-checked.md-warn .md-bar {
background-color: '{{warn-color-0.5}}'; }
md-switch.md-THEME_NAME-theme.md-checked.md-warn.md-focused .md-thumb:before {
background-color: '{{warn-color-0.26}}'; }
md-switch.md-THEME_NAME-theme[disabled] .md-thumb {
background-color: '{{background-400}}'; }
md-switch.md-THEME_NAME-theme[disabled] .md-bar {
background-color: '{{foreground-4}}'; }
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/md-switch.md-THEME_NAME-theme .md-ink-ripple{color:'{{background-500}}'}md-switch.md-THEME_NAME-theme ._md-thumb{background-color:'{{background-50}}'}md-switch.md-THEME_NAME-theme ._md-bar{background-color:'{{background-500}}'}md-switch.md-THEME_NAME-theme.md-checked .md-ink-ripple{color:'{{accent-color}}'}md-switch.md-THEME_NAME-theme.md-checked ._md-thumb{background-color:'{{accent-color}}'}md-switch.md-THEME_NAME-theme.md-checked ._md-bar{background-color:'{{accent-color-0.5}}'}md-switch.md-THEME_NAME-theme.md-checked.md-focused ._md-thumb:before{background-color:'{{accent-color-0.26}}'}md-switch.md-THEME_NAME-theme.md-checked.md-primary .md-ink-ripple{color:'{{primary-color}}'}md-switch.md-THEME_NAME-theme.md-checked.md-primary ._md-thumb{background-color:'{{primary-color}}'}md-switch.md-THEME_NAME-theme.md-checked.md-primary ._md-bar{background-color:'{{primary-color-0.5}}'}md-switch.md-THEME_NAME-theme.md-checked.md-primary.md-focused ._md-thumb:before{background-color:'{{primary-color-0.26}}'}md-switch.md-THEME_NAME-theme.md-checked.md-warn .md-ink-ripple{color:'{{warn-color}}'}md-switch.md-THEME_NAME-theme.md-checked.md-warn ._md-thumb{background-color:'{{warn-color}}'}md-switch.md-THEME_NAME-theme.md-checked.md-warn ._md-bar{background-color:'{{warn-color-0.5}}'}md-switch.md-THEME_NAME-theme.md-checked.md-warn.md-focused ._md-thumb:before{background-color:'{{warn-color-0.26}}'}md-switch.md-THEME_NAME-theme[disabled] ._md-thumb{background-color:'{{background-400}}'}md-switch.md-THEME_NAME-theme[disabled] ._md-bar{background-color:'{{foreground-4}}'}
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
.md-inline-form md-switch {
margin-top: 18px;
margin-bottom: 19px; }
md-switch {
margin: 16px 0;
white-space: nowrap;
cursor: pointer;
outline: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
height: 30px;
line-height: 28px;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
margin-left: inherit;
margin-right: 16px; }
html[dir=rtl] md-switch {
margin-left: 16px;
unicode-bidi: embed; }
body[dir=rtl] md-switch {
margin-left: 16px;
unicode-bidi: embed; }
md-switch bdo[dir=rtl] {
direction: rtl;
unicode-bidi: bidi-override; }
md-switch bdo[dir=ltr] {
direction: ltr;
unicode-bidi: bidi-override; }
html[dir=rtl] md-switch {
margin-right: inherit;
unicode-bidi: embed; }
body[dir=rtl] md-switch {
margin-right: inherit;
unicode-bidi: embed; }
md-switch bdo[dir=rtl] {
direction: rtl;
unicode-bidi: bidi-override; }
md-switch bdo[dir=ltr] {
direction: ltr;
unicode-bidi: bidi-override; }
md-switch:last-of-type {
margin-left: inherit;
margin-right: 0; }
html[dir=rtl] md-switch:last-of-type {
margin-left: 0;
unicode-bidi: embed; }
body[dir=rtl] md-switch:last-of-type {
margin-left: 0;
unicode-bidi: embed; }
md-switch:last-of-type bdo[dir=rtl] {
direction: rtl;
unicode-bidi: bidi-override; }
md-switch:last-of-type bdo[dir=ltr] {
direction: ltr;
unicode-bidi: bidi-override; }
html[dir=rtl] md-switch:last-of-type {
margin-right: inherit;
unicode-bidi: embed; }
body[dir=rtl] md-switch:last-of-type {
margin-right: inherit;
unicode-bidi: embed; }
md-switch:last-of-type bdo[dir=rtl] {
direction: rtl;
unicode-bidi: bidi-override; }
md-switch:last-of-type bdo[dir=ltr] {
direction: ltr;
unicode-bidi: bidi-override; }
md-switch[disabled] {
cursor: default; }
md-switch[disabled] .md-container {
cursor: default; }
md-switch .md-container {
cursor: -webkit-grab;
cursor: grab;
width: 36px;
height: 24px;
position: relative;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
margin-right: 8px;
float: left; }
md-switch:not([disabled]) .md-dragging,
md-switch:not([disabled]).md-dragging .md-container {
cursor: -webkit-grabbing;
cursor: grabbing; }
md-switch.md-focused:not([disabled]) .md-thumb:before {
left: -8px;
top: -8px;
right: -8px;
bottom: -8px; }
md-switch.md-focused:not([disabled]):not(.md-checked) .md-thumb:before {
background-color: rgba(0, 0, 0, 0.12); }
md-switch .md-label {
border-color: transparent;
border-width: 0;
float: left; }
md-switch .md-bar {
left: 1px;
width: 34px;
top: 5px;
height: 14px;
border-radius: 8px;
position: absolute; }
md-switch .md-thumb-container {
top: 2px;
left: 0;
width: 16px;
position: absolute;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
z-index: 1; }
md-switch.md-checked .md-thumb-container {
-webkit-transform: translate3d(100%, 0, 0);
transform: translate3d(100%, 0, 0); }
md-switch .md-thumb {
position: absolute;
margin: 0;
left: 0;
top: 0;
outline: none;
height: 20px;
width: 20px;
border-radius: 50%;
box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.2), 0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 2px 1px -1px rgba(0, 0, 0, 0.12); }
md-switch .md-thumb:before {
background-color: transparent;
border-radius: 50%;
content: '';
position: absolute;
display: block;
height: auto;
left: 0;
top: 0;
right: 0;
bottom: 0;
transition: all 0.5s;
width: auto; }
md-switch .md-thumb .md-ripple-container {
position: absolute;
display: block;
width: auto;
height: auto;
left: -20px;
top: -20px;
right: -20px;
bottom: -20px; }
md-switch:not(.md-dragging) .md-bar,
md-switch:not(.md-dragging) .md-thumb-container,
md-switch:not(.md-dragging) .md-thumb {
transition: all 0.08s linear;
transition-property: -webkit-transform, background-color;
transition-property: transform, background-color; }
md-switch:not(.md-dragging) .md-bar,
md-switch:not(.md-dragging) .md-thumb {
transition-delay: 0.05s; }
@media screen and (-ms-high-contrast: active) {
md-switch.md-default-theme .md-bar {
background-color: #666; }
md-switch.md-default-theme.md-checked .md-bar {
background-color: #9E9E9E; }
md-switch.md-default-theme .md-thumb {
background-color: #fff; } }
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
goog.provide('ng.material.components.switch');
goog.require('ng.material.components.checkbox');
goog.require('ng.material.core');
/**
* @private
* @ngdoc module
* @name material.components.switch
*/
angular.module('material.components.switch', [
'material.core',
'material.components.checkbox'
])
.directive('mdSwitch', MdSwitch);
/**
* @private
* @ngdoc directive
* @module material.components.switch
* @name mdSwitch
* @restrict E
*
* The switch directive is used very much like the normal [angular checkbox](https://docs.angularjs.org/api/ng/input/input%5Bcheckbox%5D).
*
* As per the [material design spec](http://www.google.com/design/spec/style/color.html#color-ui-color-application)
* the switch is in the accent color by default. The primary color palette may be used with
* the `md-primary` class.
*
* @param {string} ng-model Assignable angular expression to data-bind to.
* @param {string=} name Property name of the form under which the control is published.
* @param {expression=} ng-true-value The value to which the expression should be set when selected.
* @param {expression=} ng-false-value The value to which the expression should be set when not selected.
* @param {string=} ng-change Angular expression to be executed when input changes due to user interaction with the input element.
* @param {expression=} ng-disabled En/Disable based on the expression.
* @param {boolean=} md-no-ink Use of attribute indicates use of ripple ink effects.
* @param {string=} aria-label Publish the button label used by screen-readers for accessibility. Defaults to the switch's text.
*
* @usage
* <hljs lang="html">
* <md-switch ng-model="isActive" aria-label="Finished?">
* Finished ?
* </md-switch>
*
* <md-switch md-no-ink ng-model="hasInk" aria-label="No Ink Effects">
* No Ink Effects
* </md-switch>
*
* <md-switch ng-disabled="true" ng-model="isDisabled" aria-label="Disabled">
* Disabled
* </md-switch>
*
* </hljs>
*/
function MdSwitch(mdCheckboxDirective, $mdUtil, $mdConstant, $parse, $$rAF, $mdGesture) {
var checkboxDirective = mdCheckboxDirective[0];
return {
restrict: 'E',
priority: 210, // Run before ngAria
transclude: true,
template:
'<div class="md-container">' +
'<div class="md-bar"></div>' +
'<div class="md-thumb-container">' +
'<div class="md-thumb" md-ink-ripple md-ink-ripple-checkbox></div>' +
'</div>'+
'</div>' +
'<div ng-transclude class="md-label"></div>',
require: '?ngModel',
compile: mdSwitchCompile
};
function mdSwitchCompile(element, attr) {
var checkboxLink = checkboxDirective.compile(element, attr);
// No transition on initial load.
element.addClass('md-dragging');
return function (scope, element, attr, ngModel) {
ngModel = ngModel || $mdUtil.fakeNgModel();
var disabledGetter = null;
if (attr.disabled != null) {
disabledGetter = function() { return true; };
} else if (attr.ngDisabled) {
disabledGetter = $parse(attr.ngDisabled);
}
var thumbContainer = angular.element(element[0].querySelector('.md-thumb-container'));
var switchContainer = angular.element(element[0].querySelector('.md-container'));
// no transition on initial load
$$rAF(function() {
element.removeClass('md-dragging');
});
checkboxLink(scope, element, attr, ngModel);
if (disabledGetter) {
scope.$watch(disabledGetter, function(isDisabled) {
element.attr('tabindex', isDisabled ? -1 : 0);
});
}
// These events are triggered by setup drag
$mdGesture.register(switchContainer, 'drag');
switchContainer
.on('$md.dragstart', onDragStart)
.on('$md.drag', onDrag)
.on('$md.dragend', onDragEnd);
var drag;
function onDragStart(ev) {
// Don't go if the switch is disabled.
if (disabledGetter && disabledGetter(scope)) return;
ev.stopPropagation();
element.addClass('md-dragging');
drag = {width: thumbContainer.prop('offsetWidth')};
element.removeClass('transition');
}
function onDrag(ev) {
if (!drag) return;
ev.stopPropagation();
ev.srcEvent && ev.srcEvent.preventDefault();
var percent = ev.pointer.distanceX / drag.width;
//if checked, start from right. else, start from left
var translate = ngModel.$viewValue ? 1 + percent : percent;
// Make sure the switch stays inside its bounds, 0-1%
translate = Math.max(0, Math.min(1, translate));
thumbContainer.css($mdConstant.CSS.TRANSFORM, 'translate3d(' + (100*translate) + '%,0,0)');
drag.translate = translate;
}
function onDragEnd(ev) {
if (!drag) return;
ev.stopPropagation();
element.removeClass('md-dragging');
thumbContainer.css($mdConstant.CSS.TRANSFORM, '');
// We changed if there is no distance (this is a click a click),
// or if the drag distance is >50% of the total.
var isChanged = ngModel.$viewValue ? drag.translate > 0.5 : drag.translate < 0.5;
if (isChanged) {
applyModelValue(!ngModel.$viewValue);
}
drag = null;
}
function applyModelValue(newValue) {
scope.$apply(function() {
ngModel.$setViewValue(newValue);
ngModel.$render();
});
}
};
}
}
MdSwitch.$inject = ["mdCheckboxDirective", "$mdUtil", "$mdConstant", "$parse", "$$rAF", "$mdGesture"];
ng.material.components.switch = angular.module("material.components.switch");
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/.md-inline-form md-switch{margin-top:18px;margin-bottom:19px}md-switch{margin:16px 0;white-space:nowrap;cursor:pointer;outline:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;height:30px;line-height:28px;-webkit-align-items:center;-ms-flex-align:center;align-items:center;display:-webkit-flex;display:-ms-flexbox;display:flex}body[dir=ltr] md-switch,html[dir=ltr] md-switch{margin-left:inherit}body[dir=rtl] md-switch,html[dir=rtl] md-switch{margin-left:16px}html:not([dir]) body:not([dir]) md-switch{margin-left:inherit}body[dir=ltr] md-switch,html[dir=ltr] md-switch{margin-right:16px;unicode-bidi:embed}body[dir=rtl] md-switch,html[dir=rtl] md-switch{margin-right:inherit;unicode-bidi:embed}html:not([dir]) body:not([dir]) md-switch{margin-right:16px;unicode-bidi:embed}md-switch bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}md-switch bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}body[dir=ltr] md-switch:last-of-type,html[dir=ltr] md-switch:last-of-type{margin-left:inherit}body[dir=rtl] md-switch:last-of-type,html[dir=rtl] md-switch:last-of-type{margin-left:0}html:not([dir]) body:not([dir]) md-switch:last-of-type{margin-left:inherit}body[dir=ltr] md-switch:last-of-type,html[dir=ltr] md-switch:last-of-type{margin-right:0;unicode-bidi:embed}body[dir=rtl] md-switch:last-of-type,html[dir=rtl] md-switch:last-of-type{margin-right:inherit;unicode-bidi:embed}html:not([dir]) body:not([dir]) md-switch:last-of-type{margin-right:0;unicode-bidi:embed}md-switch:last-of-type bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}md-switch:last-of-type bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}md-switch[disabled],md-switch[disabled] ._md-container{cursor:default}md-switch ._md-container{cursor:-webkit-grab;cursor:grab;width:36px;height:24px;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;float:left}body[dir=ltr] md-switch ._md-container,html[dir=ltr] md-switch ._md-container{margin-right:8px;unicode-bidi:embed}body[dir=rtl] md-switch ._md-container,html[dir=rtl] md-switch ._md-container{margin-left:8px;unicode-bidi:embed}html:not([dir]) body:not([dir]) md-switch ._md-container{margin-right:8px;unicode-bidi:embed}md-switch ._md-container bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}md-switch ._md-container bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}md-switch:not([disabled]) ._md-dragging,md-switch:not([disabled])._md-dragging ._md-container{cursor:-webkit-grabbing;cursor:grabbing}md-switch.md-focused:not([disabled]) ._md-thumb:before{left:-8px;top:-8px;right:-8px;bottom:-8px}md-switch.md-focused:not([disabled]):not(.md-checked) ._md-thumb:before{background-color:rgba(0,0,0,.12)}md-switch ._md-label{border-color:transparent;border-width:0;float:left}md-switch ._md-bar{left:1px;width:34px;top:5px;height:14px;border-radius:8px;position:absolute}md-switch ._md-thumb-container{top:2px;left:0;width:16px;position:absolute;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);z-index:1}md-switch.md-checked ._md-thumb-container{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}md-switch ._md-thumb{position:absolute;margin:0;left:0;top:0;outline:0;height:20px;width:20px;border-radius:50%;box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12)}md-switch ._md-thumb:before{background-color:transparent;border-radius:50%;content:'';position:absolute;display:block;height:auto;left:0;top:0;right:0;bottom:0;transition:all .5s;width:auto}md-switch ._md-thumb .md-ripple-container{position:absolute;display:block;width:auto;height:auto;left:-20px;top:-20px;right:-20px;bottom:-20px}md-switch:not(._md-dragging) ._md-bar,md-switch:not(._md-dragging) ._md-thumb,md-switch:not(._md-dragging) ._md-thumb-container{transition:all .08s linear;transition-property:-webkit-transform,background-color;transition-property:transform,background-color}md-switch:not(._md-dragging) ._md-bar,md-switch:not(._md-dragging) ._md-thumb{transition-delay:.05s}@media screen and (-ms-high-contrast:active){md-switch.md-default-theme ._md-bar{background-color:#666}md-switch.md-default-theme.md-checked ._md-bar{background-color:#9E9E9E}md-switch.md-default-theme ._md-thumb{background-color:#fff}}
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/
function MdSwitch(e,t,a,n,i,r){function o(e,o){var c=d.compile(e,o);return e.addClass("_md-dragging"),function(e,o,d,l){function s(t){p&&p(e)||(t.stopPropagation(),o.addClass("_md-dragging"),f={width:v.prop("offsetWidth")})}function m(e){if(f){e.stopPropagation(),e.srcEvent&&e.srcEvent.preventDefault();var t=e.pointer.distanceX/f.width,n=l.$viewValue?1+t:t;n=Math.max(0,Math.min(1,n)),v.css(a.CSS.TRANSFORM,"translate3d("+100*n+"%,0,0)"),f.translate=n}}function g(e){if(f){e.stopPropagation(),o.removeClass("_md-dragging"),v.css(a.CSS.TRANSFORM,"");var t=l.$viewValue?f.translate>.5:f.translate<.5;t&&u(!l.$viewValue),f=null}}function u(t){e.$apply(function(){l.$setViewValue(t),l.$render()})}l=l||t.fakeNgModel();var p=null;null!=d.disabled?p=function(){return!0}:d.ngDisabled&&(p=n(d.ngDisabled));var v=angular.element(o[0].querySelector("._md-thumb-container")),h=angular.element(o[0].querySelector("._md-container"));i(function(){o.removeClass("_md-dragging")}),c(e,o,d,l),p&&e.$watch(p,function(e){o.attr("tabindex",e?-1:0)}),r.register(h,"drag"),h.on("$md.dragstart",s).on("$md.drag",m).on("$md.dragend",g);var f}}var d=e[0];return{restrict:"E",priority:210,transclude:!0,template:'<div class="_md-container"><div class="_md-bar"></div><div class="_md-thumb-container"><div class="_md-thumb" md-ink-ripple md-ink-ripple-checkbox></div></div></div><div ng-transclude class="_md-label"></div>',require:"?ngModel",compile:o}}goog.provide("ng.material.components.switch"),goog.require("ng.material.components.checkbox"),goog.require("ng.material.core"),angular.module("material.components.switch",["material.core","material.components.checkbox"]).directive("mdSwitch",MdSwitch),MdSwitch.$inject=["mdCheckboxDirective","$mdUtil","$mdConstant","$parse","$$rAF","$mdGesture"],ng.material.components["switch"]=angular.module("material.components.switch");
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v0.7.1-master-b48be15
*/
<?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="24px" height="24px" viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve"> <g id="Header"> <g> <rect x="-618" y="-1208" fill="none" width="1400" height="3600"/> </g> </g> <g id="Label"> </g> <g id="Icon"> <g> <polygon points="15.4,7.4 14,6 8,12 14,18 15.4,16.6 10.8,12 " style="fill:white;"/> <rect fill="none" width="24" height="24"/> </g> </g> <g id="Grid" display="none"> <g display="inline"> </g> </g> </svg>
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
md-tabs.md-THEME_NAME-theme md-tabs-wrapper {
background-color: transparent;
border-color: '{{foreground-4}}'; }
md-tabs.md-THEME_NAME-theme .md-paginator md-icon {
color: '{{primary-color}}'; }
md-tabs.md-THEME_NAME-theme md-ink-bar {
color: '{{accent-color}}';
background: '{{accent-color}}'; }
md-tabs.md-THEME_NAME-theme .md-tab {
color: '{{foreground-2}}'; }
md-tabs.md-THEME_NAME-theme .md-tab[disabled], md-tabs.md-THEME_NAME-theme .md-tab[disabled] md-icon {
color: '{{foreground-3}}'; }
md-tabs.md-THEME_NAME-theme .md-tab.md-active, md-tabs.md-THEME_NAME-theme .md-tab.md-active md-icon, md-tabs.md-THEME_NAME-theme .md-tab.md-focused, md-tabs.md-THEME_NAME-theme .md-tab.md-focused md-icon {
color: '{{primary-color}}'; }
md-tabs.md-THEME_NAME-theme .md-tab.md-focused {
background: '{{primary-color-0.1}}'; }
md-tabs.md-THEME_NAME-theme .md-tab .md-ripple-container {
color: '{{accent-100}}'; }
md-tabs.md-THEME_NAME-theme.md-accent > md-tabs-wrapper {
background-color: '{{accent-color}}'; }
md-tabs.md-THEME_NAME-theme.md-accent > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]) {
color: '{{accent-100}}'; }
md-tabs.md-THEME_NAME-theme.md-accent > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-active, md-tabs.md-THEME_NAME-theme.md-accent > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-active md-icon, md-tabs.md-THEME_NAME-theme.md-accent > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused, md-tabs.md-THEME_NAME-theme.md-accent > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused md-icon {
color: '{{accent-contrast}}'; }
md-tabs.md-THEME_NAME-theme.md-accent > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused {
background: '{{accent-contrast-0.1}}'; }
md-tabs.md-THEME_NAME-theme.md-accent > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-ink-bar {
color: '{{primary-600-1}}';
background: '{{primary-600-1}}'; }
md-tabs.md-THEME_NAME-theme.md-primary > md-tabs-wrapper {
background-color: '{{primary-color}}'; }
md-tabs.md-THEME_NAME-theme.md-primary > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]) {
color: '{{primary-100}}'; }
md-tabs.md-THEME_NAME-theme.md-primary > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-active, md-tabs.md-THEME_NAME-theme.md-primary > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-active md-icon, md-tabs.md-THEME_NAME-theme.md-primary > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused, md-tabs.md-THEME_NAME-theme.md-primary > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused md-icon {
color: '{{primary-contrast}}'; }
md-tabs.md-THEME_NAME-theme.md-primary > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused {
background: '{{primary-contrast-0.1}}'; }
md-tabs.md-THEME_NAME-theme.md-warn > md-tabs-wrapper {
background-color: '{{warn-color}}'; }
md-tabs.md-THEME_NAME-theme.md-warn > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]) {
color: '{{warn-100}}'; }
md-tabs.md-THEME_NAME-theme.md-warn > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-active, md-tabs.md-THEME_NAME-theme.md-warn > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-active md-icon, md-tabs.md-THEME_NAME-theme.md-warn > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused, md-tabs.md-THEME_NAME-theme.md-warn > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused md-icon {
color: '{{warn-contrast}}'; }
md-tabs.md-THEME_NAME-theme.md-warn > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused {
background: '{{warn-contrast-0.1}}'; }
md-toolbar > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper {
background-color: '{{primary-color}}'; }
md-toolbar > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]) {
color: '{{primary-100}}'; }
md-toolbar > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-active, md-toolbar > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-active md-icon, md-toolbar > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused, md-toolbar > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused md-icon {
color: '{{primary-contrast}}'; }
md-toolbar > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused {
background: '{{primary-contrast-0.1}}'; }
md-toolbar.md-accent > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper {
background-color: '{{accent-color}}'; }
md-toolbar.md-accent > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]) {
color: '{{accent-100}}'; }
md-toolbar.md-accent > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-active, md-toolbar.md-accent > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-active md-icon, md-toolbar.md-accent > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused, md-toolbar.md-accent > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused md-icon {
color: '{{accent-contrast}}'; }
md-toolbar.md-accent > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused {
background: '{{accent-contrast-0.1}}'; }
md-toolbar.md-accent > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-ink-bar {
color: '{{primary-600-1}}';
background: '{{primary-600-1}}'; }
md-toolbar.md-warn > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper {
background-color: '{{warn-color}}'; }
md-toolbar.md-warn > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]) {
color: '{{warn-100}}'; }
md-toolbar.md-warn > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-active, md-toolbar.md-warn > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-active md-icon, md-toolbar.md-warn > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused, md-toolbar.md-warn > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused md-icon {
color: '{{warn-contrast}}'; }
md-toolbar.md-warn > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused {
background: '{{warn-contrast-0.1}}'; }
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/md-tabs.md-THEME_NAME-theme md-tabs-wrapper{background-color:transparent;border-color:'{{foreground-4}}'}md-tabs.md-THEME_NAME-theme .md-paginator md-icon{color:'{{primary-color}}'}md-tabs.md-THEME_NAME-theme md-ink-bar{color:'{{accent-color}}';background:0 0}md-tabs.md-THEME_NAME-theme .md-tab{color:'{{foreground-2}}'}md-tabs.md-THEME_NAME-theme .md-tab[disabled],md-tabs.md-THEME_NAME-theme .md-tab[disabled] md-icon{color:'{{foreground-3}}'}md-tabs.md-THEME_NAME-theme .md-tab.md-active,md-tabs.md-THEME_NAME-theme .md-tab.md-active md-icon,md-tabs.md-THEME_NAME-theme .md-tab.md-focused,md-tabs.md-THEME_NAME-theme .md-tab.md-focused md-icon{color:'{{primary-color}}'}md-tabs.md-THEME_NAME-theme .md-tab.md-focused{background:0 0}md-tabs.md-THEME_NAME-theme .md-tab .md-ripple-container{color:'{{accent-100}}'}md-tabs.md-THEME_NAME-theme.md-accent>md-tabs-wrapper{background-color:'{{accent-color}}'}md-tabs.md-THEME_NAME-theme.md-accent>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]){color:'{{accent-100}}'}md-tabs.md-THEME_NAME-theme.md-accent>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-active,md-tabs.md-THEME_NAME-theme.md-accent>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-active md-icon,md-tabs.md-THEME_NAME-theme.md-accent>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused,md-tabs.md-THEME_NAME-theme.md-accent>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused md-icon{color:'{{accent-contrast}}'}md-tabs.md-THEME_NAME-theme.md-accent>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused{background:0 0}md-tabs.md-THEME_NAME-theme.md-accent>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-ink-bar{color:'{{primary-600-1}}';background:0 0}md-tabs.md-THEME_NAME-theme.md-primary>md-tabs-wrapper{background-color:'{{primary-color}}'}md-tabs.md-THEME_NAME-theme.md-primary>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]){color:'{{primary-100}}'}md-tabs.md-THEME_NAME-theme.md-primary>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-active,md-tabs.md-THEME_NAME-theme.md-primary>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-active md-icon,md-tabs.md-THEME_NAME-theme.md-primary>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused,md-tabs.md-THEME_NAME-theme.md-primary>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused md-icon{color:'{{primary-contrast}}'}md-tabs.md-THEME_NAME-theme.md-primary>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused{background:0 0}md-tabs.md-THEME_NAME-theme.md-warn>md-tabs-wrapper{background-color:'{{warn-color}}'}md-tabs.md-THEME_NAME-theme.md-warn>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]){color:'{{warn-100}}'}md-tabs.md-THEME_NAME-theme.md-warn>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-active,md-tabs.md-THEME_NAME-theme.md-warn>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-active md-icon,md-tabs.md-THEME_NAME-theme.md-warn>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused,md-tabs.md-THEME_NAME-theme.md-warn>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused md-icon{color:'{{warn-contrast}}'}md-tabs.md-THEME_NAME-theme.md-warn>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused{background:0 0}md-toolbar>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper{background-color:'{{primary-color}}'}md-toolbar>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]){color:'{{primary-100}}'}md-toolbar>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-active,md-toolbar>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-active md-icon,md-toolbar>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused,md-toolbar>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused md-icon{color:'{{primary-contrast}}'}md-toolbar>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused{background:0 0}md-toolbar.md-accent>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper{background-color:'{{accent-color}}'}md-toolbar.md-accent>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]){color:'{{accent-100}}'}md-toolbar.md-accent>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-active,md-toolbar.md-accent>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-active md-icon,md-toolbar.md-accent>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused,md-toolbar.md-accent>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused md-icon{color:'{{accent-contrast}}'}md-toolbar.md-accent>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused{background:0 0}md-toolbar.md-accent>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-ink-bar{color:'{{primary-600-1}}';background:0 0}md-toolbar.md-warn>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper{background-color:'{{warn-color}}'}md-toolbar.md-warn>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]){color:'{{warn-100}}'}md-toolbar.md-warn>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-active,md-toolbar.md-warn>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-active md-icon,md-toolbar.md-warn>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused,md-toolbar.md-warn>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused md-icon{color:'{{warn-contrast}}'}md-toolbar.md-warn>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused{background:0 0}
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
@-webkit-keyframes md-tab-content-hide {
0% {
opacity: 1; }
50% {
opacity: 1; }
100% {
opacity: 0; } }
@keyframes md-tab-content-hide {
0% {
opacity: 1; }
50% {
opacity: 1; }
100% {
opacity: 0; } }
md-tab-data {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: -1;
opacity: 0; }
md-tabs {
display: block;
margin: 0;
border-radius: 2px;
overflow: hidden;
position: relative;
-webkit-flex-shrink: 0;
-ms-flex-negative: 0;
flex-shrink: 0; }
md-tabs:not(.md-no-tab-content):not(.md-dynamic-height) {
min-height: 248px; }
md-tabs[md-align-tabs="bottom"] {
padding-bottom: 48px; }
md-tabs[md-align-tabs="bottom"] md-tabs-wrapper {
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 48px;
z-index: 2; }
md-tabs[md-align-tabs="bottom"] md-tabs-content-wrapper {
top: 0;
bottom: 48px; }
md-tabs.md-dynamic-height md-tabs-content-wrapper {
min-height: 0;
position: relative;
top: auto;
left: auto;
right: auto;
bottom: auto;
overflow: visible; }
md-tabs.md-dynamic-height md-tab-content.md-active {
position: relative; }
md-tabs[md-border-bottom] md-tabs-wrapper {
border-width: 0 0 1px;
border-style: solid; }
md-tabs[md-border-bottom]:not(.md-dynamic-height) md-tabs-content-wrapper {
top: 49px; }
md-tabs-wrapper {
display: block;
position: relative;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0); }
md-tabs-wrapper md-prev-button, md-tabs-wrapper md-next-button {
height: 100%;
width: 32px;
position: absolute;
top: 50%;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
line-height: 1em;
z-index: 2;
cursor: pointer;
font-size: 16px;
background: transparent no-repeat center center;
transition: all 0.5s cubic-bezier(0.35, 0, 0.25, 1); }
md-tabs-wrapper md-prev-button:focus, md-tabs-wrapper md-next-button:focus {
outline: none; }
md-tabs-wrapper md-prev-button.md-disabled, md-tabs-wrapper md-next-button.md-disabled {
opacity: 0.25;
cursor: default; }
md-tabs-wrapper md-prev-button.ng-leave, md-tabs-wrapper md-next-button.ng-leave {
transition: none; }
md-tabs-wrapper md-prev-button md-icon, md-tabs-wrapper md-next-button md-icon {
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate3d(-50%, -50%, 0);
transform: translate3d(-50%, -50%, 0); }
md-tabs-wrapper md-prev-button {
left: 0;
background-image: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE3LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPiA8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPiA8c3ZnIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSIyNHB4IiBoZWlnaHQ9IjI0cHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMjQgMjQiIHhtbDpzcGFjZT0icHJlc2VydmUiPiA8ZyBpZD0iSGVhZGVyIj4gPGc+IDxyZWN0IHg9Ii02MTgiIHk9Ii0xMjA4IiBmaWxsPSJub25lIiB3aWR0aD0iMTQwMCIgaGVpZ2h0PSIzNjAwIi8+IDwvZz4gPC9nPiA8ZyBpZD0iTGFiZWwiPiA8L2c+IDxnIGlkPSJJY29uIj4gPGc+IDxwb2x5Z29uIHBvaW50cz0iMTUuNCw3LjQgMTQsNiA4LDEyIDE0LDE4IDE1LjQsMTYuNiAxMC44LDEyIAkJIiBzdHlsZT0iZmlsbDp3aGl0ZTsiLz4gPHJlY3QgZmlsbD0ibm9uZSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ii8+IDwvZz4gPC9nPiA8ZyBpZD0iR3JpZCIgZGlzcGxheT0ibm9uZSI+IDxnIGRpc3BsYXk9ImlubGluZSI+IDwvZz4gPC9nPiA8L3N2Zz4NCg=="); }
md-tabs-wrapper md-next-button {
right: 0;
background-image: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE3LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPiA8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPiA8c3ZnIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSIyNHB4IiBoZWlnaHQ9IjI0cHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMjQgMjQiIHhtbDpzcGFjZT0icHJlc2VydmUiPiA8ZyBpZD0iSGVhZGVyIj4gPGc+IDxyZWN0IHg9Ii02MTgiIHk9Ii0xMzM2IiBmaWxsPSJub25lIiB3aWR0aD0iMTQwMCIgaGVpZ2h0PSIzNjAwIi8+IDwvZz4gPC9nPiA8ZyBpZD0iTGFiZWwiPiA8L2c+IDxnIGlkPSJJY29uIj4gPGc+IDxwb2x5Z29uIHBvaW50cz0iMTAsNiA4LjYsNy40IDEzLjIsMTIgOC42LDE2LjYgMTAsMTggMTYsMTIgCQkiIHN0eWxlPSJmaWxsOndoaXRlOyIvPiA8cmVjdCBmaWxsPSJub25lIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiLz4gPC9nPiA8L2c+IDxnIGlkPSJHcmlkIiBkaXNwbGF5PSJub25lIj4gPGcgZGlzcGxheT0iaW5saW5lIj4gPC9nPiA8L2c+IDwvc3ZnPg0K"); }
md-tabs-wrapper md-next-button md-icon {
-webkit-transform: translate3d(-50%, -50%, 0) rotate(180deg);
transform: translate3d(-50%, -50%, 0) rotate(180deg); }
md-tabs-wrapper.md-stretch-tabs md-pagination-wrapper {
width: 100%;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row; }
md-tabs-wrapper.md-stretch-tabs md-pagination-wrapper md-tab-item {
-webkit-flex-grow: 1;
-ms-flex-positive: 1;
flex-grow: 1; }
md-tabs-canvas {
position: relative;
overflow: hidden;
display: block;
height: 48px; }
md-tabs-canvas:after {
content: '';
display: table;
clear: both; }
md-tabs-canvas .md-dummy-wrapper {
position: absolute;
top: 0;
left: 0; }
md-tabs-canvas.md-paginated {
margin: 0 32px; }
md-tabs-canvas.md-center-tabs {
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
text-align: center; }
md-tabs-canvas.md-center-tabs .md-tab {
float: none;
display: inline-block; }
md-pagination-wrapper {
height: 48px;
display: block;
transition: -webkit-transform 0.5s cubic-bezier(0.35, 0, 0.25, 1);
transition: transform 0.5s cubic-bezier(0.35, 0, 0.25, 1);
position: absolute;
width: 999999px;
left: 0;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0); }
md-pagination-wrapper:after {
content: '';
display: table;
clear: both; }
md-pagination-wrapper.md-center-tabs {
position: relative;
width: initial;
margin: 0 auto; }
md-tabs-content-wrapper {
display: block;
position: absolute;
top: 48px;
left: 0;
right: 0;
bottom: 0;
overflow: hidden; }
md-tab-content {
display: block;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
transition: -webkit-transform 0.5s cubic-bezier(0.35, 0, 0.25, 1);
transition: transform 0.5s cubic-bezier(0.35, 0, 0.25, 1);
overflow: auto;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0); }
md-tab-content.md-no-scroll {
bottom: auto;
overflow: hidden; }
md-tab-content.ng-leave, md-tab-content.md-no-transition {
transition: none; }
md-tab-content.md-left:not(.md-active) {
-webkit-transform: translateX(-100%);
transform: translateX(-100%);
-webkit-animation: 1s md-tab-content-hide;
animation: 1s md-tab-content-hide;
opacity: 0; }
md-tab-content.md-left:not(.md-active) * {
transition: visibility 0s linear;
transition-delay: 0.5s;
visibility: hidden; }
md-tab-content.md-right:not(.md-active) {
-webkit-transform: translateX(100%);
transform: translateX(100%);
-webkit-animation: 1s md-tab-content-hide;
animation: 1s md-tab-content-hide;
opacity: 0; }
md-tab-content.md-right:not(.md-active) * {
transition: visibility 0s linear;
transition-delay: 0.5s;
visibility: hidden; }
md-tab-content > div.ng-leave {
-webkit-animation: 1s md-tab-content-hide;
animation: 1s md-tab-content-hide; }
md-ink-bar {
position: absolute;
left: auto;
right: auto;
bottom: 0;
height: 2px; }
md-ink-bar.md-left {
transition: left 0.125s cubic-bezier(0.35, 0, 0.25, 1), right 0.25s cubic-bezier(0.35, 0, 0.25, 1); }
md-ink-bar.md-right {
transition: left 0.25s cubic-bezier(0.35, 0, 0.25, 1), right 0.125s cubic-bezier(0.35, 0, 0.25, 1); }
md-tab {
position: absolute;
z-index: -1;
left: -9999px; }
.md-tab {
font-size: 14px;
text-align: center;
line-height: 24px;
padding: 12px 24px;
transition: background-color 0.35s cubic-bezier(0.35, 0, 0.25, 1);
cursor: pointer;
white-space: nowrap;
position: relative;
text-transform: uppercase;
float: left;
font-weight: 500;
box-sizing: border-box;
overflow: hidden;
text-overflow: ellipsis; }
.md-tab.md-focused {
box-shadow: none;
outline: none; }
.md-tab.md-active {
cursor: default; }
.md-tab.md-disabled {
pointer-events: none;
-ms-touch-action: pan-y;
touch-action: pan-y;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-user-drag: none;
opacity: 0.5;
cursor: default; }
.md-tab.ng-leave {
transition: none; }
md-toolbar + md-tabs {
border-top-left-radius: 0;
border-top-right-radius: 0; }
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
goog.provide('ng.material.components.tabs');
goog.require('ng.material.components.icon');
goog.require('ng.material.core');
/**
* @ngdoc module
* @name material.components.tabs
* @description
*
* Tabs, created with the `<md-tabs>` directive provide *tabbed* navigation with different styles.
* The Tabs component consists of clickable tabs that are aligned horizontally side-by-side.
*
* Features include support for:
*
* - static or dynamic tabs,
* - responsive designs,
* - accessibility support (ARIA),
* - tab pagination,
* - external or internal tab content,
* - focus indicators and arrow-key navigations,
* - programmatic lookup and access to tab controllers, and
* - dynamic transitions through different tab contents.
*
*/
/*
* @see js folder for tabs implementation
*/
angular.module('material.components.tabs', [
'material.core',
'material.components.icon'
]);
/**
* @ngdoc directive
* @name mdTab
* @module material.components.tabs
*
* @restrict E
*
* @description
* Use the `<md-tab>` a nested directive used within `<md-tabs>` to specify a tab with a **label** and optional *view content*.
*
* If the `label` attribute is not specified, then an optional `<md-tab-label>` tag can be used to specify more
* complex tab header markup. If neither the **label** nor the **md-tab-label** are specified, then the nested
* markup of the `<md-tab>` is used as the tab header markup.
*
* Please note that if you use `<md-tab-label>`, your content **MUST** be wrapped in the `<md-tab-body>` tag. This
* is to define a clear separation between the tab content and the tab label.
*
* This container is used by the TabsController to show/hide the active tab's content view. This synchronization is
* automatically managed by the internal TabsController whenever the tab selection changes. Selection changes can
* be initiated via data binding changes, programmatic invocation, or user gestures.
*
* @param {string=} label Optional attribute to specify a simple string as the tab label
* @param {boolean=} ng-disabled If present, disabled tab selection.
* @param {expression=} md-on-deselect Expression to be evaluated after the tab has been de-selected.
* @param {expression=} md-on-select Expression to be evaluated after the tab has been selected.
* @param {boolean=} md-active When true, sets the active tab. Note: There can only be one active tab at a time.
*
*
* @usage
*
* <hljs lang="html">
* <md-tab label="" disabled="" md-on-select="" md-on-deselect="" >
* <h3>My Tab content</h3>
* </md-tab>
*
* <md-tab >
* <md-tab-label>
* <h3>My Tab content</h3>
* </md-tab-label>
* <md-tab-body>
* <p>
* Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium,
* totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae
* dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit,
* sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.
* </p>
* </md-tab-body>
* </md-tab>
* </hljs>
*
*/
angular
.module('material.components.tabs')
.directive('mdTab', MdTab);
function MdTab () {
return {
require: '^?mdTabs',
terminal: true,
compile: function (element, attr) {
var label = firstChild(element, 'md-tab-label'),
body = firstChild(element, 'md-tab-body');
if (label.length == 0) {
label = angular.element('<md-tab-label></md-tab-label>');
if (attr.label) label.text(attr.label);
else label.append(element.contents());
if (body.length == 0) {
var contents = element.contents().detach();
body = angular.element('<md-tab-body></md-tab-body>');
body.append(contents);
}
}
element.append(label);
if (body.html()) element.append(body);
return postLink;
},
scope: {
active: '=?mdActive',
disabled: '=?ngDisabled',
select: '&?mdOnSelect',
deselect: '&?mdOnDeselect'
}
};
function postLink (scope, element, attr, ctrl) {
if (!ctrl) return;
var index = ctrl.getTabElementIndex(element),
body = firstChild(element, 'md-tab-body').remove(),
label = firstChild(element, 'md-tab-label').remove(),
data = ctrl.insertTab({
scope: scope,
parent: scope.$parent,
index: index,
element: element,
template: body.html(),
label: label.html()
}, index);
scope.select = scope.select || angular.noop;
scope.deselect = scope.deselect || angular.noop;
scope.$watch('active', function (active) { if (active) ctrl.select(data.getIndex()); });
scope.$watch('disabled', function () { ctrl.refreshIndex(); });
scope.$watch(
function () {
return ctrl.getTabElementIndex(element);
},
function (newIndex) {
data.index = newIndex;
ctrl.updateTabOrder();
}
);
scope.$on('$destroy', function () { ctrl.removeTab(data); });
}
function firstChild (element, tagName) {
var children = element[0].children;
for (var i = 0, len = children.length; i < len; i++) {
var child = children[i];
if (child.tagName === tagName.toUpperCase()) return angular.element(child);
}
return angular.element();
}
}
angular
.module('material.components.tabs')
.directive('mdTabItem', MdTabItem);
function MdTabItem () {
return {
require: '^?mdTabs',
link: function link (scope, element, attr, ctrl) {
if (!ctrl) return;
ctrl.attachRipple(scope, element);
}
};
}
angular
.module('material.components.tabs')
.directive('mdTabLabel', MdTabLabel);
function MdTabLabel () {
return { terminal: true };
}
angular.module('material.components.tabs')
.directive('mdTabScroll', MdTabScroll);
function MdTabScroll ($parse) {
return {
restrict: 'A',
compile: function ($element, attr) {
var fn = $parse(attr.mdTabScroll, null, true);
return function ngEventHandler (scope, element) {
element.on('mousewheel', function (event) {
scope.$apply(function () { fn(scope, { $event: event }); });
});
};
}
}
}
MdTabScroll.$inject = ["$parse"];
angular
.module('material.components.tabs')
.controller('MdTabsController', MdTabsController);
/**
* ngInject
*/
function MdTabsController ($scope, $element, $window, $mdConstant, $mdTabInkRipple,
$mdUtil, $animateCss, $attrs, $compile, $mdTheming) {
// define private properties
var ctrl = this,
locked = false,
elements = getElements(),
queue = [],
destroyed = false,
loaded = false;
// define one-way bindings
defineOneWayBinding('stretchTabs', handleStretchTabs);
// define public properties with change handlers
defineProperty('focusIndex', handleFocusIndexChange, ctrl.selectedIndex || 0);
defineProperty('offsetLeft', handleOffsetChange, 0);
defineProperty('hasContent', handleHasContent, false);
defineProperty('maxTabWidth', handleMaxTabWidth, getMaxTabWidth());
defineProperty('shouldPaginate', handleShouldPaginate, false);
// define boolean attributes
defineBooleanAttribute('noInkBar', handleInkBar);
defineBooleanAttribute('dynamicHeight', handleDynamicHeight);
defineBooleanAttribute('noPagination');
defineBooleanAttribute('swipeContent');
defineBooleanAttribute('noDisconnect');
defineBooleanAttribute('autoselect');
defineBooleanAttribute('centerTabs', handleCenterTabs, false);
defineBooleanAttribute('enableDisconnect');
// define public properties
ctrl.scope = $scope;
ctrl.parent = $scope.$parent;
ctrl.tabs = [];
ctrl.lastSelectedIndex = null;
ctrl.hasFocus = false;
ctrl.lastClick = true;
ctrl.shouldCenterTabs = shouldCenterTabs();
// define public methods
ctrl.updatePagination = $mdUtil.debounce(updatePagination, 100);
ctrl.redirectFocus = redirectFocus;
ctrl.attachRipple = attachRipple;
ctrl.insertTab = insertTab;
ctrl.removeTab = removeTab;
ctrl.select = select;
ctrl.scroll = scroll;
ctrl.nextPage = nextPage;
ctrl.previousPage = previousPage;
ctrl.keydown = keydown;
ctrl.canPageForward = canPageForward;
ctrl.canPageBack = canPageBack;
ctrl.refreshIndex = refreshIndex;
ctrl.incrementIndex = incrementIndex;
ctrl.getTabElementIndex = getTabElementIndex;
ctrl.updateInkBarStyles = $mdUtil.debounce(updateInkBarStyles, 100);
ctrl.updateTabOrder = $mdUtil.debounce(updateTabOrder, 100);
init();
/**
* Perform initialization for the controller, setup events and watcher(s)
*/
function init () {
ctrl.selectedIndex = ctrl.selectedIndex || 0;
compileTemplate();
configureWatchers();
bindEvents();
$mdTheming($element);
$mdUtil.nextTick(function () {
updateHeightFromContent();
adjustOffset();
updateInkBarStyles();
ctrl.tabs[ ctrl.selectedIndex ] && ctrl.tabs[ ctrl.selectedIndex ].scope.select();
loaded = true;
updatePagination();
});
}
/**
* Compiles the template provided by the user. This is passed as an attribute from the tabs
* directive's template function.
*/
function compileTemplate () {
var template = $attrs.$mdTabsTemplate,
element = angular.element(elements.data);
element.html(template);
$compile(element.contents())(ctrl.parent);
delete $attrs.$mdTabsTemplate;
}
/**
* Binds events used by the tabs component.
*/
function bindEvents () {
angular.element($window).on('resize', handleWindowResize);
$scope.$on('$destroy', cleanup);
}
/**
* Configure watcher(s) used by Tabs
*/
function configureWatchers () {
$scope.$watch('$mdTabsCtrl.selectedIndex', handleSelectedIndexChange);
}
/**
* Creates a one-way binding manually rather than relying on Angular's isolated scope
* @param key
* @param handler
*/
function defineOneWayBinding (key, handler) {
var attr = $attrs.$normalize('md-' + key);
if (handler) defineProperty(key, handler);
$attrs.$observe(attr, function (newValue) { ctrl[ key ] = newValue; });
}
/**
* Defines boolean attributes with default value set to true. (ie. md-stretch-tabs with no value
* will be treated as being truthy)
* @param key
* @param handler
*/
function defineBooleanAttribute (key, handler) {
var attr = $attrs.$normalize('md-' + key);
if (handler) defineProperty(key, handler);
if ($attrs.hasOwnProperty(attr)) updateValue($attrs[attr]);
$attrs.$observe(attr, updateValue);
function updateValue (newValue) {
ctrl[ key ] = newValue !== 'false';
}
}
/**
* Remove any events defined by this controller
*/
function cleanup () {
destroyed = true;
angular.element($window).off('resize', handleWindowResize);
}
// Change handlers
/**
* Toggles stretch tabs class and updates inkbar when tab stretching changes
* @param stretchTabs
*/
function handleStretchTabs (stretchTabs) {
angular.element(elements.wrapper).toggleClass('md-stretch-tabs', shouldStretchTabs());
updateInkBarStyles();
}
function handleCenterTabs (newValue) {
ctrl.shouldCenterTabs = shouldCenterTabs();
}
function handleMaxTabWidth (newWidth, oldWidth) {
if (newWidth !== oldWidth) {
angular.forEach(elements.tabs, function(tab) {
tab.style.maxWidth = newWidth + 'px';
});
$mdUtil.nextTick(ctrl.updateInkBarStyles);
}
}
function handleShouldPaginate (newValue, oldValue) {
if (newValue !== oldValue) {
ctrl.maxTabWidth = getMaxTabWidth();
ctrl.shouldCenterTabs = shouldCenterTabs();
$mdUtil.nextTick(function () {
ctrl.maxTabWidth = getMaxTabWidth();
adjustOffset(ctrl.selectedIndex);
});
}
}
/**
* Add/remove the `md-no-tab-content` class depending on `ctrl.hasContent`
* @param hasContent
*/
function handleHasContent (hasContent) {
$element[ hasContent ? 'removeClass' : 'addClass' ]('md-no-tab-content');
}
/**
* Apply ctrl.offsetLeft to the paging element when it changes
* @param left
*/
function handleOffsetChange (left) {
var newValue = ctrl.shouldCenterTabs ? '' : '-' + left + 'px';
angular.element(elements.paging).css($mdConstant.CSS.TRANSFORM, 'translate3d(' + newValue + ', 0, 0)');
$scope.$broadcast('$mdTabsPaginationChanged');
}
/**
* Update the UI whenever `ctrl.focusIndex` is updated
* @param newIndex
* @param oldIndex
*/
function handleFocusIndexChange (newIndex, oldIndex) {
if (newIndex === oldIndex) return;
if (!elements.tabs[ newIndex ]) return;
adjustOffset();
redirectFocus();
}
/**
* Update the UI whenever the selected index changes. Calls user-defined select/deselect methods.
* @param newValue
* @param oldValue
*/
function handleSelectedIndexChange (newValue, oldValue) {
if (newValue === oldValue) return;
ctrl.selectedIndex = getNearestSafeIndex(newValue);
ctrl.lastSelectedIndex = oldValue;
ctrl.updateInkBarStyles();
updateHeightFromContent();
adjustOffset(newValue);
$scope.$broadcast('$mdTabsChanged');
ctrl.tabs[ oldValue ] && ctrl.tabs[ oldValue ].scope.deselect();
ctrl.tabs[ newValue ] && ctrl.tabs[ newValue ].scope.select();
}
function getTabElementIndex(tabEl){
var tabs = $element[0].getElementsByTagName('md-tab');
return Array.prototype.indexOf.call(tabs, tabEl[0]);
}
/**
* Queues up a call to `handleWindowResize` when a resize occurs while the tabs component is
* hidden.
*/
function handleResizeWhenVisible () {
// if there is already a watcher waiting for resize, do nothing
if (handleResizeWhenVisible.watcher) return;
// otherwise, we will abuse the $watch function to check for visible
handleResizeWhenVisible.watcher = $scope.$watch(function () {
// since we are checking for DOM size, we use $mdUtil.nextTick() to wait for after the DOM updates
$mdUtil.nextTick(function () {
// if the watcher has already run (ie. multiple digests in one cycle), do nothing
if (!handleResizeWhenVisible.watcher) return;
if ($element.prop('offsetParent')) {
handleResizeWhenVisible.watcher();
handleResizeWhenVisible.watcher = null;
handleWindowResize();
}
}, false);
});
}
// Event handlers / actions
/**
* Handle user keyboard interactions
* @param event
*/
function keydown (event) {
switch (event.keyCode) {
case $mdConstant.KEY_CODE.LEFT_ARROW:
event.preventDefault();
incrementIndex(-1, true);
break;
case $mdConstant.KEY_CODE.RIGHT_ARROW:
event.preventDefault();
incrementIndex(1, true);
break;
case $mdConstant.KEY_CODE.SPACE:
case $mdConstant.KEY_CODE.ENTER:
event.preventDefault();
if (!locked) ctrl.selectedIndex = ctrl.focusIndex;
break;
}
ctrl.lastClick = false;
}
/**
* Update the selected index and trigger a click event on the original `md-tab` element in order
* to fire user-added click events.
* @param index
*/
function select (index) {
if (!locked) ctrl.focusIndex = ctrl.selectedIndex = index;
ctrl.lastClick = true;
// nextTick is required to prevent errors in user-defined click events
$mdUtil.nextTick(function () {
ctrl.tabs[ index ].element.triggerHandler('click');
}, false);
}
/**
* When pagination is on, this makes sure the selected index is in view.
* @param event
*/
function scroll (event) {
if (!ctrl.shouldPaginate) return;
event.preventDefault();
ctrl.offsetLeft = fixOffset(ctrl.offsetLeft - event.wheelDelta);
}
/**
* Slides the tabs over approximately one page forward.
*/
function nextPage () {
var viewportWidth = elements.canvas.clientWidth,
totalWidth = viewportWidth + ctrl.offsetLeft,
i, tab;
for (i = 0; i < elements.tabs.length; i++) {
tab = elements.tabs[ i ];
if (tab.offsetLeft + tab.offsetWidth > totalWidth) break;
}
ctrl.offsetLeft = fixOffset(tab.offsetLeft);
}
/**
* Slides the tabs over approximately one page backward.
*/
function previousPage () {
var i, tab;
for (i = 0; i < elements.tabs.length; i++) {
tab = elements.tabs[ i ];
if (tab.offsetLeft + tab.offsetWidth >= ctrl.offsetLeft) break;
}
ctrl.offsetLeft = fixOffset(tab.offsetLeft + tab.offsetWidth - elements.canvas.clientWidth);
}
/**
* Update size calculations when the window is resized.
*/
function handleWindowResize () {
ctrl.lastSelectedIndex = ctrl.selectedIndex;
ctrl.offsetLeft = fixOffset(ctrl.offsetLeft);
$mdUtil.nextTick(function () {
ctrl.updateInkBarStyles();
updatePagination();
});
}
function handleInkBar (hide) {
angular.element(elements.inkBar).toggleClass('ng-hide', hide);
}
/**
* Toggle dynamic height class when value changes
* @param value
*/
function handleDynamicHeight (value) {
$element.toggleClass('md-dynamic-height', value);
}
/**
* Remove a tab from the data and select the nearest valid tab.
* @param tabData
*/
function removeTab (tabData) {
if (destroyed) return;
var selectedIndex = ctrl.selectedIndex,
tab = ctrl.tabs.splice(tabData.getIndex(), 1)[ 0 ];
refreshIndex();
// when removing a tab, if the selected index did not change, we have to manually trigger the
// tab select/deselect events
if (ctrl.selectedIndex === selectedIndex) {
tab.scope.deselect();
ctrl.tabs[ ctrl.selectedIndex ] && ctrl.tabs[ ctrl.selectedIndex ].scope.select();
}
$mdUtil.nextTick(function () {
updatePagination();
ctrl.offsetLeft = fixOffset(ctrl.offsetLeft);
});
}
/**
* Create an entry in the tabs array for a new tab at the specified index.
* @param tabData
* @param index
* @returns {*}
*/
function insertTab (tabData, index) {
var hasLoaded = loaded;
var proto = {
getIndex: function () { return ctrl.tabs.indexOf(tab); },
isActive: function () { return this.getIndex() === ctrl.selectedIndex; },
isLeft: function () { return this.getIndex() < ctrl.selectedIndex; },
isRight: function () { return this.getIndex() > ctrl.selectedIndex; },
shouldRender: function () { return !ctrl.noDisconnect || this.isActive(); },
hasFocus: function () {
return !ctrl.lastClick
&& ctrl.hasFocus && this.getIndex() === ctrl.focusIndex;
},
id: $mdUtil.nextUid()
},
tab = angular.extend(proto, tabData);
if (angular.isDefined(index)) {
ctrl.tabs.splice(index, 0, tab);
} else {
ctrl.tabs.push(tab);
}
processQueue();
updateHasContent();
$mdUtil.nextTick(function () {
updatePagination();
// if autoselect is enabled, select the newly added tab
if (hasLoaded && ctrl.autoselect) $mdUtil.nextTick(function () {
$mdUtil.nextTick(function () { select(ctrl.tabs.indexOf(tab)); });
});
});
return tab;
}
// Getter methods
/**
* Gathers references to all of the DOM elements used by this controller.
* @returns {{}}
*/
function getElements () {
var elements = {};
// gather tab bar elements
elements.wrapper = $element[ 0 ].getElementsByTagName('md-tabs-wrapper')[ 0 ];
elements.data = $element[ 0 ].getElementsByTagName('md-tab-data')[ 0 ];
elements.canvas = elements.wrapper.getElementsByTagName('md-tabs-canvas')[ 0 ];
elements.paging = elements.canvas.getElementsByTagName('md-pagination-wrapper')[ 0 ];
elements.tabs = elements.paging.getElementsByTagName('md-tab-item');
elements.dummies = elements.canvas.getElementsByTagName('md-dummy-tab');
elements.inkBar = elements.paging.getElementsByTagName('md-ink-bar')[ 0 ];
// gather tab content elements
elements.contentsWrapper = $element[ 0 ].getElementsByTagName('md-tabs-content-wrapper')[ 0 ];
elements.contents = elements.contentsWrapper.getElementsByTagName('md-tab-content');
return elements;
}
/**
* Determines whether or not the left pagination arrow should be enabled.
* @returns {boolean}
*/
function canPageBack () {
return ctrl.offsetLeft > 0;
}
/**
* Determines whether or not the right pagination arrow should be enabled.
* @returns {*|boolean}
*/
function canPageForward () {
var lastTab = elements.tabs[ elements.tabs.length - 1 ];
return lastTab && lastTab.offsetLeft + lastTab.offsetWidth > elements.canvas.clientWidth +
ctrl.offsetLeft;
}
/**
* Determines if the UI should stretch the tabs to fill the available space.
* @returns {*}
*/
function shouldStretchTabs () {
switch (ctrl.stretchTabs) {
case 'always':
return true;
case 'never':
return false;
default:
return !ctrl.shouldPaginate
&& $window.matchMedia('(max-width: 600px)').matches;
}
}
/**
* Determines if the tabs should appear centered.
* @returns {string|boolean}
*/
function shouldCenterTabs () {
return ctrl.centerTabs && !ctrl.shouldPaginate;
}
/**
* Determines if pagination is necessary to display the tabs within the available space.
* @returns {boolean}
*/
function shouldPaginate () {
if (ctrl.noPagination || !loaded) return false;
var canvasWidth = $element.prop('clientWidth');
angular.forEach(getElements().dummies, function (tab) { canvasWidth -= tab.offsetWidth; });
return canvasWidth < 0;
}
/**
* Finds the nearest tab index that is available. This is primarily used for when the active
* tab is removed.
* @param newIndex
* @returns {*}
*/
function getNearestSafeIndex (newIndex) {
if (newIndex === -1) return -1;
var maxOffset = Math.max(ctrl.tabs.length - newIndex, newIndex),
i, tab;
for (i = 0; i <= maxOffset; i++) {
tab = ctrl.tabs[ newIndex + i ];
if (tab && (tab.scope.disabled !== true)) return tab.getIndex();
tab = ctrl.tabs[ newIndex - i ];
if (tab && (tab.scope.disabled !== true)) return tab.getIndex();
}
return newIndex;
}
// Utility methods
/**
* Defines a property using a getter and setter in order to trigger a change handler without
* using `$watch` to observe changes.
* @param key
* @param handler
* @param value
*/
function defineProperty (key, handler, value) {
Object.defineProperty(ctrl, key, {
get: function () { return value; },
set: function (newValue) {
var oldValue = value;
value = newValue;
handler && handler(newValue, oldValue);
}
});
}
/**
* Updates whether or not pagination should be displayed.
*/
function updatePagination () {
if (!shouldStretchTabs()) updatePagingWidth();
ctrl.maxTabWidth = getMaxTabWidth();
ctrl.shouldPaginate = shouldPaginate();
}
function updatePagingWidth() {
var width = 1;
angular.forEach(getElements().dummies, function (element) {
//-- Uses the larger value between `getBoundingClientRect().width` and `offsetWidth`. This
// prevents `offsetWidth` value from being rounded down and causing wrapping issues, but
// also handles scenarios where `getBoundingClientRect()` is inaccurate (ie. tabs inside
// of a dialog)
width += Math.max(element.offsetWidth, element.getBoundingClientRect().width);
});
angular.element(elements.paging).css('width', Math.ceil(width) + 'px');
}
function getMaxTabWidth () {
return $element.prop('clientWidth');
}
/**
* Re-orders the tabs and updates the selected and focus indexes to their new positions.
* This is triggered by `tabDirective.js` when the user's tabs have been re-ordered.
*/
function updateTabOrder () {
var selectedItem = ctrl.tabs[ ctrl.selectedIndex ],
focusItem = ctrl.tabs[ ctrl.focusIndex ];
ctrl.tabs = ctrl.tabs.sort(function (a, b) {
return a.index - b.index;
});
ctrl.selectedIndex = ctrl.tabs.indexOf(selectedItem);
ctrl.focusIndex = ctrl.tabs.indexOf(focusItem);
}
/**
* This moves the selected or focus index left or right. This is used by the keydown handler.
* @param inc
*/
function incrementIndex (inc, focus) {
var newIndex,
key = focus ? 'focusIndex' : 'selectedIndex',
index = ctrl[ key ];
for (newIndex = index + inc;
ctrl.tabs[ newIndex ] && ctrl.tabs[ newIndex ].scope.disabled;
newIndex += inc) {}
if (ctrl.tabs[ newIndex ]) {
ctrl[ key ] = newIndex;
}
}
/**
* This is used to forward focus to dummy elements. This method is necessary to avoid animation
* issues when attempting to focus an item that is out of view.
*/
function redirectFocus () {
getElements().dummies[ ctrl.focusIndex ].focus();
}
/**
* Forces the pagination to move the focused tab into view.
*/
function adjustOffset (index) {
if (index == null) index = ctrl.focusIndex;
if (!elements.tabs[ index ]) return;
if (ctrl.shouldCenterTabs) return;
var tab = elements.tabs[ index ],
left = tab.offsetLeft,
right = tab.offsetWidth + left;
ctrl.offsetLeft = Math.max(ctrl.offsetLeft, fixOffset(right - elements.canvas.clientWidth + 32 * 2));
ctrl.offsetLeft = Math.min(ctrl.offsetLeft, fixOffset(left));
}
/**
* Iterates through all queued functions and clears the queue. This is used for functions that
* are called before the UI is ready, such as size calculations.
*/
function processQueue () {
queue.forEach(function (func) { $mdUtil.nextTick(func); });
queue = [];
}
/**
* Determines if the tab content area is needed.
*/
function updateHasContent () {
var hasContent = false;
angular.forEach(ctrl.tabs, function (tab) {
if (tab.template) hasContent = true;
});
ctrl.hasContent = hasContent;
}
/**
* Moves the indexes to their nearest valid values.
*/
function refreshIndex () {
ctrl.selectedIndex = getNearestSafeIndex(ctrl.selectedIndex);
ctrl.focusIndex = getNearestSafeIndex(ctrl.focusIndex);
}
/**
* Calculates the content height of the current tab.
* @returns {*}
*/
function updateHeightFromContent () {
if (!ctrl.dynamicHeight) return $element.css('height', '');
if (!ctrl.tabs.length) return queue.push(updateHeightFromContent);
var tabContent = elements.contents[ ctrl.selectedIndex ],
contentHeight = tabContent ? tabContent.offsetHeight : 0,
tabsHeight = elements.wrapper.offsetHeight,
newHeight = contentHeight + tabsHeight,
currentHeight = $element.prop('clientHeight');
if (currentHeight === newHeight) return;
// Adjusts calculations for when the buttons are bottom-aligned since this relies on absolute
// positioning. This should probably be cleaned up if a cleaner solution is possible.
if ($element.attr('md-align-tabs') === 'bottom') {
currentHeight -= tabsHeight;
newHeight -= tabsHeight;
// Need to include bottom border in these calculations
if ($element.attr('md-border-bottom') !== undefined) ++currentHeight;
}
// Lock during animation so the user can't change tabs
locked = true;
var fromHeight = { height: currentHeight + 'px' },
toHeight = { height: newHeight + 'px' };
// Set the height to the current, specific pixel height to fix a bug on iOS where the height
// first animates to 0, then back to the proper height causing a visual glitch
$element.css(fromHeight);
// Animate the height from the old to the new
$animateCss($element, {
from: fromHeight,
to: toHeight,
easing: 'cubic-bezier(0.35, 0, 0.25, 1)',
duration: 0.5
}).start().done(function () {
// Then (to fix the same iOS issue as above), disable transitions and remove the specific
// pixel height so the height can size with browser width/content changes, etc.
$element.css({
transition: 'none',
height: ''
});
// In the next tick, re-allow transitions (if we do it all at once, $element.css is "smart"
// enough to batch it for us instead of doing it immediately, which undoes the original
// transition: none)
$mdUtil.nextTick(function() {
$element.css('transition', '');
});
// And unlock so tab changes can occur
locked = false;
});
}
/**
* Repositions the ink bar to the selected tab.
* @returns {*}
*/
function updateInkBarStyles () {
if (!elements.tabs[ ctrl.selectedIndex ]) {
angular.element(elements.inkBar).css({ left: 'auto', right: 'auto' });
return;
}
if (!ctrl.tabs.length) return queue.push(ctrl.updateInkBarStyles);
// if the element is not visible, we will not be able to calculate sizes until it is
// we should treat that as a resize event rather than just updating the ink bar
if (!$element.prop('offsetParent')) return handleResizeWhenVisible();
var index = ctrl.selectedIndex,
totalWidth = elements.paging.offsetWidth,
tab = elements.tabs[ index ],
left = tab.offsetLeft,
right = totalWidth - left - tab.offsetWidth,
tabWidth;
if (ctrl.shouldCenterTabs) {
tabWidth = Array.prototype.slice.call(elements.tabs).reduce(function (value, element) {
return value + element.offsetWidth;
}, 0);
if (totalWidth > tabWidth) $mdUtil.nextTick(updateInkBarStyles, false);
}
updateInkBarClassName();
angular.element(elements.inkBar).css({ left: left + 'px', right: right + 'px' });
}
/**
* Adds left/right classes so that the ink bar will animate properly.
*/
function updateInkBarClassName () {
var newIndex = ctrl.selectedIndex,
oldIndex = ctrl.lastSelectedIndex,
ink = angular.element(elements.inkBar);
if (!angular.isNumber(oldIndex)) return;
ink
.toggleClass('md-left', newIndex < oldIndex)
.toggleClass('md-right', newIndex > oldIndex);
}
/**
* Takes an offset value and makes sure that it is within the min/max allowed values.
* @param value
* @returns {*}
*/
function fixOffset (value) {
if (!elements.tabs.length || !ctrl.shouldPaginate) return 0;
var lastTab = elements.tabs[ elements.tabs.length - 1 ],
totalWidth = lastTab.offsetLeft + lastTab.offsetWidth;
value = Math.max(0, value);
value = Math.min(totalWidth - elements.canvas.clientWidth, value);
return value;
}
/**
* Attaches a ripple to the tab item element.
* @param scope
* @param element
*/
function attachRipple (scope, element) {
var options = { colorElement: angular.element(elements.inkBar) };
$mdTabInkRipple.attach(scope, element, options);
}
}
MdTabsController.$inject = ["$scope", "$element", "$window", "$mdConstant", "$mdTabInkRipple", "$mdUtil", "$animateCss", "$attrs", "$compile", "$mdTheming"];
/**
* @ngdoc directive
* @name mdTabs
* @module material.components.tabs
*
* @restrict E
*
* @description
* The `<md-tabs>` directive serves as the container for 1..n `<md-tab>` child directives to produces a Tabs components.
* In turn, the nested `<md-tab>` directive is used to specify a tab label for the **header button** and a [optional] tab view
* content that will be associated with each tab button.
*
* Below is the markup for its simplest usage:
*
* <hljs lang="html">
* <md-tabs>
* <md-tab label="Tab #1"></md-tab>
* <md-tab label="Tab #2"></md-tab>
* <md-tab label="Tab #3"></md-tab>
* </md-tabs>
* </hljs>
*
* Tabs supports three (3) usage scenarios:
*
* 1. Tabs (buttons only)
* 2. Tabs with internal view content
* 3. Tabs with external view content
*
* **Tab-only** support is useful when tab buttons are used for custom navigation regardless of any other components, content, or views.
* **Tabs with internal views** are the traditional usages where each tab has associated view content and the view switching is managed internally by the Tabs component.
* **Tabs with external view content** is often useful when content associated with each tab is independently managed and data-binding notifications announce tab selection changes.
*
* Additional features also include:
*
* * Content can include any markup.
* * If a tab is disabled while active/selected, then the next tab will be auto-selected.
*
* ### Explanation of tab stretching
*
* Initially, tabs will have an inherent size. This size will either be defined by how much space is needed to accommodate their text or set by the user through CSS. Calculations will be based on this size.
*
* On mobile devices, tabs will be expanded to fill the available horizontal space. When this happens, all tabs will become the same size.
*
* On desktops, by default, stretching will never occur.
*
* This default behavior can be overridden through the `md-stretch-tabs` attribute. Here is a table showing when stretching will occur:
*
* `md-stretch-tabs` | mobile | desktop
* ------------------|-----------|--------
* `auto` | stretched | ---
* `always` | stretched | stretched
* `never` | --- | ---
*
* @param {integer=} md-selected Index of the active/selected tab
* @param {boolean=} md-no-ink If present, disables ink ripple effects.
* @param {boolean=} md-no-ink-bar If present, disables the selection ink bar.
* @param {string=} md-align-tabs Attribute to indicate position of tab buttons: `bottom` or `top`; default is `top`
* @param {string=} md-stretch-tabs Attribute to indicate whether or not to stretch tabs: `auto`, `always`, or `never`; default is `auto`
* @param {boolean=} md-dynamic-height When enabled, the tab wrapper will resize based on the contents of the selected tab
* @param {boolean=} md-border-bottom If present, shows a solid `1px` border between the tabs and their content
* @param {boolean=} md-center-tabs When enabled, tabs will be centered provided there is no need for pagination
* @param {boolean=} md-no-pagination When enabled, pagination will remain off
* @param {boolean=} md-swipe-content When enabled, swipe gestures will be enabled for the content area to jump between tabs
* @param {boolean=} md-enable-disconnect When enabled, scopes will be disconnected for tabs that are not being displayed. This provides a performance boost, but may also cause unexpected issues and is not recommended for most users.
* @param {boolean=} md-autoselect When present, any tabs added after the initial load will be automatically selected
*
* @usage
* <hljs lang="html">
* <md-tabs md-selected="selectedIndex" >
* <img ng-src="img/angular.png" class="centered">
* <md-tab
* ng-repeat="tab in tabs | orderBy:predicate:reversed"
* md-on-select="onTabSelected(tab)"
* md-on-deselect="announceDeselected(tab)"
* ng-disabled="tab.disabled">
* <md-tab-label>
* {{tab.title}}
* <img src="img/removeTab.png" ng-click="removeTab(tab)" class="delete">
* </md-tab-label>
* <md-tab-body>
* {{tab.content}}
* </md-tab-body>
* </md-tab>
* </md-tabs>
* </hljs>
*
*/
angular
.module('material.components.tabs')
.directive('mdTabs', MdTabs);
function MdTabs () {
return {
scope: {
selectedIndex: '=?mdSelected'
},
template: function (element, attr) {
attr[ "$mdTabsTemplate" ] = element.html();
return '' +
'<md-tabs-wrapper> ' +
'<md-tab-data></md-tab-data> ' +
'<md-prev-button ' +
'tabindex="-1" ' +
'role="button" ' +
'aria-label="Previous Page" ' +
'aria-disabled="{{!$mdTabsCtrl.canPageBack()}}" ' +
'ng-class="{ \'md-disabled\': !$mdTabsCtrl.canPageBack() }" ' +
'ng-if="$mdTabsCtrl.shouldPaginate" ' +
'ng-click="$mdTabsCtrl.previousPage()"> ' +
'<md-icon md-svg-icon="md-tabs-arrow"></md-icon> ' +
'</md-prev-button> ' +
'<md-next-button ' +
'tabindex="-1" ' +
'role="button" ' +
'aria-label="Next Page" ' +
'aria-disabled="{{!$mdTabsCtrl.canPageForward()}}" ' +
'ng-class="{ \'md-disabled\': !$mdTabsCtrl.canPageForward() }" ' +
'ng-if="$mdTabsCtrl.shouldPaginate" ' +
'ng-click="$mdTabsCtrl.nextPage()"> ' +
'<md-icon md-svg-icon="md-tabs-arrow"></md-icon> ' +
'</md-next-button> ' +
'<md-tabs-canvas ' +
'tabindex="{{ $mdTabsCtrl.hasFocus ? -1 : 0 }}" ' +
'aria-activedescendant="tab-item-{{$mdTabsCtrl.tabs[$mdTabsCtrl.focusIndex].id}}" ' +
'ng-focus="$mdTabsCtrl.redirectFocus()" ' +
'ng-class="{ ' +
'\'md-paginated\': $mdTabsCtrl.shouldPaginate, ' +
'\'md-center-tabs\': $mdTabsCtrl.shouldCenterTabs ' +
'}" ' +
'ng-keydown="$mdTabsCtrl.keydown($event)" ' +
'role="tablist"> ' +
'<md-pagination-wrapper ' +
'ng-class="{ \'md-center-tabs\': $mdTabsCtrl.shouldCenterTabs }" ' +
'md-tab-scroll="$mdTabsCtrl.scroll($event)"> ' +
'<md-tab-item ' +
'tabindex="-1" ' +
'class="md-tab" ' +
'ng-repeat="tab in $mdTabsCtrl.tabs" ' +
'role="tab" ' +
'aria-controls="tab-content-{{::tab.id}}" ' +
'aria-selected="{{tab.isActive()}}" ' +
'aria-disabled="{{tab.scope.disabled || \'false\'}}" ' +
'ng-click="$mdTabsCtrl.select(tab.getIndex())" ' +
'ng-class="{ ' +
'\'md-active\': tab.isActive(), ' +
'\'md-focused\': tab.hasFocus(), ' +
'\'md-disabled\': tab.scope.disabled ' +
'}" ' +
'ng-disabled="tab.scope.disabled" ' +
'md-swipe-left="$mdTabsCtrl.nextPage()" ' +
'md-swipe-right="$mdTabsCtrl.previousPage()" ' +
'md-tabs-template="::tab.label" ' +
'md-scope="::tab.parent"></md-tab-item> ' +
'<md-ink-bar></md-ink-bar> ' +
'</md-pagination-wrapper> ' +
'<div class="md-visually-hidden md-dummy-wrapper"> ' +
'<md-dummy-tab ' +
'class="md-tab" ' +
'tabindex="-1" ' +
'id="tab-item-{{::tab.id}}" ' +
'role="tab" ' +
'aria-controls="tab-content-{{::tab.id}}" ' +
'aria-selected="{{tab.isActive()}}" ' +
'aria-disabled="{{tab.scope.disabled || \'false\'}}" ' +
'ng-focus="$mdTabsCtrl.hasFocus = true" ' +
'ng-blur="$mdTabsCtrl.hasFocus = false" ' +
'ng-repeat="tab in $mdTabsCtrl.tabs" ' +
'md-tabs-template="::tab.label" ' +
'md-scope="::tab.parent"></md-dummy-tab> ' +
'</div> ' +
'</md-tabs-canvas> ' +
'</md-tabs-wrapper> ' +
'<md-tabs-content-wrapper ng-show="$mdTabsCtrl.hasContent && $mdTabsCtrl.selectedIndex >= 0"> ' +
'<md-tab-content ' +
'id="tab-content-{{::tab.id}}" ' +
'role="tabpanel" ' +
'aria-labelledby="tab-item-{{::tab.id}}" ' +
'md-swipe-left="$mdTabsCtrl.swipeContent && $mdTabsCtrl.incrementIndex(1)" ' +
'md-swipe-right="$mdTabsCtrl.swipeContent && $mdTabsCtrl.incrementIndex(-1)" ' +
'ng-if="$mdTabsCtrl.hasContent" ' +
'ng-repeat="(index, tab) in $mdTabsCtrl.tabs" ' +
'ng-class="{ ' +
'\'md-no-transition\': $mdTabsCtrl.lastSelectedIndex == null, ' +
'\'md-active\': tab.isActive(), ' +
'\'md-left\': tab.isLeft(), ' +
'\'md-right\': tab.isRight(), ' +
'\'md-no-scroll\': $mdTabsCtrl.dynamicHeight ' +
'}"> ' +
'<div ' +
'md-tabs-template="::tab.template" ' +
'md-connected-if="tab.isActive()" ' +
'md-scope="::tab.parent" ' +
'ng-if="$mdTabsCtrl.enableDisconnect || tab.shouldRender()"></div> ' +
'</md-tab-content> ' +
'</md-tabs-content-wrapper>';
},
controller: 'MdTabsController',
controllerAs: '$mdTabsCtrl',
bindToController: true
};
}
angular
.module('material.components.tabs')
.directive('mdTabsTemplate', MdTabsTemplate);
function MdTabsTemplate ($compile, $mdUtil) {
return {
restrict: 'A',
link: link,
scope: {
template: '=mdTabsTemplate',
connected: '=?mdConnectedIf',
compileScope: '=mdScope'
},
require: '^?mdTabs'
};
function link (scope, element, attr, ctrl) {
if (!ctrl) return;
var compileScope = ctrl.enableDisconnect ? scope.compileScope.$new() : scope.compileScope;
element.html(scope.template);
$compile(element.contents())(compileScope);
element.on('DOMSubtreeModified', function () {
ctrl.updatePagination();
ctrl.updateInkBarStyles();
});
return $mdUtil.nextTick(handleScope);
function handleScope () {
scope.$watch('connected', function (value) { value === false ? disconnect() : reconnect(); });
scope.$on('$destroy', reconnect);
}
function disconnect () {
if (ctrl.enableDisconnect) $mdUtil.disconnectScope(compileScope);
}
function reconnect () {
if (ctrl.enableDisconnect) $mdUtil.reconnectScope(compileScope);
}
}
}
MdTabsTemplate.$inject = ["$compile", "$mdUtil"];
ng.material.components.tabs = angular.module("material.components.tabs");
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/@-webkit-keyframes md-tab-content-hide{0%,50%{opacity:1}100%{opacity:0}}@keyframes md-tab-content-hide{0%,50%{opacity:1}100%{opacity:0}}md-tab-data{position:absolute;top:0;left:0;right:0;bottom:0;z-index:-1;opacity:0}md-tabs{display:block;margin:0;border-radius:2px;overflow:hidden;position:relative;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0}md-tabs:not(.md-no-tab-content):not(.md-dynamic-height){min-height:248px}md-tabs[md-align-tabs=bottom]{padding-bottom:48px}md-tabs[md-align-tabs=bottom] md-tabs-wrapper{position:absolute;bottom:0;left:0;right:0;height:48px;z-index:2}md-tabs[md-align-tabs=bottom] md-tabs-content-wrapper{top:0;bottom:48px}md-tabs.md-dynamic-height md-tabs-content-wrapper{min-height:0;position:relative;top:auto;left:auto;right:auto;bottom:auto;overflow:visible}md-tabs.md-dynamic-height md-tab-content.md-active{position:relative}md-tabs[md-border-bottom] md-tabs-wrapper{border-width:0 0 1px;border-style:solid}md-tabs[md-border-bottom]:not(.md-dynamic-height) md-tabs-content-wrapper{top:49px}md-tabs-wrapper{display:block;position:relative;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}md-tabs-wrapper md-next-button,md-tabs-wrapper md-prev-button{height:100%;width:32px;position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);line-height:1em;z-index:2;cursor:pointer;font-size:16px;background:center center no-repeat;transition:all .5s cubic-bezier(.35,0,.25,1)}md-tabs-wrapper md-next-button:focus,md-tabs-wrapper md-prev-button:focus{outline:0}md-tabs-wrapper md-next-button.md-disabled,md-tabs-wrapper md-prev-button.md-disabled{opacity:.25;cursor:default}md-tabs-wrapper md-next-button.ng-leave,md-tabs-wrapper md-prev-button.ng-leave{transition:none}md-tabs-wrapper md-next-button md-icon,md-tabs-wrapper md-prev-button md-icon{position:absolute;top:50%;left:50%;-webkit-transform:translate3d(-50%,-50%,0);transform:translate3d(-50%,-50%,0)}md-tabs-wrapper md-prev-button{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE3LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPiA8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPiA8c3ZnIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSIyNHB4IiBoZWlnaHQ9IjI0cHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMjQgMjQiIHhtbDpzcGFjZT0icHJlc2VydmUiPiA8ZyBpZD0iSGVhZGVyIj4gPGc+IDxyZWN0IHg9Ii02MTgiIHk9Ii0xMjA4IiBmaWxsPSJub25lIiB3aWR0aD0iMTQwMCIgaGVpZ2h0PSIzNjAwIi8+IDwvZz4gPC9nPiA8ZyBpZD0iTGFiZWwiPiA8L2c+IDxnIGlkPSJJY29uIj4gPGc+IDxwb2x5Z29uIHBvaW50cz0iMTUuNCw3LjQgMTQsNiA4LDEyIDE0LDE4IDE1LjQsMTYuNiAxMC44LDEyIAkJIiBzdHlsZT0iZmlsbDp3aGl0ZTsiLz4gPHJlY3QgZmlsbD0ibm9uZSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ii8+IDwvZz4gPC9nPiA8ZyBpZD0iR3JpZCIgZGlzcGxheT0ibm9uZSI+IDxnIGRpc3BsYXk9ImlubGluZSI+IDwvZz4gPC9nPiA8L3N2Zz4NCg==)}body[dir=ltr] md-tabs-wrapper md-prev-button,html[dir=ltr] md-tabs-wrapper md-prev-button{left:0;unicode-bidi:embed}body[dir=rtl] md-tabs-wrapper md-prev-button,html[dir=rtl] md-tabs-wrapper md-prev-button{right:0;unicode-bidi:embed}html:not([dir]) body:not([dir]) md-tabs-wrapper md-prev-button{left:0;unicode-bidi:embed}md-tabs-wrapper md-prev-button bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}md-tabs-wrapper md-prev-button bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}md-tabs-wrapper md-next-button{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE3LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPiA8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPiA8c3ZnIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSIyNHB4IiBoZWlnaHQ9IjI0cHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMjQgMjQiIHhtbDpzcGFjZT0icHJlc2VydmUiPiA8ZyBpZD0iSGVhZGVyIj4gPGc+IDxyZWN0IHg9Ii02MTgiIHk9Ii0xMzM2IiBmaWxsPSJub25lIiB3aWR0aD0iMTQwMCIgaGVpZ2h0PSIzNjAwIi8+IDwvZz4gPC9nPiA8ZyBpZD0iTGFiZWwiPiA8L2c+IDxnIGlkPSJJY29uIj4gPGc+IDxwb2x5Z29uIHBvaW50cz0iMTAsNiA4LjYsNy40IDEzLjIsMTIgOC42LDE2LjYgMTAsMTggMTYsMTIgCQkiIHN0eWxlPSJmaWxsOndoaXRlOyIvPiA8cmVjdCBmaWxsPSJub25lIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiLz4gPC9nPiA8L2c+IDxnIGlkPSJHcmlkIiBkaXNwbGF5PSJub25lIj4gPGcgZGlzcGxheT0iaW5saW5lIj4gPC9nPiA8L2c+IDwvc3ZnPg0K)}body[dir=ltr] md-tabs-wrapper md-next-button,html[dir=ltr] md-tabs-wrapper md-next-button{right:0;unicode-bidi:embed}body[dir=rtl] md-tabs-wrapper md-next-button,html[dir=rtl] md-tabs-wrapper md-next-button{left:0;unicode-bidi:embed}html:not([dir]) body:not([dir]) md-tabs-wrapper md-next-button{right:0;unicode-bidi:embed}md-tabs-wrapper md-next-button bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}md-tabs-wrapper md-next-button bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}md-tabs-wrapper md-next-button md-icon{-webkit-transform:translate3d(-50%,-50%,0) rotate(180deg);transform:translate3d(-50%,-50%,0) rotate(180deg)}md-tabs-wrapper.md-stretch-tabs md-pagination-wrapper{width:100%;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row}md-tabs-wrapper.md-stretch-tabs md-pagination-wrapper md-tab-item{-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1}md-tabs-canvas{position:relative;overflow:hidden;display:block;height:48px}md-tabs-canvas:after{content:'';display:table;clear:both}md-tabs-canvas .md-dummy-wrapper{position:absolute;top:0}body[dir=ltr] md-tabs-canvas .md-dummy-wrapper,html[dir=ltr] md-tabs-canvas .md-dummy-wrapper{left:0;unicode-bidi:embed}body[dir=rtl] md-tabs-canvas .md-dummy-wrapper,html[dir=rtl] md-tabs-canvas .md-dummy-wrapper{right:0;unicode-bidi:embed}html:not([dir]) body:not([dir]) md-tabs-canvas .md-dummy-wrapper{left:0;unicode-bidi:embed}md-tabs-canvas .md-dummy-wrapper bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}md-tabs-canvas .md-dummy-wrapper bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}md-tabs-canvas.md-paginated{margin:0 32px}md-tabs-canvas.md-center-tabs{display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;text-align:center}md-tabs-canvas.md-center-tabs .md-tab{float:none;display:inline-block}md-pagination-wrapper{height:48px;display:block;transition:-webkit-transform .5s cubic-bezier(.35,0,.25,1);transition:transform .5s cubic-bezier(.35,0,.25,1);position:absolute;width:999999px;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}md-pagination-wrapper:after{content:'';display:table;clear:both}body[dir=ltr] md-pagination-wrapper,html[dir=ltr] md-pagination-wrapper{left:0;unicode-bidi:embed}body[dir=rtl] md-pagination-wrapper,html[dir=rtl] md-pagination-wrapper{right:0;unicode-bidi:embed}html:not([dir]) body:not([dir]) md-pagination-wrapper{left:0;unicode-bidi:embed}md-pagination-wrapper bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}md-pagination-wrapper bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}md-pagination-wrapper.md-center-tabs{position:relative;width:initial;margin:0 auto}md-tabs-content-wrapper{display:block;position:absolute;top:48px;left:0;right:0;bottom:0;overflow:hidden}md-tab-content{display:block;position:absolute;top:0;left:0;right:0;bottom:0;transition:-webkit-transform .5s cubic-bezier(.35,0,.25,1);transition:transform .5s cubic-bezier(.35,0,.25,1);overflow:auto;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}md-tab-content.md-no-scroll{bottom:auto;overflow:hidden}md-tab-content.md-no-transition,md-tab-content.ng-leave{transition:none}md-tab-content.md-left:not(.md-active){-webkit-animation:1s md-tab-content-hide;animation:1s md-tab-content-hide;opacity:0}body[dir=ltr] md-tab-content.md-left:not(.md-active),html[dir=ltr] md-tab-content.md-left:not(.md-active){-webkit-transform:translateX(-100%);transform:translateX(-100%);unicode-bidi:embed}body[dir=rtl] md-tab-content.md-left:not(.md-active),html[dir=rtl] md-tab-content.md-left:not(.md-active){-webkit-transform:translateX(100%);transform:translateX(100%);unicode-bidi:embed}html:not([dir]) body:not([dir]) md-tab-content.md-left:not(.md-active){-webkit-transform:translateX(-100%);transform:translateX(-100%);unicode-bidi:embed}md-tab-content.md-left:not(.md-active) bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}md-tab-content.md-left:not(.md-active) bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}md-tab-content.md-left:not(.md-active) *{transition:visibility 0s linear;transition-delay:.5s;visibility:hidden}md-tab-content.md-right:not(.md-active){-webkit-animation:1s md-tab-content-hide;animation:1s md-tab-content-hide;opacity:0}body[dir=ltr] md-tab-content.md-right:not(.md-active),html[dir=ltr] md-tab-content.md-right:not(.md-active){-webkit-transform:translateX(100%);transform:translateX(100%);unicode-bidi:embed}body[dir=rtl] md-tab-content.md-right:not(.md-active),html[dir=rtl] md-tab-content.md-right:not(.md-active){-webkit-transform:translateX(-100%);transform:translateX(-100%);unicode-bidi:embed}html:not([dir]) body:not([dir]) md-tab-content.md-right:not(.md-active){-webkit-transform:translateX(100%);transform:translateX(100%);unicode-bidi:embed}md-tab-content.md-right:not(.md-active) bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}md-tab-content.md-right:not(.md-active) bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}md-tab-content.md-right:not(.md-active) *{transition:visibility 0s linear;transition-delay:.5s;visibility:hidden}md-tab-content>div.ng-leave{-webkit-animation:1s md-tab-content-hide;animation:1s md-tab-content-hide}md-ink-bar{position:absolute;left:auto;right:auto;bottom:0;height:2px}md-ink-bar.md-left{transition:left .125s cubic-bezier(.35,0,.25,1),right .25s cubic-bezier(.35,0,.25,1)}md-ink-bar.md-right{transition:left .25s cubic-bezier(.35,0,.25,1),right .125s cubic-bezier(.35,0,.25,1)}md-tab{position:absolute;z-index:-1;left:-9999px}.md-tab{font-size:14px;text-align:center;line-height:24px;padding:12px 24px;transition:background-color .35s cubic-bezier(.35,0,.25,1);cursor:pointer;white-space:nowrap;position:relative;text-transform:uppercase;font-weight:500;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis}body[dir=ltr] .md-tab,html[dir=ltr] .md-tab{float:left;unicode-bidi:embed}body[dir=rtl] .md-tab,html[dir=rtl] .md-tab{float:right;unicode-bidi:embed}html:not([dir]) body:not([dir]) .md-tab{float:left;unicode-bidi:embed}.md-tab bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}.md-tab bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}.md-tab.md-focused{box-shadow:none;outline:0}.md-tab.md-active{cursor:default}.md-tab.md-disabled{pointer-events:none;-ms-touch-action:pan-y;touch-action:pan-y;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-drag:none;opacity:.5;cursor:default}.md-tab.ng-leave{transition:none}md-toolbar+md-tabs{border-top-left-radius:0;border-top-right-radius:0}
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/
function MdTab(){function e(e,n,a,s){if(s){var d=s.getTabElementIndex(n),i=t(n,"md-tab-body").remove(),r=t(n,"md-tab-label").remove(),o=s.insertTab({scope:e,parent:e.$parent,index:d,element:n,template:i.html(),label:r.html()},d);e.select=e.select||angular.noop,e.deselect=e.deselect||angular.noop,e.$watch("active",function(e){e&&s.select(o.getIndex())}),e.$watch("disabled",function(){s.refreshIndex()}),e.$watch(function(){return s.getTabElementIndex(n)},function(e){o.index=e,s.updateTabOrder()}),e.$on("$destroy",function(){s.removeTab(o)})}}function t(e,t){for(var n=e[0].children,a=0,s=n.length;s>a;a++){var d=n[a];if(d.tagName===t.toUpperCase())return angular.element(d)}return angular.element()}return{require:"^?mdTabs",terminal:!0,compile:function(n,a){var s=t(n,"md-tab-label"),d=t(n,"md-tab-body");if(0==s.length&&(s=angular.element("<md-tab-label></md-tab-label>"),a.label?s.text(a.label):s.append(n.contents()),0==d.length)){var i=n.contents().detach();d=angular.element("<md-tab-body></md-tab-body>"),d.append(i)}return n.append(s),d.html()&&n.append(d),e},scope:{active:"=?mdActive",disabled:"=?ngDisabled",select:"&?mdOnSelect",deselect:"&?mdOnDeselect"}}}function MdTabItem(){return{require:"^?mdTabs",link:function(e,t,n,a){a&&a.attachRipple(e,t)}}}function MdTabLabel(){return{terminal:!0}}function MdTabScroll(e){return{restrict:"A",compile:function(t,n){var a=e(n.mdTabScroll,null,!0);return function(e,t){t.on("mousewheel",function(t){e.$apply(function(){a(e,{$event:t})})})}}}}function MdTabsController(e,t,n,a,s,d,i,r,o,c){function l(){re.selectedIndex=re.selectedIndex||0,m(),u(),b(),c(t),d.nextTick(function(){ne(),X(),ae(),re.tabs[re.selectedIndex]&&re.tabs[re.selectedIndex].scope.select(),be=!0,K()})}function m(){var e=r.$mdTabsTemplate,t=angular.element(ce.data);t.html(e),o(t.contents())(re.parent),delete r.$mdTabsTemplate}function b(){angular.element(n).on("resize",B),e.$on("$destroy",p)}function u(){e.$watch("$mdTabsCtrl.selectedIndex",w)}function f(e,t){var n=r.$normalize("md-"+e);t&&j(e,t),r.$observe(n,function(t){re[e]=t})}function g(e,t){function n(t){re[e]="false"!==t}var a=r.$normalize("md-"+e);t&&j(e,t),r.hasOwnProperty(a)&&n(r[a]),r.$observe(a,n)}function p(){me=!0,angular.element(n).off("resize",B)}function h(e){angular.element(ce.wrapper).toggleClass("md-stretch-tabs",H()),ae()}function T(e){re.shouldCenterTabs=_()}function x(e,t){e!==t&&(angular.forEach(ce.tabs,function(t){t.style.maxWidth=e+"px"}),d.nextTick(re.updateInkBarStyles))}function v(e,t){e!==t&&(re.maxTabWidth=G(),re.shouldCenterTabs=_(),d.nextTick(function(){re.maxTabWidth=G(),X(re.selectedIndex)}))}function C(e){t[e?"removeClass":"addClass"]("md-no-tab-content")}function $(t){var n=re.shouldCenterTabs?"":"-"+t+"px";angular.element(ce.paging).css(a.CSS.TRANSFORM,"translate3d("+n+", 0, 0)"),e.$broadcast("$mdTabsPaginationChanged")}function I(e,t){e!==t&&ce.tabs[e]&&(X(),V())}function w(t,n){t!==n&&(re.selectedIndex=z(t),re.lastSelectedIndex=n,re.updateInkBarStyles(),ne(),X(t),e.$broadcast("$mdTabsChanged"),re.tabs[n]&&re.tabs[n].scope.deselect(),re.tabs[t]&&re.tabs[t].scope.select())}function k(e){var n=t[0].getElementsByTagName("md-tab");return Array.prototype.indexOf.call(n,e[0])}function y(){y.watcher||(y.watcher=e.$watch(function(){d.nextTick(function(){y.watcher&&t.prop("offsetParent")&&(y.watcher(),y.watcher=null,B())},!1)}))}function P(e){switch(e.keyCode){case a.KEY_CODE.LEFT_ARROW:e.preventDefault(),Q(-1,!0);break;case a.KEY_CODE.RIGHT_ARROW:e.preventDefault(),Q(1,!0);break;case a.KEY_CODE.SPACE:case a.KEY_CODE.ENTER:e.preventDefault(),oe||(re.selectedIndex=re.focusIndex)}re.lastClick=!1}function E(e){oe||(re.focusIndex=re.selectedIndex=e),re.lastClick=!0,d.nextTick(function(){re.tabs[e].element.triggerHandler("click")},!1)}function L(e){re.shouldPaginate&&(e.preventDefault(),re.offsetLeft=de(re.offsetLeft-e.wheelDelta))}function M(){var e,t,n=ce.canvas.clientWidth,a=n+re.offsetLeft;for(e=0;e<ce.tabs.length&&(t=ce.tabs[e],!(t.offsetLeft+t.offsetWidth>a));e++);re.offsetLeft=de(t.offsetLeft)}function S(){var e,t;for(e=0;e<ce.tabs.length&&(t=ce.tabs[e],!(t.offsetLeft+t.offsetWidth>=re.offsetLeft));e++);re.offsetLeft=de(t.offsetLeft+t.offsetWidth-ce.canvas.clientWidth)}function B(){re.lastSelectedIndex=re.selectedIndex,re.offsetLeft=de(re.offsetLeft),d.nextTick(function(){re.updateInkBarStyles(),K()})}function W(e){angular.element(ce.inkBar).toggleClass("ng-hide",e)}function D(e){t.toggleClass("md-dynamic-height",e)}function O(e){if(!me){var t=re.selectedIndex,n=re.tabs.splice(e.getIndex(),1)[0];te(),re.selectedIndex===t&&(n.scope.deselect(),re.tabs[re.selectedIndex]&&re.tabs[re.selectedIndex].scope.select()),d.nextTick(function(){K(),re.offsetLeft=de(re.offsetLeft)})}}function A(e,t){var n=be,a={getIndex:function(){return re.tabs.indexOf(s)},isActive:function(){return this.getIndex()===re.selectedIndex},isLeft:function(){return this.getIndex()<re.selectedIndex},isRight:function(){return this.getIndex()>re.selectedIndex},shouldRender:function(){return!re.noDisconnect||this.isActive()},hasFocus:function(){return!re.lastClick&&re.hasFocus&&this.getIndex()===re.focusIndex},id:d.nextUid()},s=angular.extend(a,e);return angular.isDefined(t)?re.tabs.splice(t,0,s):re.tabs.push(s),Z(),ee(),d.nextTick(function(){K(),n&&re.autoselect&&d.nextTick(function(){d.nextTick(function(){E(re.tabs.indexOf(s))})})}),s}function R(){var e={};return e.wrapper=t[0].getElementsByTagName("md-tabs-wrapper")[0],e.data=t[0].getElementsByTagName("md-tab-data")[0],e.canvas=e.wrapper.getElementsByTagName("md-tabs-canvas")[0],e.paging=e.canvas.getElementsByTagName("md-pagination-wrapper")[0],e.tabs=e.paging.getElementsByTagName("md-tab-item"),e.dummies=e.canvas.getElementsByTagName("md-dummy-tab"),e.inkBar=e.paging.getElementsByTagName("md-ink-bar")[0],e.contentsWrapper=t[0].getElementsByTagName("md-tabs-content-wrapper")[0],e.contents=e.contentsWrapper.getElementsByTagName("md-tab-content"),e}function N(){return re.offsetLeft>0}function F(){var e=ce.tabs[ce.tabs.length-1];return e&&e.offsetLeft+e.offsetWidth>ce.canvas.clientWidth+re.offsetLeft}function H(){switch(re.stretchTabs){case"always":return!0;case"never":return!1;default:return!re.shouldPaginate&&n.matchMedia("(max-width: 600px)").matches}}function _(){return re.centerTabs&&!re.shouldPaginate}function q(){if(re.noPagination||!be)return!1;var e=t.prop("clientWidth");return angular.forEach(R().dummies,function(t){e-=t.offsetWidth}),0>e}function z(e){if(-1===e)return-1;var t,n,a=Math.max(re.tabs.length-e,e);for(t=0;a>=t;t++){if(n=re.tabs[e+t],n&&n.scope.disabled!==!0)return n.getIndex();if(n=re.tabs[e-t],n&&n.scope.disabled!==!0)return n.getIndex()}return e}function j(e,t,n){Object.defineProperty(re,e,{get:function(){return n},set:function(e){var a=n;n=e,t&&t(e,a)}})}function K(){U(),re.maxTabWidth=G(),re.shouldPaginate=q()}function U(){H()?angular.element(ce.paging).css("width",""):angular.element(ce.paging).css("width",Y()+"px")}function Y(){var e=1;return angular.forEach(R().dummies,function(t){e+=Math.max(t.offsetWidth,t.getBoundingClientRect().width)}),Math.ceil(e)}function G(){return t.prop("clientWidth")}function J(){var e=re.tabs[re.selectedIndex],t=re.tabs[re.focusIndex];re.tabs=re.tabs.sort(function(e,t){return e.index-t.index}),re.selectedIndex=re.tabs.indexOf(e),re.focusIndex=re.tabs.indexOf(t)}function Q(e,t){var n,a=t?"focusIndex":"selectedIndex",s=re[a];for(n=s+e;re.tabs[n]&&re.tabs[n].scope.disabled;n+=e);re.tabs[n]&&(re[a]=n)}function V(){R().dummies[re.focusIndex].focus()}function X(e){if(null==e&&(e=re.focusIndex),ce.tabs[e]&&!re.shouldCenterTabs){var t=ce.tabs[e],n=t.offsetLeft,a=t.offsetWidth+n;re.offsetLeft=Math.max(re.offsetLeft,de(a-ce.canvas.clientWidth+64)),re.offsetLeft=Math.min(re.offsetLeft,de(n))}}function Z(){le.forEach(function(e){d.nextTick(e)}),le=[]}function ee(){var e=!1;angular.forEach(re.tabs,function(t){t.template&&(e=!0)}),re.hasContent=e}function te(){re.selectedIndex=z(re.selectedIndex),re.focusIndex=z(re.focusIndex)}function ne(){if(!re.dynamicHeight)return t.css("height","");if(!re.tabs.length)return le.push(ne);var e=ce.contents[re.selectedIndex],n=e?e.offsetHeight:0,a=ce.wrapper.offsetHeight,s=n+a,r=t.prop("clientHeight");if(r!==s){"bottom"===t.attr("md-align-tabs")&&(r-=a,s-=a,void 0!==t.attr("md-border-bottom")&&++r),oe=!0;var o={height:r+"px"},c={height:s+"px"};t.css(o),i(t,{from:o,to:c,easing:"cubic-bezier(0.35, 0, 0.25, 1)",duration:.5}).start().done(function(){t.css({transition:"none",height:""}),d.nextTick(function(){t.css("transition","")}),oe=!1})}}function ae(){if(!ce.tabs[re.selectedIndex])return void angular.element(ce.inkBar).css({left:"auto",right:"auto"});if(!re.tabs.length)return le.push(re.updateInkBarStyles);if(!t.prop("offsetParent"))return y();var e,n=re.selectedIndex,a=ce.paging.offsetWidth,s=ce.tabs[n],i=s.offsetLeft,r=a-i-s.offsetWidth;re.shouldCenterTabs&&(e=Array.prototype.slice.call(ce.tabs).reduce(function(e,t){return e+t.offsetWidth},0),a>e&&d.nextTick(ae,!1)),se(),angular.element(ce.inkBar).css({left:i+"px",right:r+"px"})}function se(){var e=re.selectedIndex,t=re.lastSelectedIndex,n=angular.element(ce.inkBar);angular.isNumber(t)&&n.toggleClass("md-left",t>e).toggleClass("md-right",e>t)}function de(e){if(!ce.tabs.length||!re.shouldPaginate)return 0;var t=ce.tabs[ce.tabs.length-1],n=t.offsetLeft+t.offsetWidth;return e=Math.max(0,e),e=Math.min(n-ce.canvas.clientWidth,e)}function ie(e,t){var n={colorElement:angular.element(ce.inkBar)};s.attach(e,t,n)}var re=this,oe=!1,ce=R(),le=[],me=!1,be=!1;f("stretchTabs",h),j("focusIndex",I,re.selectedIndex||0),j("offsetLeft",$,0),j("hasContent",C,!1),j("maxTabWidth",x,G()),j("shouldPaginate",v,!1),g("noInkBar",W),g("dynamicHeight",D),g("noPagination"),g("swipeContent"),g("noDisconnect"),g("autoselect"),g("centerTabs",T,!1),g("enableDisconnect"),re.scope=e,re.parent=e.$parent,re.tabs=[],re.lastSelectedIndex=null,re.hasFocus=!1,re.lastClick=!0,re.shouldCenterTabs=_(),re.updatePagination=d.debounce(K,100),re.redirectFocus=V,re.attachRipple=ie,re.insertTab=A,re.removeTab=O,re.select=E,re.scroll=L,re.nextPage=M,re.previousPage=S,re.keydown=P,re.canPageForward=F,re.canPageBack=N,re.refreshIndex=te,re.incrementIndex=Q,re.getTabElementIndex=k,re.updateInkBarStyles=d.debounce(ae,100),re.updateTabOrder=d.debounce(J,100),l()}function MdTabs(){return{scope:{selectedIndex:"=?mdSelected"},template:function(e,t){return t.$mdTabsTemplate=e.html(),'<md-tabs-wrapper> <md-tab-data></md-tab-data> <md-prev-button tabindex="-1" role="button" aria-label="Previous Page" aria-disabled="{{!$mdTabsCtrl.canPageBack()}}" ng-class="{ \'md-disabled\': !$mdTabsCtrl.canPageBack() }" ng-if="$mdTabsCtrl.shouldPaginate" ng-click="$mdTabsCtrl.previousPage()"> <md-icon md-svg-icon="md-tabs-arrow"></md-icon> </md-prev-button> <md-next-button tabindex="-1" role="button" aria-label="Next Page" aria-disabled="{{!$mdTabsCtrl.canPageForward()}}" ng-class="{ \'md-disabled\': !$mdTabsCtrl.canPageForward() }" ng-if="$mdTabsCtrl.shouldPaginate" ng-click="$mdTabsCtrl.nextPage()"> <md-icon md-svg-icon="md-tabs-arrow"></md-icon> </md-next-button> <md-tabs-canvas tabindex="{{ $mdTabsCtrl.hasFocus ? -1 : 0 }}" aria-activedescendant="tab-item-{{$mdTabsCtrl.tabs[$mdTabsCtrl.focusIndex].id}}" ng-focus="$mdTabsCtrl.redirectFocus()" ng-class="{ \'md-paginated\': $mdTabsCtrl.shouldPaginate, \'md-center-tabs\': $mdTabsCtrl.shouldCenterTabs }" ng-keydown="$mdTabsCtrl.keydown($event)" role="tablist"> <md-pagination-wrapper ng-class="{ \'md-center-tabs\': $mdTabsCtrl.shouldCenterTabs }" md-tab-scroll="$mdTabsCtrl.scroll($event)"> <md-tab-item tabindex="-1" class="md-tab" ng-repeat="tab in $mdTabsCtrl.tabs" role="tab" aria-controls="tab-content-{{::tab.id}}" aria-selected="{{tab.isActive()}}" aria-disabled="{{tab.scope.disabled || \'false\'}}" ng-click="$mdTabsCtrl.select(tab.getIndex())" ng-class="{ \'md-active\': tab.isActive(), \'md-focused\': tab.hasFocus(), \'md-disabled\': tab.scope.disabled }" ng-disabled="tab.scope.disabled" md-swipe-left="$mdTabsCtrl.nextPage()" md-swipe-right="$mdTabsCtrl.previousPage()" md-tabs-template="::tab.label" md-scope="::tab.parent"></md-tab-item> <md-ink-bar></md-ink-bar> </md-pagination-wrapper> <div class="_md-visually-hidden md-dummy-wrapper"> <md-dummy-tab class="md-tab" tabindex="-1" id="tab-item-{{::tab.id}}" role="tab" aria-controls="tab-content-{{::tab.id}}" aria-selected="{{tab.isActive()}}" aria-disabled="{{tab.scope.disabled || \'false\'}}" ng-focus="$mdTabsCtrl.hasFocus = true" ng-blur="$mdTabsCtrl.hasFocus = false" ng-repeat="tab in $mdTabsCtrl.tabs" md-tabs-template="::tab.label" md-scope="::tab.parent"></md-dummy-tab> </div> </md-tabs-canvas> </md-tabs-wrapper> <md-tabs-content-wrapper ng-show="$mdTabsCtrl.hasContent && $mdTabsCtrl.selectedIndex >= 0"> <md-tab-content id="tab-content-{{::tab.id}}" role="tabpanel" aria-labelledby="tab-item-{{::tab.id}}" md-swipe-left="$mdTabsCtrl.swipeContent && $mdTabsCtrl.incrementIndex(1)" md-swipe-right="$mdTabsCtrl.swipeContent && $mdTabsCtrl.incrementIndex(-1)" ng-if="$mdTabsCtrl.hasContent" ng-repeat="(index, tab) in $mdTabsCtrl.tabs" ng-class="{ \'md-no-transition\': $mdTabsCtrl.lastSelectedIndex == null, \'md-active\': tab.isActive(), \'md-left\': tab.isLeft(), \'md-right\': tab.isRight(), \'md-no-scroll\': $mdTabsCtrl.dynamicHeight }"> <div md-tabs-template="::tab.template" md-connected-if="tab.isActive()" md-scope="::tab.parent" ng-if="$mdTabsCtrl.enableDisconnect || tab.shouldRender()"></div> </md-tab-content> </md-tabs-content-wrapper>'},controller:"MdTabsController",controllerAs:"$mdTabsCtrl",bindToController:!0}}function MdTabsTemplate(e,t){function n(n,a,s,d){function i(){n.$watch("connected",function(e){e===!1?r():o()}),n.$on("$destroy",o)}function r(){d.enableDisconnect&&t.disconnectScope(c)}function o(){d.enableDisconnect&&t.reconnectScope(c)}if(d){var c=d.enableDisconnect?n.compileScope.$new():n.compileScope;return a.html(n.template),e(a.contents())(c),a.on("DOMSubtreeModified",function(){d.updatePagination(),d.updateInkBarStyles()}),t.nextTick(i)}}return{restrict:"A",link:n,scope:{template:"=mdTabsTemplate",connected:"=?mdConnectedIf",compileScope:"=mdScope"},require:"^?mdTabs"}}goog.provide("ng.material.components.tabs"),goog.require("ng.material.components.icon"),goog.require("ng.material.core"),angular.module("material.components.tabs",["material.core","material.components.icon"]),angular.module("material.components.tabs").directive("mdTab",MdTab),angular.module("material.components.tabs").directive("mdTabItem",MdTabItem),angular.module("material.components.tabs").directive("mdTabLabel",MdTabLabel),angular.module("material.components.tabs").directive("mdTabScroll",MdTabScroll),MdTabScroll.$inject=["$parse"],angular.module("material.components.tabs").controller("MdTabsController",MdTabsController),MdTabsController.$inject=["$scope","$element","$window","$mdConstant","$mdTabInkRipple","$mdUtil","$animateCss","$attrs","$compile","$mdTheming"],angular.module("material.components.tabs").directive("mdTabs",MdTabs),angular.module("material.components.tabs").directive("mdTabsTemplate",MdTabsTemplate),MdTabsTemplate.$inject=["$compile","$mdUtil"],ng.material.components.tabs=angular.module("material.components.tabs");
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v0.9.0-rc1-master-3c0ce9b
*/
/* mixin definition ; sets LTR and RTL within the same style call */
md-input-group.md-THEME_NAME-theme input, md-input-group.md-THEME_NAME-theme textarea {
text-shadow: '{{foreground-shadow}}'; }
md-input-group.md-THEME_NAME-theme input::-webkit-input-placeholder, md-input-group.md-THEME_NAME-theme input::-moz-placeholder, md-input-group.md-THEME_NAME-theme input:-moz-placeholder, md-input-group.md-THEME_NAME-theme input:-ms-input-placeholder, md-input-group.md-THEME_NAME-theme textarea::-webkit-input-placeholder, md-input-group.md-THEME_NAME-theme textarea::-moz-placeholder, md-input-group.md-THEME_NAME-theme textarea:-moz-placeholder, md-input-group.md-THEME_NAME-theme textarea:-ms-input-placeholder {
color: '{{foreground-3}}'; }
md-input-group.md-THEME_NAME-theme label {
text-shadow: '{{foreground-shadow}}';
color: '{{foreground-3}}'; }
md-input-group.md-THEME_NAME-theme input, md-input-group.md-THEME_NAME-theme textarea {
color: '{{foreground-1}}';
border-color: '{{foreground-4}}'; }
md-input-group.md-THEME_NAME-theme.md-input-focused input, md-input-group.md-THEME_NAME-theme.md-input-focused textarea {
border-color: '{{primary-500}}'; }
md-input-group.md-THEME_NAME-theme.md-input-focused label {
color: '{{primary-500}}'; }
md-input-group.md-THEME_NAME-theme.md-input-focused.md-accent input, md-input-group.md-THEME_NAME-theme.md-input-focused.md-accent textarea {
border-color: '{{accent-500}}'; }
md-input-group.md-THEME_NAME-theme.md-input-focused.md-accent label {
color: '{{accent-500}}'; }
md-input-group.md-THEME_NAME-theme.md-input-has-value:not(.md-input-focused) label {
color: '{{foreground-2}}'; }
md-input-group.md-THEME_NAME-theme .md-input[disabled] {
border-bottom-color: '{{foreground-4}}';
color: '{{foreground-3}}'; }
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v0.9.0-rc1-master-3c0ce9b
*/
/* mixin definition ; sets LTR and RTL within the same style call */
md-input-group label, .md-input-group label {
display: block;
font-size: 1.2rem; }
md-input-group textarea, md-input-group input[type="text"], md-input-group input[type="password"], md-input-group input[type="datetime"], md-input-group input[type="datetime-local"], md-input-group input[type="date"], md-input-group input[type="month"], md-input-group input[type="time"], md-input-group input[type="week"], md-input-group input[type="number"], md-input-group input[type="email"], md-input-group input[type="url"], md-input-group input[type="search"], md-input-group input[type="tel"], md-input-group input[type="color"], .md-input-group textarea, .md-input-group input[type="text"], .md-input-group input[type="password"], .md-input-group input[type="datetime"], .md-input-group input[type="datetime-local"], .md-input-group input[type="date"], .md-input-group input[type="month"], .md-input-group input[type="time"], .md-input-group input[type="week"], .md-input-group input[type="number"], .md-input-group input[type="email"], .md-input-group input[type="url"], .md-input-group input[type="search"], .md-input-group input[type="tel"], .md-input-group input[type="color"] {
display: block;
border-width: 0 0 1px 0;
padding-top: 2px;
line-height: 26px;
padding-bottom: 1px; }
md-input-group textarea:focus, md-input-group input[type="text"]:focus, md-input-group input[type="password"]:focus, md-input-group input[type="datetime"]:focus, md-input-group input[type="datetime-local"]:focus, md-input-group input[type="date"]:focus, md-input-group input[type="month"]:focus, md-input-group input[type="time"]:focus, md-input-group input[type="week"]:focus, md-input-group input[type="number"]:focus, md-input-group input[type="email"]:focus, md-input-group input[type="url"]:focus, md-input-group input[type="search"]:focus, md-input-group input[type="tel"]:focus, md-input-group input[type="color"]:focus, .md-input-group textarea:focus, .md-input-group input[type="text"]:focus, .md-input-group input[type="password"]:focus, .md-input-group input[type="datetime"]:focus, .md-input-group input[type="datetime-local"]:focus, .md-input-group input[type="date"]:focus, .md-input-group input[type="month"]:focus, .md-input-group input[type="time"]:focus, .md-input-group input[type="week"]:focus, .md-input-group input[type="number"]:focus, .md-input-group input[type="email"]:focus, .md-input-group input[type="url"]:focus, .md-input-group input[type="search"]:focus, .md-input-group input[type="tel"]:focus, .md-input-group input[type="color"]:focus {
outline: 0; }
md-input-group input, md-input-group textarea, .md-input-group input, .md-input-group textarea {
background: none; }
md-input-group, .md-input-group {
padding-bottom: 2px;
margin: 10px 0 8px 0;
position: relative;
display: block; }
md-input-group label, .md-input-group label {
font-size: 1.6rem;
z-index: 1;
pointer-events: none;
-webkit-font-smoothing: antialiased; }
md-input-group label:hover, .md-input-group label:hover {
cursor: text; }
md-input-group label, .md-input-group label {
-webkit-transform: translate3d(0, 22px, 0);
transform: translate3d(0, 22px, 0);
transition: all 0.15s cubic-bezier(0.35, 0, 0.25, 1);
transition: all 0.15s cubic-bezier(0.35, 0, 0.25, 1);
-webkit-transform-origin: left center;
transform-origin: left center; }
html[dir=rtl] md-input-group label, html[dir=rtl] .md-input-group label {
-webkit-transform-origin: left center;
transform-origin: left center;
-webkit-transform-origin: right center;
transform-origin: right center; }
md-input-group input, md-input-group textarea, .md-input-group input, .md-input-group textarea {
border-bottom-width: 1px;
transition: all 0.15s cubic-bezier(0.35, 0, 0.25, 1); }
md-input-group.md-input-focused label, .md-input-group.md-input-focused label {
-webkit-transform: translate3d(0, 4px, 0) scale(0.75);
transform: translate3d(0, 4px, 0) scale(0.75);
-webkit-transform-origin: left center;
transform-origin: left center; }
html[dir=rtl] md-input-group.md-input-focused label, html[dir=rtl] .md-input-group.md-input-focused label {
-webkit-transform-origin: left center;
transform-origin: left center;
-webkit-transform-origin: right center;
transform-origin: right center; }
md-input-group.md-input-focused input, md-input-group.md-input-focused textarea, .md-input-group.md-input-focused input, .md-input-group.md-input-focused textarea {
border-bottom-width: 2px; }
md-input-group.md-input-focused input, .md-input-group.md-input-focused input {
padding-bottom: 0; }
md-input-group.md-input-has-value label, .md-input-group.md-input-has-value label {
-webkit-transform: translate3d(0, 4px, 0) scale(0.75);
transform: translate3d(0, 4px, 0) scale(0.75);
-webkit-transform-origin: left center;
transform-origin: left center; }
html[dir=rtl] md-input-group.md-input-has-value label, html[dir=rtl] .md-input-group.md-input-has-value label {
-webkit-transform-origin: left center;
transform-origin: left center;
-webkit-transform-origin: right center;
transform-origin: right center; }
md-input-group.md-input-has-value:not(.md-input-focused) label, .md-input-group.md-input-has-value:not(.md-input-focused) label {
-webkit-transform: translate3d(0, 4px, 0) scale(0.75);
transform: translate3d(0, 4px, 0) scale(0.75);
-webkit-transform-origin: left center;
transform-origin: left center; }
html[dir=rtl] md-input-group.md-input-has-value:not(.md-input-focused) label, html[dir=rtl] .md-input-group.md-input-has-value:not(.md-input-focused) label {
-webkit-transform-origin: left center;
transform-origin: left center;
-webkit-transform-origin: right center;
transform-origin: right center; }
md-input-group[disabled] input, md-input-group[disabled] textarea, .md-input-group[disabled] input, .md-input-group[disabled] textarea {
border-bottom-width: 0px; }
md-input-group[disabled] input, md-input-group[disabled] textarea, .md-input-group[disabled] input, .md-input-group[disabled] textarea {
background-size: 3px 1px;
background-position: 0 bottom;
background-size: 2px 1px;
background-repeat: repeat-x;
pointer-events: none; }
md-input-group[disabled] label, .md-input-group[disabled] label {
-webkit-transform: translate3d(0, 4px, 0) scale(0.75);
transform: translate3d(0, 4px, 0) scale(0.75);
-webkit-transform-origin: left center;
transform-origin: left center; }
html[dir=rtl] md-input-group[disabled] label, html[dir=rtl] .md-input-group[disabled] label {
-webkit-transform-origin: left center;
transform-origin: left center;
-webkit-transform-origin: right center;
transform-origin: right center; }
md-input-group[disabled] *:not(.md-input-has-value) label, .md-input-group[disabled] *:not(.md-input-has-value) label {
-webkit-transform: translate3d(0, 22px, 0);
transform: translate3d(0, 22px, 0);
transition: all 0.15s cubic-bezier(0.35, 0, 0.25, 1);
-webkit-transform-origin: left center;
transform-origin: left center; }
html[dir=rtl] md-input-group[disabled] *:not(.md-input-has-value) label, html[dir=rtl] .md-input-group[disabled] *:not(.md-input-has-value) label {
-webkit-transform-origin: left center;
transform-origin: left center;
-webkit-transform-origin: right center;
transform-origin: right center; }
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v0.9.0-rc1-master-3c0ce9b
*/
goog.provide('ng.material.components.textField');
goog.require('ng.material.core');
(function() {
'use strict';
/**
* @ngdoc module
* @name material.components.textField
* @description
* Form
*/
ng.material.components.textField = angular.module('material.components.textField', [
'material.core'
])
.directive('mdInputGroup', mdInputGroupDirective)
.directive('mdInput', mdInputDirective)
.directive('mdTextFloat', mdTextFloatDirective);
function mdTextFloatDirective($mdTheming, $mdUtil, $parse, $log) {
return {
restrict: 'E',
replace: true,
scope : {
fid : '@?mdFid',
label : '@?',
value : '=ngModel'
},
compile : function(element, attr) {
$log.warn('<md-text-float> is deprecated. Please use `<md-input-container>` and `<input>`.' +
'More information at http://material.angularjs.org/#/api/material.components.input/directive/mdInputContainer');
if ( angular.isUndefined(attr.mdFid) ) {
attr.mdFid = $mdUtil.nextUid();
}
return {
pre : function(scope, element, attrs) {
var disabledParsed = $parse(attrs.ngDisabled);
scope.isDisabled = function() {
return disabledParsed(scope.$parent);
};
scope.inputType = attrs.type || "text";
},
post: $mdTheming
};
},
template:
'<md-input-group tabindex="-1">' +
' <label for="{{fid}}" >{{label}}</label>' +
' <md-input id="{{fid}}" ng-disabled="isDisabled()" ng-model="value" type="{{inputType}}"></md-input>' +
'</md-input-group>'
};
}
mdTextFloatDirective.$inject = ["$mdTheming", "$mdUtil", "$parse", "$log"];
function mdInputGroupDirective($log) {
return {
restrict: 'CE',
controller: ['$element', function($element) {
$log.warn('<md-input-group> is deprecated. Please use `<md-input-container>` and `<input>`.' +
'More information at http://material.angularjs.org/#/api/material.components.input/directive/mdInputContainer');
this.setFocused = function(isFocused) {
$element.toggleClass('md-input-focused', !!isFocused);
};
this.setHasValue = function(hasValue) {
$element.toggleClass('md-input-has-value', hasValue );
};
}]
};
}
mdInputGroupDirective.$inject = ["$log"];
function mdInputDirective($mdUtil, $log) {
return {
restrict: 'E',
replace: true,
template: '<input >',
require: ['^?mdInputGroup', '?ngModel'],
link: function(scope, element, attr, ctrls) {
if ( !ctrls[0] ) return;
$log.warn('<md-input> is deprecated. Please use `<md-input-container>` and `<input>`.' +
'More information at http://material.angularjs.org/#/api/material.components.input/directive/mdInputContainer');
var inputGroupCtrl = ctrls[0];
var ngModelCtrl = ctrls[1];
scope.$watch(scope.isDisabled, function(isDisabled) {
element.attr('aria-disabled', !!isDisabled);
element.attr('tabindex', !!isDisabled);
});
element.attr('type', attr.type || element.parent().attr('type') || "text");
// When the input value changes, check if it "has" a value, and
// set the appropriate class on the input group
if (ngModelCtrl) {
//Add a $formatter so we don't use up the render function
ngModelCtrl.$formatters.push(function(value) {
inputGroupCtrl.setHasValue( isNotEmpty(value) );
return value;
});
}
element
.on('input', function() {
inputGroupCtrl.setHasValue( isNotEmpty() );
})
.on('focus', function(e) {
// When the input focuses, add the focused class to the group
inputGroupCtrl.setFocused(true);
})
.on('blur', function(e) {
// When the input blurs, remove the focused class from the group
inputGroupCtrl.setFocused(false);
inputGroupCtrl.setHasValue( isNotEmpty() );
});
scope.$on('$destroy', function() {
inputGroupCtrl.setFocused(false);
inputGroupCtrl.setHasValue(false);
});
function isNotEmpty(value) {
value = angular.isUndefined(value) ? element.val() : value;
return (angular.isDefined(value) && (value!==null) &&
(value.toString().trim() !== ""));
}
}
};
}
mdInputDirective.$inject = ["$mdUtil", "$log"];
})();
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
md-toast.md-THEME_NAME-theme .md-toast-content {
background-color: #323232;
color: '{{background-50}}'; }
md-toast.md-THEME_NAME-theme .md-toast-content .md-button {
color: '{{background-50}}'; }
md-toast.md-THEME_NAME-theme .md-toast-content .md-button.md-highlight {
color: '{{primary-A200}}'; }
md-toast.md-THEME_NAME-theme .md-toast-content .md-button.md-highlight.md-accent {
color: '{{accent-A200}}'; }
md-toast.md-THEME_NAME-theme .md-toast-content .md-button.md-highlight.md-warn {
color: '{{warn-A200}}'; }
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/md-toast.md-THEME_NAME-theme .md-toast-content{background-color:#323232;color:'{{background-50}}'}md-toast.md-THEME_NAME-theme .md-toast-content .md-button{color:'{{background-50}}'}md-toast.md-THEME_NAME-theme .md-toast-content .md-button.md-highlight{color:'{{accent-A200}}'}md-toast.md-THEME_NAME-theme .md-toast-content .md-button.md-highlight.md-primary{color:'{{primary-A200}}'}md-toast.md-THEME_NAME-theme .md-toast-content .md-button.md-highlight.md-warn{color:'{{warn-A200}}'}
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
md-toast {
position: absolute;
z-index: 105;
box-sizing: border-box;
cursor: default;
overflow: hidden;
padding: 8px;
opacity: 1;
transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
/* Transition differently when swiping */
/*
* When the toast doesn't take up the whole screen,
* make it rotate when the user swipes it away
*/ }
md-toast .md-toast-content {
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
height: 0;
max-height: 168px;
max-width: 100%;
min-height: 48px;
padding-left: 24px;
padding-right: 24px;
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
border-radius: 2px;
font-size: 14px;
overflow: hidden;
-webkit-transform: translate3d(0, 0, 0) rotateZ(0deg);
transform: translate3d(0, 0, 0) rotateZ(0deg);
transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); }
md-toast.md-capsule {
border-radius: 24px; }
md-toast.md-capsule .md-toast-content {
border-radius: 24px; }
md-toast.ng-leave-active .md-toast-content {
transition: all 0.3s cubic-bezier(0.55, 0, 0.55, 0.2); }
md-toast.md-swipeleft .md-toast-content, md-toast.md-swiperight .md-toast-content, md-toast.md-swipeup .md-toast-content, md-toast.md-swipedown .md-toast-content {
transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); }
md-toast.ng-enter {
opacity: 0; }
md-toast.ng-enter .md-toast-content {
-webkit-transform: translate3d(0, 100%, 0);
transform: translate3d(0, 100%, 0); }
md-toast.ng-enter.md-top .md-toast-content {
-webkit-transform: translate3d(0, -100%, 0);
transform: translate3d(0, -100%, 0); }
md-toast.ng-enter.ng-enter-active {
opacity: 1; }
md-toast.ng-enter.ng-enter-active .md-toast-content {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0); }
md-toast.ng-leave.ng-leave-active .md-toast-content {
opacity: 0;
-webkit-transform: translate3d(0, 100%, 0);
transform: translate3d(0, 100%, 0); }
md-toast.ng-leave.ng-leave-active.md-swipeup .md-toast-content {
-webkit-transform: translate3d(0, -50%, 0);
transform: translate3d(0, -50%, 0); }
md-toast.ng-leave.ng-leave-active.md-swipedown .md-toast-content {
-webkit-transform: translate3d(0, 50%, 0);
transform: translate3d(0, 50%, 0); }
md-toast.ng-leave.ng-leave-active.md-top .md-toast-content {
-webkit-transform: translate3d(0, -100%, 0);
transform: translate3d(0, -100%, 0); }
md-toast .md-action {
line-height: 19px;
margin-left: 24px;
margin-right: 0;
cursor: pointer;
text-transform: uppercase;
float: right; }
md-toast .md-action.md-button {
min-width: 0; }
@media (max-width: 959px) {
md-toast {
left: 0;
right: 0;
width: 100%;
max-width: 100%;
min-width: 0;
border-radius: 0;
bottom: 0; }
md-toast.ng-leave.ng-leave-active.md-swipeup .md-toast-content {
-webkit-transform: translate3d(0, -50%, 0);
transform: translate3d(0, -50%, 0); }
md-toast.ng-leave.ng-leave-active.md-swipedown .md-toast-content {
-webkit-transform: translate3d(0, 50%, 0);
transform: translate3d(0, 50%, 0); } }
@media (min-width: 960px) {
md-toast {
min-width: 304px;
/*
* When the toast doesn't take up the whole screen,
* make it rotate when the user swipes it away
*/ }
md-toast.md-bottom {
bottom: 0; }
md-toast.md-left {
left: 0; }
md-toast.md-right {
right: 0; }
md-toast.md-top {
top: 0; }
md-toast.ng-leave.ng-leave-active.md-swipeleft .md-toast-content {
-webkit-transform: translate3d(-50%, 0, 0);
transform: translate3d(-50%, 0, 0); }
md-toast.ng-leave.ng-leave-active.md-swiperight .md-toast-content {
-webkit-transform: translate3d(50%, 0, 0);
transform: translate3d(50%, 0, 0); } }
@media (min-width: 1920px) {
md-toast .md-toast-content {
max-width: 568px; } }
@media screen and (-ms-high-contrast: active) {
md-toast {
border: 1px solid #fff; } }
.md-toast-animating {
overflow: hidden !important; }
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
goog.provide('ng.material.components.toast');
goog.require('ng.material.components.button');
goog.require('ng.material.core');
/**
* @ngdoc module
* @name material.components.toast
* @description
* Toast
*/
angular.module('material.components.toast', [
'material.core',
'material.components.button'
])
.directive('mdToast', MdToastDirective)
.provider('$mdToast', MdToastProvider);
/* ngInject */
function MdToastDirective($mdToast) {
return {
restrict: 'E',
link: function postLink(scope, element, attr) {
// When navigation force destroys an interimElement, then
// listen and $destroy() that interim instance...
scope.$on('$destroy', function() {
$mdToast.destroy();
});
}
};
}
MdToastDirective.$inject = ["$mdToast"];
/**
* @ngdoc service
* @name $mdToast
* @module material.components.toast
*
* @description
* `$mdToast` is a service to build a toast notification on any position
* on the screen with an optional duration, and provides a simple promise API.
*
*
* ## Restrictions on custom toasts
* - The toast's template must have an outer `<md-toast>` element.
* - For a toast action, use element with class `md-action`.
* - Add the class `md-capsule` for curved corners.
*
* ## Parent container notes
*
* The toast is positioned using absolute positioning relative to it's first non-static parent
* container. Thus, if the requested parent container uses static positioning, we will temporarily
* set it's positioning to `relative` while the toast is visible and reset it when the toast is
* hidden.
*
* Because of this, it is usually best to ensure that the parent container has a fixed height and
* prevents scrolling by setting the `overflow: hidden;` style. Since the position is based off of
* the parent's height, the toast may be mispositioned if you allow the parent to scroll.
*
* You can, however, have a scrollable element inside of the container; just make sure the
* container itself does not scroll.
*
* <hljs lang="html">
* <div layout-fill id="toast-container">
* <md-content>
* I can have lots of content and scroll!
* </md-content>
* </div>
* </hljs>
*
* @usage
* <hljs lang="html">
* <div ng-controller="MyController">
* <md-button ng-click="openToast()">
* Open a Toast!
* </md-button>
* </div>
* </hljs>
*
* <hljs lang="js">
* var app = angular.module('app', ['ngMaterial']);
* app.controller('MyController', function($scope, $mdToast) {
* $scope.openToast = function($event) {
* $mdToast.show($mdToast.simple().textContent('Hello!'));
* // Could also do $mdToast.showSimple('Hello');
* };
* });
* </hljs>
*/
/**
* @ngdoc method
* @name $mdToast#showSimple
*
* @param {string} message The message to display inside the toast
* @description
* Convenience method which builds and shows a simple toast.
*
* @returns {promise} A promise that can be resolved with `$mdToast.hide()` or
* rejected with `$mdToast.cancel()`.
*
*/
/**
* @ngdoc method
* @name $mdToast#simple
*
* @description
* Builds a preconfigured toast.
*
* @returns {obj} a `$mdToastPreset` with the following chainable configuration methods.
*
* _**Note:** These configuration methods are provided in addition to the methods provided by
* the `build()` and `show()` methods below._
*
* - `.textContent(string)` - Sets the toast content to the specified string.
*
* - `.action(string)` - Adds an action button. If clicked, the promise (returned from `show()`)
* will resolve with the value `'ok'`; otherwise, it is resolved with `true` after a `hideDelay`
* timeout.
*
* - `.highlightAction(boolean)` - Whether or not the action button will have an additional
* highlight class.
*
* - `.capsule(boolean)` - Whether or not to add the `md-capsule` class to the toast to provide
* rounded corners.
*
* - `.theme(string)` - Sets the theme on the toast to the requested theme. Default is
* `$mdThemingProvider`'s default.
*/
/**
* @ngdoc method
* @name $mdToast#updateTextContent
*
* @description
* Updates the content of an existing toast. Useful for updating things like counts, etc.
*
*/
/**
* @ngdoc method
* @name $mdToast#build
*
* @description
* Creates a custom `$mdToastPreset` that you can configure.
*
* @returns {obj} a `$mdToastPreset` with the chainable configuration methods for shows' options (see below).
*/
/**
* @ngdoc method
* @name $mdToast#show
*
* @description Shows the toast.
*
* @param {object} optionsOrPreset Either provide an `$mdToastPreset` returned from `simple()`
* and `build()`, or an options object with the following properties:
*
* - `templateUrl` - `{string=}`: The url of an html template file that will
* be used as the content of the toast. Restrictions: the template must
* have an outer `md-toast` element.
* - `template` - `{string=}`: Same as templateUrl, except this is an actual
* template string.
* - `autoWrap` - `{boolean=}`: Whether or not to automatically wrap the template content with a
* `<div class="md-toast-content">` if one is not provided. Defaults to true. Can be disabled if you provide a
* custom toast directive.
* - `scope` - `{object=}`: the scope to link the template / controller to. If none is specified, it will create a new child scope.
* This scope will be destroyed when the toast is removed unless `preserveScope` is set to true.
* - `preserveScope` - `{boolean=}`: whether to preserve the scope when the element is removed. Default is false
* - `hideDelay` - `{number=}`: How many milliseconds the toast should stay
* active before automatically closing. Set to 0 or false to have the toast stay open until
* closed manually. Default: 3000.
* - `position` - `{string=}`: Where to place the toast. Available: any combination
* of 'bottom', 'left', 'top', 'right'. Default: 'bottom left'.
* - `controller` - `{string=}`: The controller to associate with this toast.
* The controller will be injected the local `$mdToast.hide( )`, which is a function
* used to hide the toast.
* - `locals` - `{string=}`: An object containing key/value pairs. The keys will
* be used as names of values to inject into the controller. For example,
* `locals: {three: 3}` would inject `three` into the controller with the value
* of 3.
* - `bindToController` - `bool`: bind the locals to the controller, instead of passing them in.
* - `resolve` - `{object=}`: Similar to locals, except it takes promises as values
* and the toast will not open until the promises resolve.
* - `controllerAs` - `{string=}`: An alias to assign the controller to on the scope.
* - `parent` - `{element=}`: The element to append the toast to. Defaults to appending
* to the root element of the application.
*
* @returns {promise} A promise that can be resolved with `$mdToast.hide()` or
* rejected with `$mdToast.cancel()`. `$mdToast.hide()` will resolve either with a Boolean
* value == 'true' or the value passed as an argument to `$mdToast.hide()`.
* And `$mdToast.cancel()` will resolve the promise with a Boolean value == 'false'
*/
/**
* @ngdoc method
* @name $mdToast#hide
*
* @description
* Hide an existing toast and resolve the promise returned from `$mdToast.show()`.
*
* @param {*=} response An argument for the resolved promise.
*
* @returns {promise} a promise that is called when the existing element is removed from the DOM.
* The promise is resolved with either a Boolean value == 'true' or the value passed as the
* argument to `.hide()`.
*
*/
/**
* @ngdoc method
* @name $mdToast#cancel
*
* @description
* `DEPRECATED` - The promise returned from opening a toast is used only to notify about the closing of the toast.
* As such, there isn't any reason to also allow that promise to be rejected,
* since it's not clear what the difference between resolve and reject would be.
*
* Hide the existing toast and reject the promise returned from
* `$mdToast.show()`.
*
* @param {*=} response An argument for the rejected promise.
*
* @returns {promise} a promise that is called when the existing element is removed from the DOM
* The promise is resolved with a Boolean value == 'false'.
*
*/
function MdToastProvider($$interimElementProvider) {
// Differentiate promise resolves: hide timeout (value == true) and hide action clicks (value == ok).
var ACTION_RESOLVE = 'ok';
var activeToastContent;
var $mdToast = $$interimElementProvider('$mdToast')
.setDefaults({
methods: ['position', 'hideDelay', 'capsule', 'parent' ],
options: toastDefaultOptions
})
.addPreset('simple', {
argOption: 'textContent',
methods: ['textContent', 'content', 'action', 'highlightAction', 'theme', 'parent'],
options: /* ngInject */ ["$mdToast", "$mdTheming", function($mdToast, $mdTheming) {
var opts = {
template:
'<md-toast md-theme="{{ toast.theme }}" ng-class="{\'md-capsule\': toast.capsule}">' +
' <div class="md-toast-content">' +
' <span flex role="alert" aria-relevant="all" aria-atomic="true">' +
' {{ toast.content }}' +
' </span>' +
' <md-button class="md-action" ng-if="toast.action" ng-click="toast.resolve()" ng-class="{\'md-highlight\': toast.highlightAction}">' +
' {{ toast.action }}' +
' </md-button>' +
' </div>' +
'</md-toast>',
controller: /* ngInject */ ["$scope", function mdToastCtrl($scope) {
var self = this;
$scope.$watch(function() { return activeToastContent; }, function() {
self.content = activeToastContent;
});
this.resolve = function() {
$mdToast.hide( ACTION_RESOLVE );
};
}],
theme: $mdTheming.defaultTheme(),
controllerAs: 'toast',
bindToController: true
};
return opts;
}]
})
.addMethod('updateTextContent', updateTextContent)
.addMethod('updateContent', updateTextContent);
function updateTextContent(newContent) {
activeToastContent = newContent;
}
toastDefaultOptions.$inject = ["$animate", "$mdToast", "$mdUtil", "$mdMedia"];
return $mdToast;
/* ngInject */
function toastDefaultOptions($animate, $mdToast, $mdUtil, $mdMedia) {
var SWIPE_EVENTS = '$md.swipeleft $md.swiperight $md.swipeup $md.swipedown';
return {
onShow: onShow,
onRemove: onRemove,
position: 'bottom left',
themable: true,
hideDelay: 3000,
autoWrap: true,
transformTemplate: function(template, options) {
var shouldAddWrapper = options.autoWrap && template && !/md-toast-content/g.test(template);
if (shouldAddWrapper) {
// Root element of template will be <md-toast>. We need to wrap all of its content inside of
// of <div class="md-toast-content">. All templates provided here should be static, developer-controlled
// content (meaning we're not attempting to guard against XSS).
var parsedTemplate = angular.element(template);
var wrappedContent = '<div class="md-toast-content">' + parsedTemplate.html() + '</div>';
parsedTemplate.empty().append(wrappedContent);
// Underlying interimElement expects a template string.
return parsedTemplate[0].outerHTML;
}
return shouldAddWrapper ?
'<div class="md-toast-content">' + template + '</div>' :
template || '';
}
};
function onShow(scope, element, options) {
activeToastContent = options.textContent || options.content; // support deprecated #content method
var isSmScreen = !$mdMedia('gt-sm');
element = $mdUtil.extractElementByName(element, 'md-toast', true);
options.onSwipe = function(ev, gesture) {
//Add the relevant swipe class to the element so it can animate correctly
var swipe = ev.type.replace('$md.','');
var direction = swipe.replace('swipe', '');
// If the swipe direction is down/up but the toast came from top/bottom don't fade away
// Unless the screen is small, then the toast always on bottom
if ((direction === 'down' && options.position.indexOf('top') != -1 && !isSmScreen) ||
(direction === 'up' && (options.position.indexOf('bottom') != -1 || isSmScreen))) {
return;
}
if ((direction === 'left' || direction === 'right') && isSmScreen) {
return;
}
element.addClass('md-' + swipe);
$mdUtil.nextTick($mdToast.cancel);
};
options.openClass = toastOpenClass(options.position);
// 'top left' -> 'md-top md-left'
options.parent.addClass(options.openClass);
// static is the default position
if ($mdUtil.hasComputedStyle(options.parent, 'position', 'static')) {
options.parent.css('position', 'relative');
}
element.on(SWIPE_EVENTS, options.onSwipe);
element.addClass(isSmScreen ? 'md-bottom' : options.position.split(' ').map(function(pos) {
return 'md-' + pos;
}).join(' '));
if (options.parent) options.parent.addClass('md-toast-animating');
return $animate.enter(element, options.parent).then(function() {
if (options.parent) options.parent.removeClass('md-toast-animating');
});
}
function onRemove(scope, element, options) {
element.off(SWIPE_EVENTS, options.onSwipe);
if (options.parent) options.parent.addClass('md-toast-animating');
if (options.openClass) options.parent.removeClass(options.openClass);
return ((options.$destroy == true) ? element.remove() : $animate.leave(element))
.then(function () {
if (options.parent) options.parent.removeClass('md-toast-animating');
if ($mdUtil.hasComputedStyle(options.parent, 'position', 'static')) {
options.parent.css('position', '');
}
});
}
function toastOpenClass(position) {
if (!$mdMedia('gt-sm')) {
return 'md-toast-open-bottom';
}
return 'md-toast-open-' +
(position.indexOf('top') > -1 ? 'top' : 'bottom');
}
}
}
MdToastProvider.$inject = ["$$interimElementProvider"];
ng.material.components.toast = angular.module("material.components.toast");
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/.md-toast-text{padding:0 6px}md-toast{position:absolute;z-index:105;box-sizing:border-box;cursor:default;overflow:hidden;padding:8px;opacity:1;transition:all .4s cubic-bezier(.25,.8,.25,1)}md-toast .md-toast-content{display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:0;max-height:168px;max-width:100%;min-height:48px;padding:0 18px;box-shadow:0 2px 5px 0 rgba(0,0,0,.26);border-radius:2px;font-size:14px;overflow:hidden;-webkit-transform:translate3d(0,0,0) rotateZ(0deg);transform:translate3d(0,0,0) rotateZ(0deg);transition:all .4s cubic-bezier(.25,.8,.25,1)}body[dir=ltr] md-toast .md-toast-content,html[dir=ltr] md-toast .md-toast-content{-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start;unicode-bidi:embed}body[dir=rtl] md-toast .md-toast-content,html[dir=rtl] md-toast .md-toast-content{-webkit-justify-content:flex-end;-ms-flex-pack:end;justify-content:flex-end;unicode-bidi:embed}html:not([dir]) body:not([dir]) md-toast .md-toast-content{-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start;unicode-bidi:embed}md-toast .md-toast-content bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}md-toast .md-toast-content bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}md-toast.md-capsule,md-toast.md-capsule .md-toast-content{border-radius:24px}md-toast.ng-leave-active .md-toast-content{transition:all .3s cubic-bezier(.55,0,.55,.2)}md-toast._md-swipedown .md-toast-content,md-toast._md-swipeleft .md-toast-content,md-toast._md-swiperight .md-toast-content,md-toast._md-swipeup .md-toast-content{transition:all .4s cubic-bezier(.25,.8,.25,1)}md-toast.ng-enter{opacity:0}md-toast.ng-enter .md-toast-content{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}md-toast.ng-enter._md-top .md-toast-content{-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}md-toast.ng-enter.ng-enter-active{opacity:1}md-toast.ng-enter.ng-enter-active .md-toast-content{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}md-toast.ng-leave.ng-leave-active .md-toast-content{opacity:0;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}md-toast.ng-leave.ng-leave-active._md-swipeup .md-toast-content{-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}md-toast.ng-leave.ng-leave-active._md-swipedown .md-toast-content{-webkit-transform:translate3d(0,50%,0);transform:translate3d(0,50%,0)}md-toast.ng-leave.ng-leave-active._md-top .md-toast-content{-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}md-toast .md-action{line-height:19px;margin-left:24px;margin-right:0;cursor:pointer;text-transform:uppercase;float:right}md-toast .md-button{min-width:0}body[dir=ltr] md-toast .md-button,html[dir=ltr] md-toast .md-button{margin-right:0}body[dir=rtl] md-toast .md-button,html[dir=rtl] md-toast .md-button{margin-right:12px}html:not([dir]) body:not([dir]) md-toast .md-button{margin-right:0}body[dir=ltr] md-toast .md-button,html[dir=ltr] md-toast .md-button{margin-left:12px;unicode-bidi:embed}body[dir=rtl] md-toast .md-button,html[dir=rtl] md-toast .md-button{margin-left:0;unicode-bidi:embed}html:not([dir]) body:not([dir]) md-toast .md-button{margin-left:12px;unicode-bidi:embed}md-toast .md-button bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}md-toast .md-button bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}@media (max-width:959px){md-toast{left:0;right:0;width:100%;max-width:100%;min-width:0;border-radius:0;bottom:0;padding:0}md-toast.ng-leave.ng-leave-active._md-swipeup .md-toast-content{-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}md-toast.ng-leave.ng-leave-active._md-swipedown .md-toast-content{-webkit-transform:translate3d(0,50%,0);transform:translate3d(0,50%,0)}}@media (min-width:960px){md-toast{min-width:304px}md-toast._md-bottom{bottom:0}md-toast._md-left{left:0}md-toast._md-right{right:0}md-toast._md-top{top:0}md-toast.ng-leave.ng-leave-active._md-swipeleft .md-toast-content{-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}md-toast.ng-leave.ng-leave-active._md-swiperight .md-toast-content{-webkit-transform:translate3d(50%,0,0);transform:translate3d(50%,0,0)}}@media (min-width:1920px){md-toast .md-toast-content{max-width:568px}}@media screen and (-ms-high-contrast:active){md-toast{border:1px solid #fff}}._md-toast-animating{overflow:hidden!important}
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/
function MdToastDirective(t){return{restrict:"E",link:function(e,o,n){e.$on("$destroy",function(){t.destroy()})}}}function MdToastProvider(t){function e(t){n=t}function o(t,e,o,a){function i(i,s,m){n=m.textContent||m.content;var l=!a("gt-sm");return s=o.extractElementByName(s,"md-toast",!0),m.onSwipe=function(t,n){var a=t.type.replace("$md.",""),i=a.replace("swipe","");"down"===i&&-1!=m.position.indexOf("top")&&!l||"up"===i&&(-1!=m.position.indexOf("bottom")||l)||("left"!==i&&"right"!==i||!l)&&(s.addClass("_md-"+a),o.nextTick(e.cancel))},m.openClass=r(m.position),m.parent.addClass(m.openClass),o.hasComputedStyle(m.parent,"position","static")&&m.parent.css("position","relative"),s.on(d,m.onSwipe),s.addClass(l?"_md-bottom":m.position.split(" ").map(function(t){return"_md-"+t}).join(" ")),m.parent&&m.parent.addClass("_md-toast-animating"),t.enter(s,m.parent).then(function(){m.parent&&m.parent.removeClass("_md-toast-animating")})}function s(e,n,a){return n.off(d,a.onSwipe),a.parent&&a.parent.addClass("_md-toast-animating"),a.openClass&&a.parent.removeClass(a.openClass),(1==a.$destroy?n.remove():t.leave(n)).then(function(){a.parent&&a.parent.removeClass("_md-toast-animating"),o.hasComputedStyle(a.parent,"position","static")&&a.parent.css("position","")})}function r(t){return a("gt-xs")?"_md-toast-open-"+(t.indexOf("top")>-1?"top":"bottom"):"_md-toast-open-bottom"}var d="$md.swipeleft $md.swiperight $md.swipeup $md.swipedown";return{onShow:i,onRemove:s,position:"bottom left",themable:!0,hideDelay:3e3,autoWrap:!0,transformTemplate:function(t,e){var o=e.autoWrap&&t&&!/md-toast-content/g.test(t);if(o){var n=angular.element(t),a='<div class="md-toast-content">'+n.html()+"</div>";return n.empty().append(a),n[0].outerHTML}return o?'<div class="md-toast-content">'+t+"</div>":t||""}}}var n,a="ok",i=t("$mdToast").setDefaults({methods:["position","hideDelay","capsule","parent","position"],options:o}).addPreset("simple",{argOption:"textContent",methods:["textContent","content","action","highlightAction","highlightClass","theme","parent"],options:["$mdToast","$mdTheming",function(t,e){return{template:'<md-toast md-theme="{{ toast.theme }}" ng-class="{\'md-capsule\': toast.capsule}"> <div class="md-toast-content"> <span flex class="md-toast-text" role="alert" aria-relevant="all" aria-atomic="true"> {{ toast.content }} </span> <md-button class="md-action" ng-if="toast.action" ng-click="toast.resolve()" ng-class="highlightClasses"> {{ toast.action }} </md-button> </div></md-toast>',controller:["$scope",function(e){var o=this;o.highlightAction&&(e.highlightClasses=["md-highlight",o.highlightClass]),e.$watch(function(){return n},function(){o.content=n}),this.resolve=function(){t.hide(a)}}],theme:e.defaultTheme(),controllerAs:"toast",bindToController:!0}}]}).addMethod("updateTextContent",e).addMethod("updateContent",e);return o.$inject=["$animate","$mdToast","$mdUtil","$mdMedia"],i}goog.provide("ng.material.components.toast"),goog.require("ng.material.components.button"),goog.require("ng.material.core"),angular.module("material.components.toast",["material.core","material.components.button"]).directive("mdToast",MdToastDirective).provider("$mdToast",MdToastProvider),MdToastDirective.$inject=["$mdToast"],MdToastProvider.$inject=["$$interimElementProvider"],ng.material.components.toast=angular.module("material.components.toast");
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
md-toolbar.md-THEME_NAME-theme:not(.md-menu-toolbar) {
background-color: '{{primary-color}}';
color: '{{primary-contrast}}'; }
md-toolbar.md-THEME_NAME-theme:not(.md-menu-toolbar) md-icon {
color: '{{primary-contrast}}'; }
md-toolbar.md-THEME_NAME-theme:not(.md-menu-toolbar) .md-button:not(.md-raised) {
color: '{{primary-contrast}}'; }
md-toolbar.md-THEME_NAME-theme:not(.md-menu-toolbar).md-accent {
background-color: '{{accent-color}}';
color: '{{accent-contrast}}'; }
md-toolbar.md-THEME_NAME-theme:not(.md-menu-toolbar).md-warn {
background-color: '{{warn-color}}';
color: '{{warn-contrast}}'; }
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/md-toolbar.md-THEME_NAME-theme:not(.md-menu-toolbar){background-color:'{{primary-color}}';color:'{{primary-contrast}}'}md-toolbar.md-THEME_NAME-theme:not(.md-menu-toolbar) md-icon{color:'{{primary-contrast}}';fill:'{{primary-contrast}}'}md-toolbar.md-THEME_NAME-theme:not(.md-menu-toolbar).md-accent{background-color:'{{accent-color}}';color:'{{accent-contrast}}'}md-toolbar.md-THEME_NAME-theme:not(.md-menu-toolbar).md-accent .md-ink-ripple{color:'{{accent-contrast}}'}md-toolbar.md-THEME_NAME-theme:not(.md-menu-toolbar).md-accent md-icon{color:'{{accent-contrast}}';fill:'{{accent-contrast}}'}md-toolbar.md-THEME_NAME-theme:not(.md-menu-toolbar).md-warn{background-color:'{{warn-color}}';color:'{{warn-contrast}}'}
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
md-toolbar {
box-sizing: border-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
position: relative;
z-index: 2;
font-size: 20px;
min-height: 64px;
width: 100%; }
md-toolbar.md-whiteframe-z1-add, md-toolbar.md-whiteframe-z1-remove {
transition: box-shadow 0.5s linear; }
md-toolbar md-toolbar-filler {
width: 72px; }
md-toolbar *,
md-toolbar *:before,
md-toolbar *:after {
box-sizing: border-box; }
md-toolbar.md-tall {
height: 128px;
min-height: 128px;
max-height: 128px; }
md-toolbar.md-medium-tall {
height: 88px;
min-height: 88px;
max-height: 88px; }
md-toolbar.md-medium-tall .md-toolbar-tools {
height: 48px;
min-height: 48px;
max-height: 48px; }
md-toolbar > .md-indent {
margin-left: 64px; }
md-toolbar ~ md-content > md-list {
padding: 0; }
md-toolbar ~ md-content > md-list md-list-item:last-child md-divider {
display: none; }
.md-toolbar-tools {
font-size: 20px;
letter-spacing: 0.005em;
box-sizing: border-box;
font-weight: 400;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
width: 100%;
height: 64px;
max-height: 64px;
padding: 0 16px;
margin: 0; }
.md-toolbar-tools h1, .md-toolbar-tools h2, .md-toolbar-tools h3 {
font-size: inherit;
font-weight: inherit;
margin: inherit; }
.md-toolbar-tools a {
color: inherit;
text-decoration: none; }
.md-toolbar-tools .fill-height {
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center; }
.md-toolbar-tools .md-button {
margin-top: 0;
margin-bottom: 0; }
.md-toolbar-tools > .md-button:first-child {
margin-left: -8px; }
.md-toolbar-tools > .md-button:last-child {
margin-right: -8px; }
.md-toolbar-tools > md-menu:last-child {
margin-right: -8px; }
.md-toolbar-tools > md-menu:last-child > .md-button {
margin-right: 0; }
@media screen and (-ms-high-contrast: active) {
.md-toolbar-tools {
border-bottom: 1px solid #fff; } }
@media only screen and (min-width: 0) and (max-width: 959px) and (orientation: portrait) {
md-toolbar {
min-height: 56px; }
.md-toolbar-tools {
height: 56px;
max-height: 56px; } }
@media only screen and (min-width: 0) and (max-width: 959px) and (orientation: landscape) {
md-toolbar {
min-height: 48px; }
.md-toolbar-tools {
height: 48px;
max-height: 48px; } }
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
goog.provide('ng.material.components.toolbar');
goog.require('ng.material.components.content');
goog.require('ng.material.core');
/**
* @ngdoc module
* @name material.components.toolbar
*/
angular.module('material.components.toolbar', [
'material.core',
'material.components.content'
])
.directive('mdToolbar', mdToolbarDirective);
/**
* @ngdoc directive
* @name mdToolbar
* @module material.components.toolbar
* @restrict E
* @description
* `md-toolbar` is used to place a toolbar in your app.
*
* Toolbars are usually used above a content area to display the title of the
* current page, and show relevant action buttons for that page.
*
* You can change the height of the toolbar by adding either the
* `md-medium-tall` or `md-tall` class to the toolbar.
*
* @usage
* <hljs lang="html">
* <div layout="column" layout-fill>
* <md-toolbar>
*
* <div class="md-toolbar-tools">
* <span>My App's Title</span>
*
* <!-- fill up the space between left and right area -->
* <span flex></span>
*
* <md-button>
* Right Bar Button
* </md-button>
* </div>
*
* </md-toolbar>
* <md-content>
* Hello!
* </md-content>
* </div>
* </hljs>
*
* @param {boolean=} md-scroll-shrink Whether the header should shrink away as
* the user scrolls down, and reveal itself as the user scrolls up.
*
* _**Note (1):** for scrollShrink to work, the toolbar must be a sibling of a
* `md-content` element, placed before it. See the scroll shrink demo._
*
* _**Note (2):** The `md-scroll-shrink` attribute is only parsed on component
* initialization, it does not watch for scope changes._
*
*
* @param {number=} md-shrink-speed-factor How much to change the speed of the toolbar's
* shrinking by. For example, if 0.25 is given then the toolbar will shrink
* at one fourth the rate at which the user scrolls down. Default 0.5.
*/
function mdToolbarDirective($$rAF, $mdConstant, $mdUtil, $mdTheming, $animate) {
var translateY = angular.bind(null, $mdUtil.supplant, 'translate3d(0,{0}px,0)');
return {
template: '',
restrict: 'E',
link: function(scope, element, attr) {
$mdTheming(element);
if (angular.isDefined(attr.mdScrollShrink)) {
setupScrollShrink();
}
function setupScrollShrink() {
var toolbarHeight;
var contentElement;
var disableScrollShrink = angular.noop;
// Current "y" position of scroll
// Store the last scroll top position
var y = 0;
var prevScrollTop = 0;
var shrinkSpeedFactor = attr.mdShrinkSpeedFactor || 0.5;
var debouncedContentScroll = $$rAF.throttle(onContentScroll);
var debouncedUpdateHeight = $mdUtil.debounce(updateToolbarHeight, 5 * 1000);
// Wait for $mdContentLoaded event from mdContent directive.
// If the mdContent element is a sibling of our toolbar, hook it up
// to scroll events.
scope.$on('$mdContentLoaded', onMdContentLoad);
// If the toolbar is used inside an ng-if statement, we may miss the
// $mdContentLoaded event, so we attempt to fake it if we have a
// md-content close enough.
attr.$observe('mdScrollShrink', onChangeScrollShrink);
// If the toolbar has ngShow or ngHide we need to update height immediately as it changed
// and not wait for $mdUtil.debounce to happen
if (attr.ngShow) { scope.$watch(attr.ngShow, updateToolbarHeight); }
if (attr.ngHide) { scope.$watch(attr.ngHide, updateToolbarHeight); }
// If the scope is destroyed (which could happen with ng-if), make sure
// to disable scroll shrinking again
scope.$on('$destroy', disableScrollShrink);
/**
*
*/
function onChangeScrollShrink(shrinkWithScroll) {
var closestContent = element.parent().find('md-content');
// If we have a content element, fake the call; this might still fail
// if the content element isn't a sibling of the toolbar
if (!contentElement && closestContent.length) {
onMdContentLoad(null, closestContent);
}
// Evaluate the expression
shrinkWithScroll = scope.$eval(shrinkWithScroll);
// Disable only if the attribute's expression evaluates to false
if (shrinkWithScroll === false) {
disableScrollShrink();
} else {
disableScrollShrink = enableScrollShrink();
}
}
/**
*
*/
function onMdContentLoad($event, newContentEl) {
// Toolbar and content must be siblings
if (newContentEl && element.parent()[0] === newContentEl.parent()[0]) {
// unhook old content event listener if exists
if (contentElement) {
contentElement.off('scroll', debouncedContentScroll);
}
contentElement = newContentEl;
disableScrollShrink = enableScrollShrink();
}
}
/**
*
*/
function onContentScroll(e) {
var scrollTop = e ? e.target.scrollTop : prevScrollTop;
debouncedUpdateHeight();
y = Math.min(
toolbarHeight / shrinkSpeedFactor,
Math.max(0, y + scrollTop - prevScrollTop)
);
element.css($mdConstant.CSS.TRANSFORM, translateY([-y * shrinkSpeedFactor]));
contentElement.css($mdConstant.CSS.TRANSFORM, translateY([(toolbarHeight - y) * shrinkSpeedFactor]));
prevScrollTop = scrollTop;
$mdUtil.nextTick(function() {
var hasWhiteFrame = element.hasClass('md-whiteframe-z1');
if (hasWhiteFrame && !y) {
$animate.removeClass(element, 'md-whiteframe-z1');
} else if (!hasWhiteFrame && y) {
$animate.addClass(element, 'md-whiteframe-z1');
}
});
}
/**
*
*/
function enableScrollShrink() {
if (!contentElement) return angular.noop; // no md-content
contentElement.on('scroll', debouncedContentScroll);
contentElement.attr('scroll-shrink', 'true');
$$rAF(updateToolbarHeight);
return function disableScrollShrink() {
contentElement.off('scroll', debouncedContentScroll);
contentElement.attr('scroll-shrink', 'false');
$$rAF(updateToolbarHeight);
}
}
/**
*
*/
function updateToolbarHeight() {
toolbarHeight = element.prop('offsetHeight');
// Add a negative margin-top the size of the toolbar to the content el.
// The content will start transformed down the toolbarHeight amount,
// so everything looks normal.
//
// As the user scrolls down, the content will be transformed up slowly
// to put the content underneath where the toolbar was.
var margin = (-toolbarHeight * shrinkSpeedFactor) + 'px';
contentElement.css({
"margin-top": margin,
"margin-bottom": margin
});
onContentScroll();
}
}
}
};
}
mdToolbarDirective.$inject = ["$$rAF", "$mdConstant", "$mdUtil", "$mdTheming", "$animate"];
ng.material.components.toolbar = angular.module("material.components.toolbar");
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/md-toolbar{box-sizing:border-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;position:relative;z-index:2;font-size:20px;min-height:64px;width:100%;transition:all .5s cubic-bezier(.35,0,.25,1);transition-property:background-color,fill,color}md-toolbar.md-whiteframe-z1-add,md-toolbar.md-whiteframe-z1-remove{transition:box-shadow .5s linear}md-toolbar md-toolbar-filler{width:72px}md-toolbar *,md-toolbar :after,md-toolbar :before{box-sizing:border-box}md-toolbar.md-tall{height:128px;min-height:128px;max-height:128px}md-toolbar.md-medium-tall{height:88px;min-height:88px;max-height:88px}md-toolbar.md-medium-tall .md-toolbar-tools{height:48px;min-height:48px;max-height:48px}body[dir=ltr] md-toolbar>.md-indent,html[dir=ltr] md-toolbar>.md-indent{margin-left:64px;unicode-bidi:embed}body[dir=rtl] md-toolbar>.md-indent,html[dir=rtl] md-toolbar>.md-indent{margin-right:64px;unicode-bidi:embed}html:not([dir]) body:not([dir]) md-toolbar>.md-indent{margin-left:64px;unicode-bidi:embed}md-toolbar>.md-indent bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}md-toolbar>.md-indent bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}md-toolbar~md-content>md-list{padding:0}md-toolbar~md-content>md-list md-list-item:last-child md-divider{display:none}.md-toolbar-tools{font-size:20px;letter-spacing:.005em;box-sizing:border-box;font-weight:400;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;width:100%;height:64px;max-height:64px;padding:0 16px;margin:0}.md-toolbar-tools h1,.md-toolbar-tools h2,.md-toolbar-tools h3{font-size:inherit;font-weight:inherit;margin:inherit}.md-toolbar-tools a{color:inherit;text-decoration:none}.md-toolbar-tools .fill-height{display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-ms-flex-align:center;align-items:center}.md-toolbar-tools .md-button{margin-top:0;margin-bottom:0}.md-toolbar-tools .md-button,.md-toolbar-tools .md-button.md-icon-button md-icon{transition:all .5s cubic-bezier(.35,0,.25,1);transition-property:background-color,fill,color}body[dir=ltr] .md-toolbar-tools>.md-button:first-child,html[dir=ltr] .md-toolbar-tools>.md-button:first-child{margin-left:-8px;unicode-bidi:embed}body[dir=rtl] .md-toolbar-tools>.md-button:first-child,html[dir=rtl] .md-toolbar-tools>.md-button:first-child{margin-right:-8px;unicode-bidi:embed}html:not([dir]) body:not([dir]) .md-toolbar-tools>.md-button:first-child{margin-left:-8px;unicode-bidi:embed}.md-toolbar-tools>.md-button:first-child bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}.md-toolbar-tools>.md-button:first-child bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}body[dir=ltr] .md-toolbar-tools>.md-button:last-child,html[dir=ltr] .md-toolbar-tools>.md-button:last-child{margin-right:-8px;unicode-bidi:embed}body[dir=rtl] .md-toolbar-tools>.md-button:last-child,html[dir=rtl] .md-toolbar-tools>.md-button:last-child{margin-left:-8px;unicode-bidi:embed}html:not([dir]) body:not([dir]) .md-toolbar-tools>.md-button:last-child{margin-right:-8px;unicode-bidi:embed}.md-toolbar-tools>.md-button:last-child bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}.md-toolbar-tools>.md-button:last-child bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}body[dir=ltr] .md-toolbar-tools>md-menu:last-child,html[dir=ltr] .md-toolbar-tools>md-menu:last-child{margin-right:-8px;unicode-bidi:embed}body[dir=rtl] .md-toolbar-tools>md-menu:last-child,html[dir=rtl] .md-toolbar-tools>md-menu:last-child{margin-left:-8px;unicode-bidi:embed}html:not([dir]) body:not([dir]) .md-toolbar-tools>md-menu:last-child{margin-right:-8px;unicode-bidi:embed}.md-toolbar-tools>md-menu:last-child bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}.md-toolbar-tools>md-menu:last-child bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}body[dir=ltr] .md-toolbar-tools>md-menu:last-child>.md-button,html[dir=ltr] .md-toolbar-tools>md-menu:last-child>.md-button{margin-right:0;unicode-bidi:embed}body[dir=rtl] .md-toolbar-tools>md-menu:last-child>.md-button,html[dir=rtl] .md-toolbar-tools>md-menu:last-child>.md-button{margin-left:0;unicode-bidi:embed}html:not([dir]) body:not([dir]) .md-toolbar-tools>md-menu:last-child>.md-button{margin-right:0;unicode-bidi:embed}.md-toolbar-tools>md-menu:last-child>.md-button bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}.md-toolbar-tools>md-menu:last-child>.md-button bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}@media screen and (-ms-high-contrast:active){.md-toolbar-tools{border-bottom:1px solid #fff}}@media (min-width:0) and (max-width:959px) and (orientation:portrait){md-toolbar{min-height:56px}.md-toolbar-tools{height:56px;max-height:56px}}@media (min-width:0) and (max-width:959px) and (orientation:landscape){md-toolbar{min-height:48px}.md-toolbar-tools{height:48px;max-height:48px}}
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/
function mdToolbarDirective(n,o,t,r,e){var a=angular.bind(null,t.supplant,"translate3d(0,{0}px,0)");return{template:"",restrict:"E",link:function(l,i,c){function m(){function r(n){var o=i.parent().find("md-content");!f&&o.length&&m(null,o),n=l.$eval(n),n===!1?p():p=d()}function m(n,o){o&&i.parent()[0]===o.parent()[0]&&(f&&f.off("scroll",S),f=o,p=d())}function s(n){var r=n?n.target.scrollTop:$;b(),h=Math.min(g/v,Math.max(0,h+r-$)),i.css(o.CSS.TRANSFORM,a([-h*v])),f.css(o.CSS.TRANSFORM,a([(g-h)*v])),$=r,t.nextTick(function(){var n=i.hasClass("md-whiteframe-z1");n&&!h?e.removeClass(i,"md-whiteframe-z1"):!n&&h&&e.addClass(i,"md-whiteframe-z1")})}function d(){return f?(f.on("scroll",S),f.attr("scroll-shrink","true"),n(u),function(){f.off("scroll",S),f.attr("scroll-shrink","false"),n(u)}):angular.noop}function u(){g=i.prop("offsetHeight");var n=-g*v+"px";f.css({"margin-top":n,"margin-bottom":n}),s()}var g,f,p=angular.noop,h=0,$=0,v=c.mdShrinkSpeedFactor||.5,S=n.throttle(s),b=t.debounce(u,5e3);l.$on("$mdContentLoaded",m),c.$observe("mdScrollShrink",r),c.ngShow&&l.$watch(c.ngShow,u),c.ngHide&&l.$watch(c.ngHide,u),l.$on("$destroy",p)}r(i),angular.isDefined(c.mdScrollShrink)&&m()}}}goog.provide("ng.material.components.toolbar"),goog.require("ng.material.components.content"),goog.require("ng.material.core"),angular.module("material.components.toolbar",["material.core","material.components.content"]).directive("mdToolbar",mdToolbarDirective),mdToolbarDirective.$inject=["$$rAF","$mdConstant","$mdUtil","$mdTheming","$animate"],ng.material.components.toolbar=angular.module("material.components.toolbar");
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
md-tooltip.md-THEME_NAME-theme {
color: '{{background-A100}}'; }
md-tooltip.md-THEME_NAME-theme .md-content {
background-color: '{{foreground-2}}'; }
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/md-tooltip.md-THEME_NAME-theme{color:'{{background-A100}}'}md-tooltip.md-THEME_NAME-theme ._md-content{background-color:'{{foreground-2}}'}
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
md-tooltip {
position: absolute;
z-index: 100;
overflow: hidden;
pointer-events: none;
border-radius: 4px;
font-weight: 500;
font-size: 14px; }
@media screen and (min-width: 960px) {
md-tooltip {
font-size: 10px; } }
md-tooltip .md-content {
position: relative;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
-webkit-transform-origin: center top;
transform-origin: center top;
-webkit-transform: scale(0);
transform: scale(0);
opacity: 0;
height: 32px;
line-height: 32px;
padding-left: 16px;
padding-right: 16px; }
@media screen and (min-width: 960px) {
md-tooltip .md-content {
height: 22px;
line-height: 22px;
padding-left: 8px;
padding-right: 8px; } }
md-tooltip .md-content.md-show-add {
transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
transition-duration: .2s;
-webkit-transform: scale(0);
transform: scale(0);
opacity: 0; }
md-tooltip .md-content.md-show, md-tooltip .md-content.md-show-add-active {
-webkit-transform: scale(1);
transform: scale(1);
opacity: 1;
-webkit-transform-origin: center top;
transform-origin: center top; }
md-tooltip .md-content.md-show-remove {
transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
transition-duration: .2s; }
md-tooltip .md-content.md-show-remove.md-show-remove-active {
-webkit-transform: scale(0);
transform: scale(0);
opacity: 0; }
md-tooltip.md-hide {
transition: all 0.3s cubic-bezier(0.55, 0, 0.55, 0.2); }
md-tooltip.md-show {
transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
pointer-events: auto;
will-change: opacity, height, width; }
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
goog.provide('ng.material.components.tooltip');
goog.require('ng.material.core');
/**
* @ngdoc module
* @name material.components.tooltip
*/
angular
.module('material.components.tooltip', [ 'material.core' ])
.directive('mdTooltip', MdTooltipDirective);
/**
* @ngdoc directive
* @name mdTooltip
* @module material.components.tooltip
* @description
* Tooltips are used to describe elements that are interactive and primarily graphical (not textual).
*
* Place a `<md-tooltip>` as a child of the element it describes.
*
* A tooltip will activate when the user focuses, hovers over, or touches the parent.
*
* @usage
* <hljs lang="html">
* <md-button class="md-fab md-accent" aria-label="Play">
* <md-tooltip>
* Play Music
* </md-tooltip>
* <md-icon icon="img/icons/ic_play_arrow_24px.svg"></md-icon>
* </md-button>
* </hljs>
*
* @param {expression=} md-visible Boolean bound to whether the tooltip is currently visible.
* @param {number=} md-delay How many milliseconds to wait to show the tooltip after the user focuses, hovers, or touches the parent. Defaults to 300ms.
* @param {boolean=} md-autohide If present or provided with a boolean value, the tooltip will hide on mouse leave, regardless of focus
* @param {string=} md-direction Which direction would you like the tooltip to go? Supports left, right, top, and bottom. Defaults to bottom.
*/
function MdTooltipDirective($timeout, $window, $$rAF, $document, $mdUtil, $mdTheming, $rootElement,
$animate, $q) {
var TOOLTIP_SHOW_DELAY = 0;
var TOOLTIP_WINDOW_EDGE_SPACE = 8;
return {
restrict: 'E',
transclude: true,
priority:210, // Before ngAria
template: '<div class="md-content" ng-transclude></div>',
scope: {
delay: '=?mdDelay',
visible: '=?mdVisible',
autohide: '=?mdAutohide',
direction: '@?mdDirection' // only expect raw or interpolated string value; not expression
},
link: postLink
};
function postLink(scope, element, attr) {
$mdTheming(element);
var parent = $mdUtil.getParentWithPointerEvents(element),
content = angular.element(element[0].getElementsByClassName('md-content')[0]),
tooltipParent = angular.element(document.body),
debouncedOnResize = $$rAF.throttle(function () { updatePosition(); });
if ($animate.pin) $animate.pin(element, parent);
// Initialize element
setDefaults();
manipulateElement();
bindEvents();
// Default origin transform point is 'center top'
// positionTooltip() is always relative to center top
updateContentOrigin();
configureWatchers();
addAriaLabel();
function setDefaults () {
if (!angular.isDefined(attr.mdDelay)) scope.delay = TOOLTIP_SHOW_DELAY;
}
function updateContentOrigin() {
var origin = 'center top';
switch (scope.direction) {
case 'left' : origin = 'right center'; break;
case 'right' : origin = 'left center'; break;
case 'top' : origin = 'center bottom'; break;
case 'bottom': origin = 'center top'; break;
}
content.css('transform-origin', origin);
}
function configureWatchers () {
scope.$on('$destroy', function() {
scope.visible = false;
element.remove();
angular.element($window).off('resize', debouncedOnResize);
});
scope.$watch('visible', function (isVisible) {
if (isVisible) showTooltip();
else hideTooltip();
});
scope.$watch('direction', updatePosition );
}
function addAriaLabel () {
if (!parent.attr('aria-label') && !parent.text().trim()) {
parent.attr('aria-label', element.text().trim());
}
}
function manipulateElement () {
element.detach();
element.attr('role', 'tooltip');
}
function bindEvents () {
var mouseActive = false;
var ngWindow = angular.element($window);
// add an mutationObserver when there is support for it
// and the need for it in the form of viable host(parent[0])
if (parent[0] && 'MutationObserver' in $window) {
// use an mutationObserver to tackle #2602
var attributeObserver = new MutationObserver(function(mutations) {
mutations
.forEach(function (mutation) {
if (mutation.attributeName === 'disabled' && parent[0].disabled) {
setVisible(false);
scope.$digest(); // make sure the elements gets updated
}
});
});
attributeObserver.observe(parent[0], { attributes: true});
}
// Store whether the element was focused when the window loses focus.
var windowBlurHandler = function() {
elementFocusedOnWindowBlur = document.activeElement === parent[0];
};
var elementFocusedOnWindowBlur = false;
function windowScrollHandler() {
setVisible(false);
}
ngWindow.on('blur', windowBlurHandler);
ngWindow.on('resize', debouncedOnResize);
document.addEventListener('scroll', windowScrollHandler, true);
scope.$on('$destroy', function() {
ngWindow.off('blur', windowBlurHandler);
ngWindow.off('resize', debouncedOnResize);
document.removeEventListener('scroll', windowScrollHandler, true);
attributeObserver && attributeObserver.disconnect();
});
var enterHandler = function(e) {
// Prevent the tooltip from showing when the window is receiving focus.
if (e.type === 'focus' && elementFocusedOnWindowBlur) {
elementFocusedOnWindowBlur = false;
return;
}
parent.on('blur mouseleave touchend touchcancel', leaveHandler );
setVisible(true);
};
var leaveHandler = function () {
var autohide = scope.hasOwnProperty('autohide') ? scope.autohide : attr.hasOwnProperty('mdAutohide');
if (autohide || mouseActive || ($document[0].activeElement !== parent[0]) ) {
parent.off('blur mouseleave touchend touchcancel', leaveHandler );
parent.triggerHandler("blur");
setVisible(false);
}
mouseActive = false;
};
// to avoid `synthetic clicks` we listen to mousedown instead of `click`
parent.on('mousedown', function() { mouseActive = true; });
parent.on('focus mouseenter touchstart', enterHandler );
}
function setVisible (value) {
setVisible.value = !!value;
if (!setVisible.queued) {
if (value) {
setVisible.queued = true;
$timeout(function() {
scope.visible = setVisible.value;
setVisible.queued = false;
}, scope.delay);
} else {
$mdUtil.nextTick(function() { scope.visible = false; });
}
}
}
function showTooltip() {
// Insert the element before positioning it, so we can get the position
// and check if we should display it
tooltipParent.append(element);
// Check if we should display it or not.
// This handles hide-* and show-* along with any user defined css
if ( $mdUtil.hasComputedStyle(element, 'display', 'none')) {
scope.visible = false;
element.detach();
return;
}
updatePosition();
angular.forEach([element, content], function (element) {
$animate.addClass(element, 'md-show');
});
}
function hideTooltip() {
var promises = [];
angular.forEach([element, content], function (it) {
if (it.parent() && it.hasClass('md-show')) {
promises.push($animate.removeClass(it, 'md-show'));
}
});
$q.all(promises)
.then(function () {
if (!scope.visible) element.detach();
});
}
function updatePosition() {
if ( !scope.visible ) return;
updateContentOrigin();
positionTooltip();
}
function positionTooltip() {
var tipRect = $mdUtil.offsetRect(element, tooltipParent);
var parentRect = $mdUtil.offsetRect(parent, tooltipParent);
var newPosition = getPosition(scope.direction);
var offsetParent = element.prop('offsetParent');
// If the user provided a direction, just nudge the tooltip onto the screen
// Otherwise, recalculate based on 'top' since default is 'bottom'
if (scope.direction) {
newPosition = fitInParent(newPosition);
} else if (offsetParent && newPosition.top > offsetParent.scrollHeight - tipRect.height - TOOLTIP_WINDOW_EDGE_SPACE) {
newPosition = fitInParent(getPosition('top'));
}
element.css({
left: newPosition.left + 'px',
top: newPosition.top + 'px'
});
function fitInParent (pos) {
var newPosition = { left: pos.left, top: pos.top };
newPosition.left = Math.min( newPosition.left, tooltipParent.prop('scrollWidth') - tipRect.width - TOOLTIP_WINDOW_EDGE_SPACE );
newPosition.left = Math.max( newPosition.left, TOOLTIP_WINDOW_EDGE_SPACE );
newPosition.top = Math.min( newPosition.top, tooltipParent.prop('scrollHeight') - tipRect.height - TOOLTIP_WINDOW_EDGE_SPACE );
newPosition.top = Math.max( newPosition.top, TOOLTIP_WINDOW_EDGE_SPACE );
return newPosition;
}
function getPosition (dir) {
return dir === 'left'
? { left: parentRect.left - tipRect.width - TOOLTIP_WINDOW_EDGE_SPACE,
top: parentRect.top + parentRect.height / 2 - tipRect.height / 2 }
: dir === 'right'
? { left: parentRect.left + parentRect.width + TOOLTIP_WINDOW_EDGE_SPACE,
top: parentRect.top + parentRect.height / 2 - tipRect.height / 2 }
: dir === 'top'
? { left: parentRect.left + parentRect.width / 2 - tipRect.width / 2,
top: parentRect.top - tipRect.height - TOOLTIP_WINDOW_EDGE_SPACE }
: { left: parentRect.left + parentRect.width / 2 - tipRect.width / 2,
top: parentRect.top + parentRect.height + TOOLTIP_WINDOW_EDGE_SPACE };
}
}
}
}
MdTooltipDirective.$inject = ["$timeout", "$window", "$$rAF", "$document", "$mdUtil", "$mdTheming", "$rootElement", "$animate", "$q"];
ng.material.components.tooltip = angular.module("material.components.tooltip");
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/md-tooltip{position:absolute;z-index:100;overflow:hidden;pointer-events:none;border-radius:4px;font-weight:500;font-size:14px}@media (min-width:960px){md-tooltip{font-size:10px}}md-tooltip ._md-content{position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;-webkit-transform-origin:center top;transform-origin:center top;-webkit-transform:scale(0);transform:scale(0);opacity:0;height:32px;line-height:32px;padding-left:16px;padding-right:16px}@media (min-width:960px){md-tooltip ._md-content{height:22px;line-height:22px;padding-left:8px;padding-right:8px}}md-tooltip ._md-content._md-show-add{transition:all .4s cubic-bezier(.25,.8,.25,1);transition-duration:.2s;-webkit-transform:scale(0);transform:scale(0);opacity:0}md-tooltip ._md-content._md-show,md-tooltip ._md-content._md-show-add-active{-webkit-transform:scale(1);transform:scale(1);opacity:1;-webkit-transform-origin:center top;transform-origin:center top}md-tooltip ._md-content._md-show-remove{transition:all .4s cubic-bezier(.25,.8,.25,1);transition-duration:.2s}md-tooltip ._md-content._md-show-remove._md-show-remove-active{-webkit-transform:scale(0);transform:scale(0);opacity:0}md-tooltip._md-hide{transition:all .3s cubic-bezier(.55,0,.55,.2)}md-tooltip._md-show{transition:all .4s cubic-bezier(.25,.8,.25,1);pointer-events:auto;will-change:opacity,height,width}
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/
function MdTooltipDirective(t,e,o,n,i,r,a,l,c){function u(a,u,f){function h(){a.delay=a.delay||d}function m(){var t="center top";switch(a.direction){case"left":t="right center";break;case"right":t="left center";break;case"top":t="center bottom";break;case"bottom":t="center top"}T.css("transform-origin",t)}function p(){a.$on("$destroy",function(){a.visible=!1,u.remove(),angular.element(e).off("resize",q)}),a.$watch("visible",function(t){t?$():y()}),a.$watch("direction",E)}function v(){x.attr("aria-label")||x.text().trim()||x.attr("aria-label",u.text().trim())}function g(){u.detach(),u.attr("role","tooltip")}function b(){function t(){w(!1)}var o=!1,i=angular.element(e);if(x[0]&&"MutationObserver"in e){var r=new MutationObserver(function(t){t.forEach(function(t){"disabled"===t.attributeName&&x[0].disabled&&(w(!1),a.$digest())})});r.observe(x[0],{attributes:!0})}var l=function(){c=document.activeElement===x[0]},c=!1;i.on("blur",l),i.on("resize",q),document.addEventListener("scroll",t,!0),a.$on("$destroy",function(){i.off("blur",l),i.off("resize",q),document.removeEventListener("scroll",t,!0),r&&r.disconnect()});var u=function(t){return"focus"===t.type&&c?void(c=!1):(x.on("blur mouseleave touchend touchcancel",d),void w(!0))},d=function(){var t=a.hasOwnProperty("autohide")?a.autohide:f.hasOwnProperty("mdAutohide");(t||o||n[0].activeElement!==x[0])&&(x.off("blur mouseleave touchend touchcancel",d),x.triggerHandler("blur"),w(!1)),o=!1};x.on("mousedown",function(){o=!0}),x.on("focus mouseenter touchstart",u)}function w(e){w.value=!!e,w.queued||(e?(w.queued=!0,t(function(){a.visible=w.value,w.queued=!1},a.delay)):i.nextTick(function(){a.visible=!1}))}function $(){return k.append(u),i.hasComputedStyle(u,"display","none")?(a.visible=!1,void u.detach()):(E(),void angular.forEach([u,T],function(t){l.addClass(t,"_md-show")}))}function y(){var t=[];angular.forEach([u,T],function(e){e.parent()&&e.hasClass("_md-show")&&t.push(l.removeClass(e,"_md-show"))}),c.all(t).then(function(){a.visible||u.detach()})}function E(){a.visible&&(m(),M())}function M(){function t(t){var e={left:t.left,top:t.top};return e.left=Math.min(e.left,k.prop("scrollWidth")-o.width-s),e.left=Math.max(e.left,s),e.top=Math.min(e.top,k.prop("scrollHeight")-o.height-s),e.top=Math.max(e.top,s),e}function e(t){return"left"===t?{left:n.left-o.width-s,top:n.top+n.height/2-o.height/2}:"right"===t?{left:n.left+n.width+s,top:n.top+n.height/2-o.height/2}:"top"===t?{left:n.left+n.width/2-o.width/2,top:n.top-o.height-s}:{left:n.left+n.width/2-o.width/2,top:n.top+n.height+s}}var o=i.offsetRect(u,k),n=i.offsetRect(x,k),r=e(a.direction),l=u.prop("offsetParent");a.direction?r=t(r):l&&r.top>l.scrollHeight-o.height-s&&(r=t(e("top"))),u.css({left:r.left+"px",top:r.top+"px"})}r(u);var x=i.getParentWithPointerEvents(u),T=angular.element(u[0].getElementsByClassName("_md-content")[0]),k=angular.element(document.body),q=o.throttle(function(){E()});l.pin&&l.pin(u,x),h(),g(),b(),m(),p(),v()}var d=0,s=8;return{restrict:"E",transclude:!0,priority:210,template:'<div class="_md-content" ng-transclude></div>',scope:{delay:"=?mdDelay",visible:"=?mdVisible",autohide:"=?mdAutohide",direction:"@?mdDirection"},link:u}}goog.provide("ng.material.components.tooltip"),goog.require("ng.material.core"),angular.module("material.components.tooltip",["material.core"]).directive("mdTooltip",MdTooltipDirective),MdTooltipDirective.$inject=["$timeout","$window","$$rAF","$document","$mdUtil","$mdTheming","$rootElement","$animate","$q"],ng.material.components.tooltip=angular.module("material.components.tooltip");
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
.md-virtual-repeat-container {
box-sizing: border-box;
display: block;
margin: 0;
overflow: hidden;
padding: 0;
position: relative; }
.md-virtual-repeat-container .md-virtual-repeat-scroller {
bottom: 0;
box-sizing: border-box;
left: 0;
margin: 0;
overflow-x: hidden;
padding: 0;
position: absolute;
right: 0;
top: 0; }
.md-virtual-repeat-container .md-virtual-repeat-sizer {
box-sizing: border-box;
height: 1px;
display: block;
margin: 0;
padding: 0;
width: 1px; }
.md-virtual-repeat-container .md-virtual-repeat-offsetter {
box-sizing: border-box;
left: 0;
margin: 0;
padding: 0;
position: absolute;
right: 0;
top: 0; }
.md-virtual-repeat-container.md-orient-horizontal .md-virtual-repeat-scroller {
overflow-x: auto;
overflow-y: hidden; }
.md-virtual-repeat-container.md-orient-horizontal .md-virtual-repeat-offsetter {
bottom: 16px;
right: auto;
white-space: nowrap; }
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
goog.provide('ng.material.components.virtualRepeat');
goog.require('ng.material.components.showHide');
goog.require('ng.material.core');
/**
* @ngdoc module
* @name material.components.virtualRepeat
*/
angular.module('material.components.virtualRepeat', [
'material.core',
'material.components.showHide'
])
.directive('mdVirtualRepeatContainer', VirtualRepeatContainerDirective)
.directive('mdVirtualRepeat', VirtualRepeatDirective);
/**
* @ngdoc directive
* @name mdVirtualRepeatContainer
* @module material.components.virtualRepeat
* @restrict E
* @description
* `md-virtual-repeat-container` provides the scroll container for md-virtual-repeat.
*
* Virtual repeat is a limited substitute for ng-repeat that renders only
* enough dom nodes to fill the container and recycling them as the user scrolls.
*
* @usage
* <hljs lang="html">
*
* <md-virtual-repeat-container md-top-index="topIndex">
* <div md-virtual-repeat="i in items" md-item-size="20">Hello {{i}}!</div>
* </md-virtual-repeat-container>
* </hljs>
*
* @param {number=} md-top-index Binds the index of the item that is at the top of the scroll
* container to $scope. It can both read and set the scroll position.
* @param {boolean=} md-orient-horizontal Whether the container should scroll horizontally
* (defaults to orientation and scrolling vertically).
* @param {boolean=} md-auto-shrink When present, the container will shrink to fit
* the number of items when that number is less than its original size.
* @param {number=} md-auto-shrink-min Minimum number of items that md-auto-shrink
* will shrink to (default: 0).
*/
function VirtualRepeatContainerDirective() {
return {
controller: VirtualRepeatContainerController,
template: virtualRepeatContainerTemplate,
compile: function virtualRepeatContainerCompile($element, $attrs) {
$element
.addClass('md-virtual-repeat-container')
.addClass($attrs.hasOwnProperty('mdOrientHorizontal')
? 'md-orient-horizontal'
: 'md-orient-vertical');
}
};
}
function virtualRepeatContainerTemplate($element) {
return '<div class="md-virtual-repeat-scroller">' +
'<div class="md-virtual-repeat-sizer"></div>' +
'<div class="md-virtual-repeat-offsetter">' +
$element[0].innerHTML +
'</div></div>';
}
/**
* Maximum size, in pixels, that can be explicitly set to an element. The actual value varies
* between browsers, but IE11 has the very lowest size at a mere 1,533,917px. Ideally we could
* *compute* this value, but Firefox always reports an element to have a size of zero if it
* goes over the max, meaning that we'd have to binary search for the value.
* @const {number}
*/
var MAX_ELEMENT_SIZE = 1533917;
/**
* Number of additional elements to render above and below the visible area inside
* of the virtual repeat container. A higher number results in less flicker when scrolling
* very quickly in Safari, but comes with a higher rendering and dirty-checking cost.
* @const {number}
*/
var NUM_EXTRA = 3;
/** ngInject */
function VirtualRepeatContainerController(
$$rAF, $mdUtil, $parse, $rootScope, $window, $scope, $element, $attrs) {
this.$rootScope = $rootScope;
this.$scope = $scope;
this.$element = $element;
this.$attrs = $attrs;
/** @type {number} The width or height of the container */
this.size = 0;
/** @type {number} The scroll width or height of the scroller */
this.scrollSize = 0;
/** @type {number} The scrollLeft or scrollTop of the scroller */
this.scrollOffset = 0;
/** @type {boolean} Whether the scroller is oriented horizontally */
this.horizontal = this.$attrs.hasOwnProperty('mdOrientHorizontal');
/** @type {!VirtualRepeatController} The repeater inside of this container */
this.repeater = null;
/** @type {boolean} Whether auto-shrink is enabled */
this.autoShrink = this.$attrs.hasOwnProperty('mdAutoShrink');
/** @type {number} Minimum number of items to auto-shrink to */
this.autoShrinkMin = parseInt(this.$attrs.mdAutoShrinkMin, 10) || 0;
/** @type {?number} Original container size when shrank */
this.originalSize = null;
/** @type {number} Amount to offset the total scroll size by. */
this.offsetSize = parseInt(this.$attrs.mdOffsetSize, 10) || 0;
/** @type {?string} height or width element style on the container prior to auto-shrinking. */
this.oldElementSize = null;
if (this.$attrs.mdTopIndex) {
/** @type {function(angular.Scope): number} Binds to topIndex on Angular scope */
this.bindTopIndex = $parse(this.$attrs.mdTopIndex);
/** @type {number} The index of the item that is at the top of the scroll container */
this.topIndex = this.bindTopIndex(this.$scope);
if (!angular.isDefined(this.topIndex)) {
this.topIndex = 0;
this.bindTopIndex.assign(this.$scope, 0);
}
this.$scope.$watch(this.bindTopIndex, angular.bind(this, function(newIndex) {
if (newIndex !== this.topIndex) {
this.scrollToIndex(newIndex);
}
}));
} else {
this.topIndex = 0;
}
this.scroller = $element[0].getElementsByClassName('md-virtual-repeat-scroller')[0];
this.sizer = this.scroller.getElementsByClassName('md-virtual-repeat-sizer')[0];
this.offsetter = this.scroller.getElementsByClassName('md-virtual-repeat-offsetter')[0];
// After the dom stablizes, measure the initial size of the container and
// make a best effort at re-measuring as it changes.
var boundUpdateSize = angular.bind(this, this.updateSize);
$$rAF(angular.bind(this, function() {
boundUpdateSize();
var debouncedUpdateSize = $mdUtil.debounce(boundUpdateSize, 10, null, false);
var jWindow = angular.element($window);
// Make one more attempt to get the size if it is 0.
// This is not by any means a perfect approach, but there's really no
// silver bullet here.
if (!this.size) {
debouncedUpdateSize();
}
jWindow.on('resize', debouncedUpdateSize);
$scope.$on('$destroy', function() {
jWindow.off('resize', debouncedUpdateSize);
});
$scope.$emit('$md-resize-enable');
$scope.$on('$md-resize', boundUpdateSize);
}));
}
VirtualRepeatContainerController.$inject = ["$$rAF", "$mdUtil", "$parse", "$rootScope", "$window", "$scope", "$element", "$attrs"];
/** Called by the md-virtual-repeat inside of the container at startup. */
VirtualRepeatContainerController.prototype.register = function(repeaterCtrl) {
this.repeater = repeaterCtrl;
angular.element(this.scroller)
.on('scroll wheel touchmove touchend', angular.bind(this, this.handleScroll_));
};
/** @return {boolean} Whether the container is configured for horizontal scrolling. */
VirtualRepeatContainerController.prototype.isHorizontal = function() {
return this.horizontal;
};
/** @return {number} The size (width or height) of the container. */
VirtualRepeatContainerController.prototype.getSize = function() {
return this.size;
};
/**
* Resizes the container.
* @private
* @param {number} The new size to set.
*/
VirtualRepeatContainerController.prototype.setSize_ = function(size) {
var dimension = this.getDimensionName_();
this.size = size;
this.$element[0].style[dimension] = size + 'px';
};
VirtualRepeatContainerController.prototype.unsetSize_ = function() {
this.$element[0].style[this.getDimensionName_()] = this.oldElementSize;
this.oldElementSize = null;
};
/** Instructs the container to re-measure its size. */
VirtualRepeatContainerController.prototype.updateSize = function() {
if (this.originalSize) return;
this.size = this.isHorizontal()
? this.$element[0].clientWidth
: this.$element[0].clientHeight;
// Recheck the scroll position after updating the size. This resolves
// problems that can result if the scroll position was measured while the
// element was display: none or detached from the document.
this.handleScroll_();
this.repeater && this.repeater.containerUpdated();
};
/** @return {number} The container's scrollHeight or scrollWidth. */
VirtualRepeatContainerController.prototype.getScrollSize = function() {
return this.scrollSize;
};
VirtualRepeatContainerController.prototype.getDimensionName_ = function() {
return this.isHorizontal() ? 'width' : 'height';
};
/**
* Sets the scroller element to the specified size.
* @private
* @param {number} size The new size.
*/
VirtualRepeatContainerController.prototype.sizeScroller_ = function(size) {
var dimension = this.getDimensionName_();
var crossDimension = this.isHorizontal() ? 'height' : 'width';
// Clear any existing dimensions.
this.sizer.innerHTML = '';
// If the size falls within the browser's maximum explicit size for a single element, we can
// set the size and be done. Otherwise, we have to create children that add up the the desired
// size.
if (size < MAX_ELEMENT_SIZE) {
this.sizer.style[dimension] = size + 'px';
} else {
this.sizer.style[dimension] = 'auto';
this.sizer.style[crossDimension] = 'auto';
// Divide the total size we have to render into N max-size pieces.
var numChildren = Math.floor(size / MAX_ELEMENT_SIZE);
// Element template to clone for each max-size piece.
var sizerChild = document.createElement('div');
sizerChild.style[dimension] = MAX_ELEMENT_SIZE + 'px';
sizerChild.style[crossDimension] = '1px';
for (var i = 0; i < numChildren; i++) {
this.sizer.appendChild(sizerChild.cloneNode(false));
}
// Re-use the element template for the remainder.
sizerChild.style[dimension] = (size - (numChildren * MAX_ELEMENT_SIZE)) + 'px';
this.sizer.appendChild(sizerChild);
}
};
/**
* If auto-shrinking is enabled, shrinks or unshrinks as appropriate.
* @private
* @param {number} size The new size.
*/
VirtualRepeatContainerController.prototype.autoShrink_ = function(size) {
var shrinkSize = Math.max(size, this.autoShrinkMin * this.repeater.getItemSize());
if (this.autoShrink && shrinkSize !== this.size) {
if (this.oldElementSize === null) {
this.oldElementSize = this.$element[0].style[this.getDimensionName_()];
}
var currentSize = this.originalSize || this.size;
if (!currentSize || shrinkSize < currentSize) {
if (!this.originalSize) {
this.originalSize = this.size;
}
this.setSize_(shrinkSize);
} else if (this.originalSize !== null) {
this.unsetSize_();
this.originalSize = null;
this.updateSize();
}
this.repeater.containerUpdated();
}
};
/**
* Sets the scrollHeight or scrollWidth. Called by the repeater based on
* its item count and item size.
* @param {number} itemsSize The total size of the items.
*/
VirtualRepeatContainerController.prototype.setScrollSize = function(itemsSize) {
var size = itemsSize + this.offsetSize;
if (this.scrollSize === size) return;
this.sizeScroller_(size);
this.autoShrink_(size);
this.scrollSize = size;
};
/** @return {number} The container's current scroll offset. */
VirtualRepeatContainerController.prototype.getScrollOffset = function() {
return this.scrollOffset;
};
/**
* Scrolls to a given scrollTop position.
* @param {number} position
*/
VirtualRepeatContainerController.prototype.scrollTo = function(position) {
this.scroller[this.isHorizontal() ? 'scrollLeft' : 'scrollTop'] = position;
this.handleScroll_();
};
/**
* Scrolls the item with the given index to the top of the scroll container.
* @param {number} index
*/
VirtualRepeatContainerController.prototype.scrollToIndex = function(index) {
var itemSize = this.repeater.getItemSize();
var itemsLength = this.repeater.itemsLength;
if(index > itemsLength) {
index = itemsLength - 1;
}
this.scrollTo(itemSize * index);
};
VirtualRepeatContainerController.prototype.resetScroll = function() {
this.scrollTo(0);
};
VirtualRepeatContainerController.prototype.handleScroll_ = function() {
var offset = this.isHorizontal() ? this.scroller.scrollLeft : this.scroller.scrollTop;
if (offset === this.scrollOffset || offset > this.scrollSize - this.size) return;
var itemSize = this.repeater.getItemSize();
if (!itemSize) return;
var numItems = Math.max(0, Math.floor(offset / itemSize) - NUM_EXTRA);
var transform = (this.isHorizontal() ? 'translateX(' : 'translateY(') +
(numItems * itemSize) + 'px)';
this.scrollOffset = offset;
this.offsetter.style.webkitTransform = transform;
this.offsetter.style.transform = transform;
if (this.bindTopIndex) {
var topIndex = Math.floor(offset / itemSize);
if (topIndex !== this.topIndex && topIndex < this.repeater.getItemCount()) {
this.topIndex = topIndex;
this.bindTopIndex.assign(this.$scope, topIndex);
if (!this.$rootScope.$$phase) this.$scope.$digest();
}
}
this.repeater.containerUpdated();
};
/**
* @ngdoc directive
* @name mdVirtualRepeat
* @module material.components.virtualRepeat
* @restrict A
* @priority 1000
* @description
* `md-virtual-repeat` specifies an element to repeat using virtual scrolling.
*
* Virtual repeat is a limited substitute for ng-repeat that renders only
* enough dom nodes to fill the container and recycling them as the user scrolls.
* Arrays, but not objects are supported for iteration.
* Track by, as alias, and (key, value) syntax are not supported.
*
* @usage
* <hljs lang="html">
* <md-virtual-repeat-container>
* <div md-virtual-repeat="i in items">Hello {{i}}!</div>
* </md-virtual-repeat-container>
*
* <md-virtual-repeat-container md-orient-horizontal>
* <div md-virtual-repeat="i in items" md-item-size="20">Hello {{i}}!</div>
* </md-virtual-repeat-container>
* </hljs>
*
* @param {number=} md-item-size The height or width of the repeated elements (which must be
* identical for each element). Optional. Will attempt to read the size from the dom if missing,
* but still assumes that all repeated nodes have same height or width.
* @param {string=} md-extra-name Evaluates to an additional name to which the current iterated item
* can be assigned on the repeated scope (needed for use in `md-autocomplete`).
* @param {boolean=} md-on-demand When present, treats the md-virtual-repeat argument as an object
* that can fetch rows rather than an array.
*
* **NOTE:** This object must implement the following interface with two (2) methods:
*
* - `getItemAtIndex: function(index) [object]` The item at that index or null if it is not yet
* loaded (it should start downloading the item in that case).
* - `getLength: function() [number]` The data length to which the repeater container
* should be sized. Ideally, when the count is known, this method should return it.
* Otherwise, return a higher number than the currently loaded items to produce an
* infinite-scroll behavior.
*/
function VirtualRepeatDirective($parse) {
return {
controller: VirtualRepeatController,
priority: 1000,
require: ['mdVirtualRepeat', '^^mdVirtualRepeatContainer'],
restrict: 'A',
terminal: true,
transclude: 'element',
compile: function VirtualRepeatCompile($element, $attrs) {
var expression = $attrs.mdVirtualRepeat;
var match = expression.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)\s*$/);
var repeatName = match[1];
var repeatListExpression = $parse(match[2]);
var extraName = $attrs.mdExtraName && $parse($attrs.mdExtraName);
return function VirtualRepeatLink($scope, $element, $attrs, ctrl, $transclude) {
ctrl[0].link_(ctrl[1], $transclude, repeatName, repeatListExpression, extraName);
};
}
};
}
VirtualRepeatDirective.$inject = ["$parse"];
/** ngInject */
function VirtualRepeatController($scope, $element, $attrs, $browser, $document, $rootScope,
$$rAF) {
this.$scope = $scope;
this.$element = $element;
this.$attrs = $attrs;
this.$browser = $browser;
this.$document = $document;
this.$rootScope = $rootScope;
this.$$rAF = $$rAF;
/** @type {boolean} Whether we are in on-demand mode. */
this.onDemand = $attrs.hasOwnProperty('mdOnDemand');
/** @type {!Function} Backup reference to $browser.$$checkUrlChange */
this.browserCheckUrlChange = $browser.$$checkUrlChange;
/** @type {number} Most recent starting repeat index (based on scroll offset) */
this.newStartIndex = 0;
/** @type {number} Most recent ending repeat index (based on scroll offset) */
this.newEndIndex = 0;
/** @type {number} Most recent end visible index (based on scroll offset) */
this.newVisibleEnd = 0;
/** @type {number} Previous starting repeat index (based on scroll offset) */
this.startIndex = 0;
/** @type {number} Previous ending repeat index (based on scroll offset) */
this.endIndex = 0;
// TODO: measure width/height of first element from dom if not provided.
// getComputedStyle?
/** @type {?number} Height/width of repeated elements. */
this.itemSize = $scope.$eval($attrs.mdItemSize) || null;
/** @type {boolean} Whether this is the first time that items are rendered. */
this.isFirstRender = true;
/**
* @private {boolean} Whether the items in the list are already being updated. Used to prevent
* nested calls to virtualRepeatUpdate_.
*/
this.isVirtualRepeatUpdating_ = false;
/** @type {number} Most recently seen length of items. */
this.itemsLength = 0;
/**
* @type {!Function} Unwatch callback for item size (when md-items-size is
* not specified), or angular.noop otherwise.
*/
this.unwatchItemSize_ = angular.noop;
/**
* Presently rendered blocks by repeat index.
* @type {Object<number, !VirtualRepeatController.Block}
*/
this.blocks = {};
/** @type {Array<!VirtualRepeatController.Block>} A pool of presently unused blocks. */
this.pooledBlocks = [];
}
VirtualRepeatController.$inject = ["$scope", "$element", "$attrs", "$browser", "$document", "$rootScope", "$$rAF"];
/**
* An object representing a repeated item.
* @typedef {{element: !jqLite, new: boolean, scope: !angular.Scope}}
*/
VirtualRepeatController.Block;
/**
* Called at startup by the md-virtual-repeat postLink function.
* @param {!VirtualRepeatContainerController} container The container's controller.
* @param {!Function} transclude The repeated element's bound transclude function.
* @param {string} repeatName The left hand side of the repeat expression, indicating
* the name for each item in the array.
* @param {!Function} repeatListExpression A compiled expression based on the right hand side
* of the repeat expression. Points to the array to repeat over.
* @param {string|undefined} extraName The optional extra repeatName.
*/
VirtualRepeatController.prototype.link_ =
function(container, transclude, repeatName, repeatListExpression, extraName) {
this.container = container;
this.transclude = transclude;
this.repeatName = repeatName;
this.rawRepeatListExpression = repeatListExpression;
this.extraName = extraName;
this.sized = false;
this.repeatListExpression = angular.bind(this, this.repeatListExpression_);
this.container.register(this);
};
/** @private Attempts to set itemSize by measuring a repeated element in the dom */
VirtualRepeatController.prototype.readItemSize_ = function() {
if (this.itemSize) {
// itemSize was successfully read in a different asynchronous call.
return;
}
this.items = this.repeatListExpression(this.$scope);
this.parentNode = this.$element[0].parentNode;
var block = this.getBlock_(0);
if (!block.element[0].parentNode) {
this.parentNode.appendChild(block.element[0]);
}
this.itemSize = block.element[0][
this.container.isHorizontal() ? 'offsetWidth' : 'offsetHeight'] || null;
this.blocks[0] = block;
this.poolBlock_(0);
if (this.itemSize) {
this.containerUpdated();
}
};
/**
* Returns the user-specified repeat list, transforming it into an array-like
* object in the case of infinite scroll/dynamic load mode.
* @param {!angular.Scope} The scope.
* @return {!Array|!Object} An array or array-like object for iteration.
*/
VirtualRepeatController.prototype.repeatListExpression_ = function(scope) {
var repeatList = this.rawRepeatListExpression(scope);
if (this.onDemand && repeatList) {
var virtualList = new VirtualRepeatModelArrayLike(repeatList);
virtualList.$$includeIndexes(this.newStartIndex, this.newVisibleEnd);
return virtualList;
} else {
return repeatList;
}
};
/**
* Called by the container. Informs us that the containers scroll or size has
* changed.
*/
VirtualRepeatController.prototype.containerUpdated = function() {
// If itemSize is unknown, attempt to measure it.
if (!this.itemSize) {
this.unwatchItemSize_ = this.$scope.$watchCollection(
this.repeatListExpression,
angular.bind(this, function(items) {
if (items && items.length) {
this.$$rAF(angular.bind(this, this.readItemSize_));
}
}));
if (!this.$rootScope.$$phase) this.$scope.$digest();
return;
} else if (!this.sized) {
this.items = this.repeatListExpression(this.$scope);
}
if (!this.sized) {
this.unwatchItemSize_();
this.sized = true;
this.$scope.$watchCollection(this.repeatListExpression,
angular.bind(this, function(items, oldItems) {
if (!this.isVirtualRepeatUpdating_) {
this.virtualRepeatUpdate_(items, oldItems);
}
}));
}
this.updateIndexes_();
if (this.newStartIndex !== this.startIndex ||
this.newEndIndex !== this.endIndex ||
this.container.getScrollOffset() > this.container.getScrollSize()) {
if (this.items instanceof VirtualRepeatModelArrayLike) {
this.items.$$includeIndexes(this.newStartIndex, this.newEndIndex);
}
this.virtualRepeatUpdate_(this.items, this.items);
}
};
/**
* Called by the container. Returns the size of a single repeated item.
* @return {?number} Size of a repeated item.
*/
VirtualRepeatController.prototype.getItemSize = function() {
return this.itemSize;
};
/**
* Called by the container. Returns the size of a single repeated item.
* @return {?number} Size of a repeated item.
*/
VirtualRepeatController.prototype.getItemCount = function() {
return this.itemsLength;
};
/**
* Updates the order and visible offset of repeated blocks in response to scrolling
* or items updates.
* @private
*/
VirtualRepeatController.prototype.virtualRepeatUpdate_ = function(items, oldItems) {
this.isVirtualRepeatUpdating_ = true;
var itemsLength = items && items.length || 0;
var lengthChanged = false;
// If the number of items shrank, scroll up to the top.
if (this.items && itemsLength < this.items.length && this.container.getScrollOffset() !== 0) {
this.items = items;
this.container.resetScroll();
return;
}
if (itemsLength !== this.itemsLength) {
lengthChanged = true;
this.itemsLength = itemsLength;
}
this.items = items;
if (items !== oldItems || lengthChanged) {
this.updateIndexes_();
}
this.parentNode = this.$element[0].parentNode;
if (lengthChanged) {
this.container.setScrollSize(itemsLength * this.itemSize);
}
if (this.isFirstRender) {
this.isFirstRender = false;
var startIndex = this.$attrs.mdStartIndex ?
this.$scope.$eval(this.$attrs.mdStartIndex) :
this.container.topIndex;
this.container.scrollToIndex(startIndex);
}
// Detach and pool any blocks that are no longer in the viewport.
Object.keys(this.blocks).forEach(function(blockIndex) {
var index = parseInt(blockIndex, 10);
if (index < this.newStartIndex || index >= this.newEndIndex) {
this.poolBlock_(index);
}
}, this);
// Add needed blocks.
// For performance reasons, temporarily block browser url checks as we digest
// the restored block scopes ($$checkUrlChange reads window.location to
// check for changes and trigger route change, etc, which we don't need when
// trying to scroll at 60fps).
this.$browser.$$checkUrlChange = angular.noop;
var i, block,
newStartBlocks = [],
newEndBlocks = [];
// Collect blocks at the top.
for (i = this.newStartIndex; i < this.newEndIndex && this.blocks[i] == null; i++) {
block = this.getBlock_(i);
this.updateBlock_(block, i);
newStartBlocks.push(block);
}
// Update blocks that are already rendered.
for (; this.blocks[i] != null; i++) {
this.updateBlock_(this.blocks[i], i);
}
var maxIndex = i - 1;
// Collect blocks at the end.
for (; i < this.newEndIndex; i++) {
block = this.getBlock_(i);
this.updateBlock_(block, i);
newEndBlocks.push(block);
}
// Attach collected blocks to the document.
if (newStartBlocks.length) {
this.parentNode.insertBefore(
this.domFragmentFromBlocks_(newStartBlocks),
this.$element[0].nextSibling);
}
if (newEndBlocks.length) {
this.parentNode.insertBefore(
this.domFragmentFromBlocks_(newEndBlocks),
this.blocks[maxIndex] && this.blocks[maxIndex].element[0].nextSibling);
}
// Restore $$checkUrlChange.
this.$browser.$$checkUrlChange = this.browserCheckUrlChange;
this.startIndex = this.newStartIndex;
this.endIndex = this.newEndIndex;
this.isVirtualRepeatUpdating_ = false;
};
/**
* @param {number} index Where the block is to be in the repeated list.
* @return {!VirtualRepeatController.Block} A new or pooled block to place at the specified index.
* @private
*/
VirtualRepeatController.prototype.getBlock_ = function(index) {
if (this.pooledBlocks.length) {
return this.pooledBlocks.pop();
}
var block;
this.transclude(angular.bind(this, function(clone, scope) {
block = {
element: clone,
new: true,
scope: scope
};
this.updateScope_(scope, index);
this.parentNode.appendChild(clone[0]);
}));
return block;
};
/**
* Updates and if not in a digest cycle, digests the specified block's scope to the data
* at the specified index.
* @param {!VirtualRepeatController.Block} block The block whose scope should be updated.
* @param {number} index The index to set.
* @private
*/
VirtualRepeatController.prototype.updateBlock_ = function(block, index) {
this.blocks[index] = block;
if (!block.new &&
(block.scope.$index === index && block.scope[this.repeatName] === this.items[index])) {
return;
}
block.new = false;
// Update and digest the block's scope.
this.updateScope_(block.scope, index);
// Perform digest before reattaching the block.
// Any resulting synchronous dom mutations should be much faster as a result.
// This might break some directives, but I'm going to try it for now.
if (!this.$rootScope.$$phase) {
block.scope.$digest();
}
};
/**
* Updates scope to the data at the specified index.
* @param {!angular.Scope} scope The scope which should be updated.
* @param {number} index The index to set.
* @private
*/
VirtualRepeatController.prototype.updateScope_ = function(scope, index) {
scope.$index = index;
scope[this.repeatName] = this.items && this.items[index];
if (this.extraName) scope[this.extraName(this.$scope)] = this.items[index];
};
/**
* Pools the block at the specified index (Pulls its element out of the dom and stores it).
* @param {number} index The index at which the block to pool is stored.
* @private
*/
VirtualRepeatController.prototype.poolBlock_ = function(index) {
this.pooledBlocks.push(this.blocks[index]);
this.parentNode.removeChild(this.blocks[index].element[0]);
delete this.blocks[index];
};
/**
* Produces a dom fragment containing the elements from the list of blocks.
* @param {!Array<!VirtualRepeatController.Block>} blocks The blocks whose elements
* should be added to the document fragment.
* @return {DocumentFragment}
* @private
*/
VirtualRepeatController.prototype.domFragmentFromBlocks_ = function(blocks) {
var fragment = this.$document[0].createDocumentFragment();
blocks.forEach(function(block) {
fragment.appendChild(block.element[0]);
});
return fragment;
};
/**
* Updates start and end indexes based on length of repeated items and container size.
* @private
*/
VirtualRepeatController.prototype.updateIndexes_ = function() {
var itemsLength = this.items ? this.items.length : 0;
var containerLength = Math.ceil(this.container.getSize() / this.itemSize);
this.newStartIndex = Math.max(0, Math.min(
itemsLength - containerLength,
Math.floor(this.container.getScrollOffset() / this.itemSize)));
this.newVisibleEnd = this.newStartIndex + containerLength + NUM_EXTRA;
this.newEndIndex = Math.min(itemsLength, this.newVisibleEnd);
this.newStartIndex = Math.max(0, this.newStartIndex - NUM_EXTRA);
};
/**
* This VirtualRepeatModelArrayLike class enforces the interface requirements
* for infinite scrolling within a mdVirtualRepeatContainer. An object with this
* interface must implement the following interface with two (2) methods:
*
* getItemAtIndex: function(index) -> item at that index or null if it is not yet
* loaded (It should start downloading the item in that case).
*
* getLength: function() -> number The data legnth to which the repeater container
* should be sized. Ideally, when the count is known, this method should return it.
* Otherwise, return a higher number than the currently loaded items to produce an
* infinite-scroll behavior.
*
* @usage
* <hljs lang="html">
* <md-virtual-repeat-container md-orient-horizontal>
* <div md-virtual-repeat="i in items" md-on-demand>
* Hello {{i}}!
* </div>
* </md-virtual-repeat-container>
* </hljs>
*
*/
function VirtualRepeatModelArrayLike(model) {
if (!angular.isFunction(model.getItemAtIndex) ||
!angular.isFunction(model.getLength)) {
throw Error('When md-on-demand is enabled, the Object passed to md-virtual-repeat must implement ' +
'functions getItemAtIndex() and getLength() ');
}
this.model = model;
}
VirtualRepeatModelArrayLike.prototype.$$includeIndexes = function(start, end) {
for (var i = start; i < end; i++) {
if (!this.hasOwnProperty(i)) {
this[i] = this.model.getItemAtIndex(i);
}
}
this.length = this.model.getLength();
};
function abstractMethod() {
throw Error('Non-overridden abstract method called.');
}
ng.material.components.virtualRepeat = angular.module("material.components.virtualRepeat");
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/.md-virtual-repeat-container{box-sizing:border-box;display:block;margin:0;overflow:hidden;padding:0;position:relative}.md-virtual-repeat-container .md-virtual-repeat-scroller{bottom:0;box-sizing:border-box;left:0;margin:0;overflow-x:hidden;padding:0;position:absolute;right:0;top:0}.md-virtual-repeat-container .md-virtual-repeat-sizer{box-sizing:border-box;height:1px;display:block;margin:0;padding:0;width:1px}.md-virtual-repeat-container .md-virtual-repeat-offsetter{box-sizing:border-box;left:0;margin:0;padding:0;position:absolute;right:0;top:0}.md-virtual-repeat-container.md-orient-horizontal .md-virtual-repeat-scroller{overflow-x:auto;overflow-y:hidden}.md-virtual-repeat-container.md-orient-horizontal .md-virtual-repeat-offsetter{bottom:16px;white-space:nowrap}body[dir=ltr] .md-virtual-repeat-container.md-orient-horizontal .md-virtual-repeat-offsetter,html[dir=ltr] .md-virtual-repeat-container.md-orient-horizontal .md-virtual-repeat-offsetter{right:auto;unicode-bidi:embed}body[dir=rtl] .md-virtual-repeat-container.md-orient-horizontal .md-virtual-repeat-offsetter,html[dir=rtl] .md-virtual-repeat-container.md-orient-horizontal .md-virtual-repeat-offsetter{left:auto;unicode-bidi:embed}html:not([dir]) body:not([dir]) .md-virtual-repeat-container.md-orient-horizontal .md-virtual-repeat-offsetter{right:auto;unicode-bidi:embed}.md-virtual-repeat-container.md-orient-horizontal .md-virtual-repeat-offsetter bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}.md-virtual-repeat-container.md-orient-horizontal .md-virtual-repeat-offsetter bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.5-master-f171fd2
*/
function VirtualRepeatContainerDirective(){return{controller:VirtualRepeatContainerController,template:virtualRepeatContainerTemplate,compile:function(t,e){t.addClass("md-virtual-repeat-container").addClass(e.hasOwnProperty("mdOrientHorizontal")?"md-orient-horizontal":"md-orient-vertical")}}}function virtualRepeatContainerTemplate(t){return'<div class="md-virtual-repeat-scroller"><div class="md-virtual-repeat-sizer"></div><div class="md-virtual-repeat-offsetter">'+t[0].innerHTML+"</div></div>"}function VirtualRepeatContainerController(t,e,i,r,s,n,o,a){this.$rootScope=r,this.$scope=n,this.$element=o,this.$attrs=a,this.size=0,this.scrollSize=0,this.scrollOffset=0,this.horizontal=this.$attrs.hasOwnProperty("mdOrientHorizontal"),this.repeater=null,this.autoShrink=this.$attrs.hasOwnProperty("mdAutoShrink"),this.autoShrinkMin=parseInt(this.$attrs.mdAutoShrinkMin,10)||0,this.originalSize=null,this.offsetSize=parseInt(this.$attrs.mdOffsetSize,10)||0,this.oldElementSize=null,this.$attrs.mdTopIndex?(this.bindTopIndex=i(this.$attrs.mdTopIndex),this.topIndex=this.bindTopIndex(this.$scope),angular.isDefined(this.topIndex)||(this.topIndex=0,this.bindTopIndex.assign(this.$scope,0)),this.$scope.$watch(this.bindTopIndex,angular.bind(this,function(t){t!==this.topIndex&&this.scrollToIndex(t)}))):this.topIndex=0,this.scroller=o[0].getElementsByClassName("md-virtual-repeat-scroller")[0],this.sizer=this.scroller.getElementsByClassName("md-virtual-repeat-sizer")[0],this.offsetter=this.scroller.getElementsByClassName("md-virtual-repeat-offsetter")[0];var l=angular.bind(this,this.updateSize);t(angular.bind(this,function(){l();var t=e.debounce(l,10,null,!1),i=angular.element(s);this.size||t(),i.on("resize",t),n.$on("$destroy",function(){i.off("resize",t)}),n.$emit("$md-resize-enable"),n.$on("$md-resize",l)}))}function VirtualRepeatDirective(t){return{controller:VirtualRepeatController,priority:1e3,require:["mdVirtualRepeat","^^mdVirtualRepeatContainer"],restrict:"A",terminal:!0,transclude:"element",compile:function(e,i){var r=i.mdVirtualRepeat,s=r.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)\s*$/),n=s[1],o=t(s[2]),a=i.mdExtraName&&t(i.mdExtraName);return function(t,e,i,r,s){r[0].link_(r[1],s,n,o,a)}}}}function VirtualRepeatController(t,e,i,r,s,n,o,a){this.$scope=t,this.$element=e,this.$attrs=i,this.$browser=r,this.$document=s,this.$rootScope=n,this.$$rAF=o,this.onDemand=a.parseAttributeBoolean(i.mdOnDemand),this.browserCheckUrlChange=r.$$checkUrlChange,this.newStartIndex=0,this.newEndIndex=0,this.newVisibleEnd=0,this.startIndex=0,this.endIndex=0,this.itemSize=t.$eval(i.mdItemSize)||null,this.isFirstRender=!0,this.isVirtualRepeatUpdating_=!1,this.itemsLength=0,this.unwatchItemSize_=angular.noop,this.blocks={},this.pooledBlocks=[]}function VirtualRepeatModelArrayLike(t){if(!angular.isFunction(t.getItemAtIndex)||!angular.isFunction(t.getLength))throw Error("When md-on-demand is enabled, the Object passed to md-virtual-repeat must implement functions getItemAtIndex() and getLength() ");this.model=t}function abstractMethod(){throw Error("Non-overridden abstract method called.")}goog.provide("ng.material.components.virtualRepeat"),goog.require("ng.material.components.showHide"),goog.require("ng.material.core"),angular.module("material.components.virtualRepeat",["material.core","material.components.showHide"]).directive("mdVirtualRepeatContainer",VirtualRepeatContainerDirective).directive("mdVirtualRepeat",VirtualRepeatDirective);var MAX_ELEMENT_SIZE=1533917,NUM_EXTRA=3;VirtualRepeatContainerController.$inject=["$$rAF","$mdUtil","$parse","$rootScope","$window","$scope","$element","$attrs"],VirtualRepeatContainerController.prototype.register=function(t){this.repeater=t,angular.element(this.scroller).on("scroll wheel touchmove touchend",angular.bind(this,this.handleScroll_))},VirtualRepeatContainerController.prototype.isHorizontal=function(){return this.horizontal},VirtualRepeatContainerController.prototype.getSize=function(){return this.size},VirtualRepeatContainerController.prototype.setSize_=function(t){var e=this.getDimensionName_();this.size=t,this.$element[0].style[e]=t+"px"},VirtualRepeatContainerController.prototype.unsetSize_=function(){this.$element[0].style[this.getDimensionName_()]=this.oldElementSize,this.oldElementSize=null},VirtualRepeatContainerController.prototype.updateSize=function(){this.originalSize||(this.size=this.isHorizontal()?this.$element[0].clientWidth:this.$element[0].clientHeight,this.handleScroll_(),this.repeater&&this.repeater.containerUpdated())},VirtualRepeatContainerController.prototype.getScrollSize=function(){return this.scrollSize},VirtualRepeatContainerController.prototype.getDimensionName_=function(){return this.isHorizontal()?"width":"height"},VirtualRepeatContainerController.prototype.sizeScroller_=function(t){var e=this.getDimensionName_(),i=this.isHorizontal()?"height":"width";if(this.sizer.innerHTML="",MAX_ELEMENT_SIZE>t)this.sizer.style[e]=t+"px";else{this.sizer.style[e]="auto",this.sizer.style[i]="auto";var r=Math.floor(t/MAX_ELEMENT_SIZE),s=document.createElement("div");s.style[e]="1533917px",s.style[i]="1px";for(var n=0;r>n;n++)this.sizer.appendChild(s.cloneNode(!1));s.style[e]=t-r*MAX_ELEMENT_SIZE+"px",this.sizer.appendChild(s)}},VirtualRepeatContainerController.prototype.autoShrink_=function(t){var e=Math.max(t,this.autoShrinkMin*this.repeater.getItemSize());if(this.autoShrink&&e!==this.size){null===this.oldElementSize&&(this.oldElementSize=this.$element[0].style[this.getDimensionName_()]);var i=this.originalSize||this.size;!i||i>e?(this.originalSize||(this.originalSize=this.size),this.setSize_(e)):null!==this.originalSize&&(this.unsetSize_(),this.originalSize=null,this.updateSize()),this.repeater.containerUpdated()}},VirtualRepeatContainerController.prototype.setScrollSize=function(t){var e=t+this.offsetSize;this.scrollSize!==e&&(this.sizeScroller_(e),this.autoShrink_(e),this.scrollSize=e)},VirtualRepeatContainerController.prototype.getScrollOffset=function(){return this.scrollOffset},VirtualRepeatContainerController.prototype.scrollTo=function(t){this.scroller[this.isHorizontal()?"scrollLeft":"scrollTop"]=t,this.handleScroll_()},VirtualRepeatContainerController.prototype.scrollToIndex=function(t){var e=this.repeater.getItemSize(),i=this.repeater.itemsLength;t>i&&(t=i-1),this.scrollTo(e*t)},VirtualRepeatContainerController.prototype.resetScroll=function(){this.scrollTo(0)},VirtualRepeatContainerController.prototype.handleScroll_=function(){var t=angular.element(document)[0],e="rtl"!=t.dir&&"rtl"!=t.body.dir;e||this.maxSize||(this.scroller.scrollLeft=this.scrollSize,this.maxSize=this.scroller.scrollLeft);var i=this.isHorizontal()?e?this.scroller.scrollLeft:this.maxSize-this.scroller.scrollLeft:this.scroller.scrollTop;if(!(i===this.scrollOffset||i>this.scrollSize-this.size)){var r=this.repeater.getItemSize();if(r){var s=Math.max(0,Math.floor(i/r)-NUM_EXTRA),n=(this.isHorizontal()?"translateX(":"translateY(")+(!this.isHorizontal()||e?s*r:-(s*r))+"px)";if(this.scrollOffset=i,this.offsetter.style.webkitTransform=n,this.offsetter.style.transform=n,this.bindTopIndex){var o=Math.floor(i/r);o!==this.topIndex&&o<this.repeater.getItemCount()&&(this.topIndex=o,this.bindTopIndex.assign(this.$scope,o),this.$rootScope.$$phase||this.$scope.$digest())}this.repeater.containerUpdated()}}},VirtualRepeatDirective.$inject=["$parse"],VirtualRepeatController.$inject=["$scope","$element","$attrs","$browser","$document","$rootScope","$$rAF","$mdUtil"],VirtualRepeatController.Block,VirtualRepeatController.prototype.link_=function(t,e,i,r,s){this.container=t,this.transclude=e,this.repeatName=i,this.rawRepeatListExpression=r,this.extraName=s,this.sized=!1,this.repeatListExpression=angular.bind(this,this.repeatListExpression_),this.container.register(this)},VirtualRepeatController.prototype.readItemSize_=function(){if(!this.itemSize){this.items=this.repeatListExpression(this.$scope),this.parentNode=this.$element[0].parentNode;var t=this.getBlock_(0);t.element[0].parentNode||this.parentNode.appendChild(t.element[0]),this.itemSize=t.element[0][this.container.isHorizontal()?"offsetWidth":"offsetHeight"]||null,this.blocks[0]=t,this.poolBlock_(0),this.itemSize&&this.containerUpdated()}},VirtualRepeatController.prototype.repeatListExpression_=function(t){var e=this.rawRepeatListExpression(t);if(this.onDemand&&e){var i=new VirtualRepeatModelArrayLike(e);return i.$$includeIndexes(this.newStartIndex,this.newVisibleEnd),i}return e},VirtualRepeatController.prototype.containerUpdated=function(){return this.itemSize?(this.sized||(this.items=this.repeatListExpression(this.$scope)),this.sized||(this.unwatchItemSize_(),this.sized=!0,this.$scope.$watchCollection(this.repeatListExpression,angular.bind(this,function(t,e){this.isVirtualRepeatUpdating_||this.virtualRepeatUpdate_(t,e)}))),this.updateIndexes_(),void((this.newStartIndex!==this.startIndex||this.newEndIndex!==this.endIndex||this.container.getScrollOffset()>this.container.getScrollSize())&&(this.items instanceof VirtualRepeatModelArrayLike&&this.items.$$includeIndexes(this.newStartIndex,this.newEndIndex),this.virtualRepeatUpdate_(this.items,this.items)))):(this.unwatchItemSize_=this.$scope.$watchCollection(this.repeatListExpression,angular.bind(this,function(t){t&&t.length&&this.$$rAF(angular.bind(this,this.readItemSize_))})),void(this.$rootScope.$$phase||this.$scope.$digest()))},VirtualRepeatController.prototype.getItemSize=function(){return this.itemSize},VirtualRepeatController.prototype.getItemCount=function(){return this.itemsLength},VirtualRepeatController.prototype.virtualRepeatUpdate_=function(t,e){this.isVirtualRepeatUpdating_=!0;var i=t&&t.length||0,r=!1;if(this.items&&i<this.items.length&&0!==this.container.getScrollOffset())return this.items=t,void this.container.resetScroll();if(i!==this.itemsLength&&(r=!0,this.itemsLength=i),this.items=t,(t!==e||r)&&this.updateIndexes_(),this.parentNode=this.$element[0].parentNode,r&&this.container.setScrollSize(i*this.itemSize),this.isFirstRender){this.isFirstRender=!1;var s=this.$attrs.mdStartIndex?this.$scope.$eval(this.$attrs.mdStartIndex):this.container.topIndex;this.container.scrollToIndex(s)}Object.keys(this.blocks).forEach(function(t){var e=parseInt(t,10);(e<this.newStartIndex||e>=this.newEndIndex)&&this.poolBlock_(e)},this),this.$browser.$$checkUrlChange=angular.noop;var n,o,a=[],l=[];for(n=this.newStartIndex;n<this.newEndIndex&&null==this.blocks[n];n++)o=this.getBlock_(n),this.updateBlock_(o,n),a.push(o);for(;null!=this.blocks[n];n++)this.updateBlock_(this.blocks[n],n);for(var h=n-1;n<this.newEndIndex;n++)o=this.getBlock_(n),this.updateBlock_(o,n),l.push(o);a.length&&this.parentNode.insertBefore(this.domFragmentFromBlocks_(a),this.$element[0].nextSibling),l.length&&this.parentNode.insertBefore(this.domFragmentFromBlocks_(l),this.blocks[h]&&this.blocks[h].element[0].nextSibling),this.$browser.$$checkUrlChange=this.browserCheckUrlChange,this.startIndex=this.newStartIndex,this.endIndex=this.newEndIndex,this.isVirtualRepeatUpdating_=!1},VirtualRepeatController.prototype.getBlock_=function(t){if(this.pooledBlocks.length)return this.pooledBlocks.pop();var e;return this.transclude(angular.bind(this,function(i,r){e={element:i,"new":!0,scope:r},this.updateScope_(r,t),this.parentNode.appendChild(i[0])})),e},VirtualRepeatController.prototype.updateBlock_=function(t,e){this.blocks[e]=t,(t["new"]||t.scope.$index!==e||t.scope[this.repeatName]!==this.items[e])&&(t["new"]=!1,this.updateScope_(t.scope,e),this.$rootScope.$$phase||t.scope.$digest())},VirtualRepeatController.prototype.updateScope_=function(t,e){t.$index=e,t[this.repeatName]=this.items&&this.items[e],this.extraName&&(t[this.extraName(this.$scope)]=this.items[e])},VirtualRepeatController.prototype.poolBlock_=function(t){this.pooledBlocks.push(this.blocks[t]),this.parentNode.removeChild(this.blocks[t].element[0]),delete this.blocks[t]},VirtualRepeatController.prototype.domFragmentFromBlocks_=function(t){var e=this.$document[0].createDocumentFragment();return t.forEach(function(t){e.appendChild(t.element[0])}),e},VirtualRepeatController.prototype.updateIndexes_=function(){var t=this.items?this.items.length:0,e=Math.ceil(this.container.getSize()/this.itemSize);this.newStartIndex=Math.max(0,Math.min(t-e,Math.floor(this.container.getScrollOffset()/this.itemSize))),this.newVisibleEnd=this.newStartIndex+e+NUM_EXTRA,this.newEndIndex=Math.min(t,this.newVisibleEnd),this.newStartIndex=Math.max(0,this.newStartIndex-NUM_EXTRA)},VirtualRepeatModelArrayLike.prototype.$$includeIndexes=function(t,e){for(var i=t;e>i;i++)this.hasOwnProperty(i)||(this[i]=this.model.getItemAtIndex(i));this.length=this.model.getLength()},ng.material.components.virtualRepeat=angular.module("material.components.virtualRepeat");
\ No newline at end of file
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
.md-whiteframe-1dp, .md-whiteframe-z1 {
box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.2), 0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 2px 1px -1px rgba(0, 0, 0, 0.12); }
.md-whiteframe-2dp {
box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 3px 1px -2px rgba(0, 0, 0, 0.12); }
.md-whiteframe-3dp {
box-shadow: 0px 1px 8px 0px rgba(0, 0, 0, 0.2), 0px 3px 4px 0px rgba(0, 0, 0, 0.14), 0px 3px 3px -2px rgba(0, 0, 0, 0.12); }
.md-whiteframe-4dp, .md-whiteframe-z2 {
box-shadow: 0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12); }
.md-whiteframe-5dp {
box-shadow: 0px 3px 5px -1px rgba(0, 0, 0, 0.2), 0px 5px 8px 0px rgba(0, 0, 0, 0.14), 0px 1px 14px 0px rgba(0, 0, 0, 0.12); }
.md-whiteframe-6dp {
box-shadow: 0px 3px 5px -1px rgba(0, 0, 0, 0.2), 0px 6px 10px 0px rgba(0, 0, 0, 0.14), 0px 1px 18px 0px rgba(0, 0, 0, 0.12); }
.md-whiteframe-7dp, .md-whiteframe-z3 {
box-shadow: 0px 4px 5px -2px rgba(0, 0, 0, 0.2), 0px 7px 10px 1px rgba(0, 0, 0, 0.14), 0px 2px 16px 1px rgba(0, 0, 0, 0.12); }
.md-whiteframe-8dp {
box-shadow: 0px 5px 5px -3px rgba(0, 0, 0, 0.2), 0px 8px 10px 1px rgba(0, 0, 0, 0.14), 0px 3px 14px 2px rgba(0, 0, 0, 0.12); }
.md-whiteframe-9dp {
box-shadow: 0px 5px 6px -3px rgba(0, 0, 0, 0.2), 0px 9px 12px 1px rgba(0, 0, 0, 0.14), 0px 3px 16px 2px rgba(0, 0, 0, 0.12); }
.md-whiteframe-10dp, .md-whiteframe-z4 {
box-shadow: 0px 6px 6px -3px rgba(0, 0, 0, 0.2), 0px 10px 14px 1px rgba(0, 0, 0, 0.14), 0px 4px 18px 3px rgba(0, 0, 0, 0.12); }
.md-whiteframe-11dp {
box-shadow: 0px 6px 7px -4px rgba(0, 0, 0, 0.2), 0px 11px 15px 1px rgba(0, 0, 0, 0.14), 0px 4px 20px 3px rgba(0, 0, 0, 0.12); }
.md-whiteframe-12dp {
box-shadow: 0px 7px 8px -4px rgba(0, 0, 0, 0.2), 0px 12px 17px 2px rgba(0, 0, 0, 0.14), 0px 5px 22px 4px rgba(0, 0, 0, 0.12); }
.md-whiteframe-13dp, .md-whiteframe-z5 {
box-shadow: 0px 7px 8px -4px rgba(0, 0, 0, 0.2), 0px 13px 19px 2px rgba(0, 0, 0, 0.14), 0px 5px 24px 4px rgba(0, 0, 0, 0.12); }
.md-whiteframe-14dp {
box-shadow: 0px 7px 9px -4px rgba(0, 0, 0, 0.2), 0px 14px 21px 2px rgba(0, 0, 0, 0.14), 0px 5px 26px 4px rgba(0, 0, 0, 0.12); }
.md-whiteframe-15dp {
box-shadow: 0px 8px 9px -5px rgba(0, 0, 0, 0.2), 0px 15px 22px 2px rgba(0, 0, 0, 0.14), 0px 6px 28px 5px rgba(0, 0, 0, 0.12); }
.md-whiteframe-16dp {
box-shadow: 0px 8px 10px -5px rgba(0, 0, 0, 0.2), 0px 16px 24px 2px rgba(0, 0, 0, 0.14), 0px 6px 30px 5px rgba(0, 0, 0, 0.12); }
.md-whiteframe-17dp {
box-shadow: 0px 8px 11px -5px rgba(0, 0, 0, 0.2), 0px 17px 26px 2px rgba(0, 0, 0, 0.14), 0px 6px 32px 5px rgba(0, 0, 0, 0.12); }
.md-whiteframe-18dp {
box-shadow: 0px 9px 11px -5px rgba(0, 0, 0, 0.2), 0px 18px 28px 2px rgba(0, 0, 0, 0.14), 0px 7px 34px 6px rgba(0, 0, 0, 0.12); }
.md-whiteframe-19dp {
box-shadow: 0px 9px 12px -6px rgba(0, 0, 0, 0.2), 0px 19px 29px 2px rgba(0, 0, 0, 0.14), 0px 7px 36px 6px rgba(0, 0, 0, 0.12); }
.md-whiteframe-20dp {
box-shadow: 0px 10px 13px -6px rgba(0, 0, 0, 0.2), 0px 20px 31px 3px rgba(0, 0, 0, 0.14), 0px 8px 38px 7px rgba(0, 0, 0, 0.12); }
.md-whiteframe-21dp {
box-shadow: 0px 10px 13px -6px rgba(0, 0, 0, 0.2), 0px 21px 33px 3px rgba(0, 0, 0, 0.14), 0px 8px 40px 7px rgba(0, 0, 0, 0.12); }
.md-whiteframe-22dp {
box-shadow: 0px 10px 14px -6px rgba(0, 0, 0, 0.2), 0px 22px 35px 3px rgba(0, 0, 0, 0.14), 0px 8px 42px 7px rgba(0, 0, 0, 0.12); }
.md-whiteframe-23dp {
box-shadow: 0px 11px 14px -7px rgba(0, 0, 0, 0.2), 0px 23px 36px 3px rgba(0, 0, 0, 0.14), 0px 9px 44px 8px rgba(0, 0, 0, 0.12); }
.md-whiteframe-24dp {
box-shadow: 0px 11px 15px -7px rgba(0, 0, 0, 0.2), 0px 24px 38px 3px rgba(0, 0, 0, 0.14), 0px 9px 46px 8px rgba(0, 0, 0, 0.12); }
@media screen and (-ms-high-contrast: active) {
md-whiteframe {
border: 1px solid #fff; } }
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6
*/
goog.provide('ng.material.components.whiteframe');
goog.require('ng.material.core');
/**
* @ngdoc module
* @name material.components.whiteframe
*/
angular
.module('material.components.whiteframe', ['material.core'])
.directive('mdWhiteframe', MdWhiteframeDirective);
/**
* @private
* @ngdoc directive
* @module material.components.whiteframe
* @name mdWhiteframe
* @restrict A
*
* @description
* The md-whiteframe directive allows you to apply an elevation shadow to an element.
*
* The attribute values needs to be a number between 1 and 24.
*
* ### Notes
* - If there is no value specified it defaults to 4dp.
* - If the value is not valid it defaults to 4dp.
* @usage
* <hljs lang="html">
* <div md-whiteframe="3">
* <span>Elevation of 3dp</span>
* </div>
* </hljs>
*/
function MdWhiteframeDirective($log) {
var MIN_DP = 1;
var MAX_DP = 24;
var DEFAULT_DP = 4;
return {
restrict: 'A',
link: postLink
};
function postLink(scope, element, attr) {
var elevation = parseInt(attr.mdWhiteframe, 10) || DEFAULT_DP;
if (elevation > MAX_DP || elevation < MIN_DP) {
$log.warn('md-whiteframe attribute value is invalid. It should be a number between ' + MIN_DP + ' and ' + MAX_DP, element[0]);
elevation = DEFAULT_DP;
}
element.addClass('md-whiteframe-' + elevation + 'dp');
}
}
MdWhiteframeDirective.$inject = ["$log"];
ng.material.components.whiteframe = angular.module("material.components.whiteframe");
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment