/*! * AngularJS Material Design * https://github.com/angular/material * @license MIT * v1.1.18-master-97a1616 */ !function(e,l){"use strict";function t(a,s,u,c){return e.prototype={init:function(e){this._ngModelCtrl=e,this._ngModelCtrl.$render=l.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 t(this.$element,1)},selectPrevious:function(){return t(this.$element,-1)},setActiveDescendant:function(e){this.$element.attr("aria-activedescendant",e)},isDisabled:function(){return this.$element[0].hasAttribute("disabled")}},{restrict:"E",controller:["$element",e],require:["mdRadioGroup","?ngModel"],link:{pre:function(t,i,e,n){i.addClass("_md"),u(i);var r=n[0],o=n[1]||a.fakeNgModel();function d(){i.hasClass("md-focused")||i.addClass("md-focused")}r.init(o),t.mouseActive=!1,i.attr({role:"radiogroup",tabIndex:i.attr("tabindex")||"0"}).on("keydown",function(e){var t=e.which||e.keyCode;if(t==s.KEY_CODE.ENTER||e.currentTarget==e.target)switch(t){case s.KEY_CODE.LEFT_ARROW:case s.KEY_CODE.UP_ARROW:e.preventDefault(),r.selectPrevious(),d();break;case s.KEY_CODE.RIGHT_ARROW:case s.KEY_CODE.DOWN_ARROW:e.preventDefault(),r.selectNext(),d();break;case s.KEY_CODE.ENTER:var n=l.element(a.getClosest(i[0],"form"));0
',link:function(t,n,i,r){var o;c(n),function(e){e.attr({id:i.id||"radio_"+u.nextUid(),role:"radio","aria-checked":"false"}),s.expectWithText(e,"aria-label")}(n),i.ngValue?u.nextTick(e,!1):e();function e(){if(!r)throw"RadioButton: No RadioGroupController could be found.";r.add(a),i.$observe("value",a),n.on("click",d).on("$destroy",function(){r.remove(a)})}function d(e){n[0].hasAttribute("disabled")||r.isDisabled()||t.$apply(function(){r.setViewValue(i.value,e&&e.type)})}function a(){var e=r.getViewValue()==i.value;e!==o&&("md-radio-group"!==n[0].parentNode.nodeName.toLowerCase()&&n.parent().toggleClass(l,e),e&&r.setActiveDescendant(n.attr("id")),o=e,n.attr("aria-checked",e).toggleClass(l,e))}}}}t.$inject=["$mdUtil","$mdConstant","$mdTheming","$timeout"],n.$inject=["$mdAria","$mdUtil","$mdTheming"],l.module("material.components.radioButton",["material.core"]).directive("mdRadioGroup",t).directive("mdRadioButton",n)}(window,window.angular);