LocalCDN-Firefox-Chrome-Brave/resources/angularjs/1.3.13/angular-aria.min.jsm

13 lines
3.0 KiB
JavaScript
Raw Normal View History

/*
AngularJS v1.3.13
(c) 2010-2014 Google, Inc. http://angularjs.org
License: MIT
*/
(function(q,m,r){'use strict';m.module("ngAria",["ng"]).provider("$aria",function(){function a(a,f,b){return function(c,e,h){var k=h.$normalize(f);d[k]&&!h[k]&&c.$watch(h[a],function(c){b&&(c=!c);e.attr(f,c)})}}var d={ariaHidden:!0,ariaChecked:!0,ariaDisabled:!0,ariaRequired:!0,ariaInvalid:!0,ariaMultiline:!0,ariaValue:!0,tabindex:!0,bindKeypress:!0};this.config=function(a){d=m.extend(d,a)};this.$get=function(){return{config:function(a){return d[a]},$$watchExpr:a}}}).directive("ngShow",["$aria",function(a){return a.$$watchExpr("ngShow",
"aria-hidden",!0)}]).directive("ngHide",["$aria",function(a){return a.$$watchExpr("ngHide","aria-hidden",!1)}]).directive("ngModel",["$aria",function(a){function d(d,b,c){return a.config(b)&&!c.attr(d)}function g(a,b){var c=a.type,e=a.role;return"checkbox"===(c||e)||"menuitemcheckbox"===e?"checkbox":"radio"===(c||e)||"menuitemradio"===e?"radio":"range"===c||"progressbar"===e||"slider"===e?"range":"textbox"===(c||e)||"TEXTAREA"===b[0].nodeName?"multiline":""}return{restrict:"A",require:"?ngModel",
link:function(f,b,c,e){function h(){return e.$modelValue}function k(){return l?(l=!1,function(a){a=a===c.value;b.attr("aria-checked",a);b.attr("tabindex",0-!a)}):function(a){b.attr("aria-checked",a===c.value)}}function p(a){b.attr("aria-checked",!!a)}var n=g(c,b),l=d("tabindex","tabindex",b);switch(n){case "radio":case "checkbox":d("aria-checked","ariaChecked",b)&&f.$watch(h,"radio"===n?k():p);break;case "range":a.config("ariaValue")&&(c.min&&!b.attr("aria-valuemin")&&b.attr("aria-valuemin",c.min),
c.max&&!b.attr("aria-valuemax")&&b.attr("aria-valuemax",c.max),b.attr("aria-valuenow")||f.$watch(h,function(a){b.attr("aria-valuenow",a)}));break;case "multiline":d("aria-multiline","ariaMultiline",b)&&b.attr("aria-multiline",!0)}l&&b.attr("tabindex",0);e.$validators.required&&d("aria-required","ariaRequired",b)&&f.$watch(function(){return e.$error.required},function(a){b.attr("aria-required",!!a)});d("aria-invalid","ariaInvalid",b)&&f.$watch(function(){return e.$invalid},function(a){b.attr("aria-invalid",
!!a)})}}}]).directive("ngDisabled",["$aria",function(a){return a.$$watchExpr("ngDisabled","aria-disabled")}]).directive("ngMessages",function(){return{restrict:"A",require:"?ngMessages",link:function(a,d,g,f){d.attr("aria-live")||d.attr("aria-live","assertive")}}}).directive("ngClick",["$aria","$parse",function(a,d){return{restrict:"A",compile:function(g,f){var b=d(f.ngClick,null,!0);return function(c,e,d){function f(a,b){if(-1!==b.indexOf(a[0].nodeName))return!0}a.config("tabindex")&&!e.attr("tabindex")&&
e.attr("tabindex",0);if(a.config("bindKeypress")&&!d.ngKeypress&&f(e,["DIV","LI"]))e.on("keypress",function(a){function d(){b(c,{$event:a})}32!==a.keyCode&&13!==a.keyCode||c.$apply(d)})}}}}]).directive("ngDblclick",["$aria",function(a){return function(d,g,f){a.config("tabindex")&&!g.attr("tabindex")&&g.attr("tabindex",0)}}])})(window,window.angular);
//# sourceMappingURL=angular-aria.min.js.map