|
|
/*! * Angular Material Design * https://github.com/angular/material
* @license MIT * v1.1.2-master-a9ba340 */ function MdCheckboxDirective(e,t,n,i,o,a){function c(c,r){function d(c,r,d,l){function s(e,t,n){d[e]&&c.$watch(d[e],function(e){n[e]&&r.attr(t,n[e])})}function u(e){var t=e.which||e.keyCode;t!==n.KEY_CODE.SPACE&&t!==n.KEY_CODE.ENTER||(e.preventDefault(),r.addClass("md-focused"),m(e))}function m(e){r[0].hasAttribute("disabled")||c.skipToggle||c.$apply(function(){var t=d.ngChecked?d.checked:!g.$viewValue;g.$setViewValue(t,e&&e.type),g.$render()})}function p(){r.toggleClass("md-checked",!!g.$viewValue&&!f)}function h(e){f=e!==!1,f&&r.attr("aria-checked","mixed"),r.toggleClass("md-indeterminate",f)}var f,b=l[0],g=l[1]||o.fakeNgModel(),k=l[2];if(b){var $=b.isErrorGetter||function(){return g.$invalid&&(g.$touched||k&&k.$submitted)};b.input=r,c.$watch($,b.setInvalid)}i(r),r.children().on("focus",function(){r.focus()}),o.parseAttributeBoolean(d.mdIndeterminate)&&(h(),c.$watch(d.mdIndeterminate,h)),d.ngChecked&&c.$watch(c.$eval.bind(c,d.ngChecked),function(e){g.$setViewValue(e),g.$render()}),s("ngDisabled","tabindex",{"true":"-1","false":d.tabindex}),t.expectWithText(r,"aria-label"),e.link.pre(c,{on:angular.noop,0:{}},d,[g]),r.on("click",m).on("keypress",u).on("focus",function(){"keyboard"===a.getLastInteractionType()&&r.addClass("md-focused")}).on("blur",function(){r.removeClass("md-focused")}),g.$render=p}return r.$set("tabindex",r.tabindex||"0"),r.$set("type","checkbox"),r.$set("role",r.type),{pre:function(e,t){t.on("click",function(e){this.hasAttribute("disabled")&&e.stopImmediatePropagation()})},post:d}}return e=e[0],{restrict:"E",transclude:!0,require:["^?mdInputContainer","?ngModel","?^form"],priority:n.BEFORE_NG_ARIA,template:'<div class="md-container" md-ink-ripple md-ink-ripple-checkbox><div class="md-icon"></div></div><div ng-transclude class="md-label"></div>',compile:c}}goog.provide("ngmaterial.components.checkbox"),goog.require("ngmaterial.core"),MdCheckboxDirective.$inject=["inputDirective","$mdAria","$mdConstant","$mdTheming","$mdUtil","$mdInteraction"],angular.module("material.components.checkbox",["material.core"]).directive("mdCheckbox",MdCheckboxDirective),ngmaterial.components.checkbox=angular.module("material.components.checkbox");
|