|
|
/*! * Angular Material Design * https://github.com/angular/material
* @license MIT * v1.1.0-master-2b98560 */ !function(e,t,n){"use strict";function i(e,n,i,o,c,d){function a(a,r){function s(a,r,s,u){function l(e,t,n){s[e]&&a.$watch(s[e],function(e){n[e]&&r.attr(t,n[e])})}function m(e){var t=e.which||e.keyCode;t!==i.KEY_CODE.SPACE&&t!==i.KEY_CODE.ENTER||(e.preventDefault(),r.addClass("md-focused"),f(e))}function f(e){r[0].hasAttribute("disabled")||a.skipToggle||a.$apply(function(){var t=s.ngChecked?s.checked:!u.$viewValue;u.$setViewValue(t,e&&e.type),u.$render()})}function p(){r.toggleClass("md-checked",!!u.$viewValue&&!$)}function h(e){$=e!==!1,$&&r.attr("aria-checked","mixed"),r.toggleClass("md-indeterminate",$)}var $;u=u||c.fakeNgModel(),o(r),r.children().on("focus",function(){r.focus()}),c.parseAttributeBoolean(s.mdIndeterminate)&&(h(),a.$watch(s.mdIndeterminate,h)),s.ngChecked&&a.$watch(a.$eval.bind(a,s.ngChecked),function(e){u.$setViewValue(e),u.$render()}),l("ngDisabled","tabindex",{"true":"-1","false":s.tabindex}),n.expectWithText(r,"aria-label"),e.link.pre(a,{on:t.noop,0:{}},s,[u]),a.mouseActive=!1,r.on("click",f).on("keypress",m).on("mousedown",function(){a.mouseActive=!0,d(function(){a.mouseActive=!1},100)}).on("focus",function(){a.mouseActive===!1&&r.addClass("md-focused")}).on("blur",function(){r.removeClass("md-focused")}),u.$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:s}}return e=e[0],{restrict:"E",transclude:!0,require:"?ngModel",priority:210,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:a}}i.$inject=["inputDirective","$mdAria","$mdConstant","$mdTheming","$mdUtil","$timeout"],t.module("material.components.checkbox",["material.core"]).directive("mdCheckbox",i)}(window,window.angular);
|