2015-08-07 16:37:36 +02:00
|
|
|
/*
|
2018-08-09 06:29:56 +02:00
|
|
|
AngularJS v1.7.3
|
2018-02-03 07:28:30 +01:00
|
|
|
(c) 2010-2018 Google, Inc. http://angularjs.org
|
2015-08-07 16:37:36 +02:00
|
|
|
License: MIT
|
|
|
|
*/
|
2018-08-09 06:29:56 +02:00
|
|
|
(function(s,p){'use strict';var e="BUTTON A INPUT TEXTAREA SELECT DETAILS SUMMARY".split(" "),l=function(a,c){if(-1!==c.indexOf(a[0].nodeName))return!0};p.module("ngAria",["ng"]).info({angularVersion:"1.7.3"}).provider("$aria",function(){function a(a,g,n,k){return function(d,f,b){if(!b.hasOwnProperty("ngAriaDisable")){var h=b.$normalize(g);!c[h]||l(f,n)||b[h]||d.$watch(b[a],function(b){b=k?!b:!!b;f.attr(g,b)})}}}var c={ariaHidden:!0,ariaChecked:!0,ariaReadonly:!0,ariaDisabled:!0,ariaRequired:!0,ariaInvalid:!0,
|
|
|
|
ariaValue:!0,tabindex:!0,bindKeydown:!0,bindRoleForClick:!0};this.config=function(a){c=p.extend(c,a)};this.$get=function(){return{config:function(a){return c[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("ngValue",["$aria",function(a){return a.$$watchExpr("ngValue","aria-checked",e,!1)}]).directive("ngChecked",["$aria",function(a){return a.$$watchExpr("ngChecked",
|
|
|
|
"aria-checked",e,!1)}]).directive("ngReadonly",["$aria",function(a){return a.$$watchExpr("ngReadonly","aria-readonly",e,!1)}]).directive("ngRequired",["$aria",function(a){return a.$$watchExpr("ngRequired","aria-required",e,!1)}]).directive("ngModel",["$aria",function(a){function c(c,k,d,f){return a.config(k)&&!d.attr(c)&&(f||!l(d,e))&&("hidden"!==d.attr("type")||"INPUT"!==d[0].nodeName)}function m(a,c){return!c.attr("role")&&c.attr("type")===a&&!l(c,e)}function g(a,c){var d=a.type,f=a.role;return"checkbox"===
|
|
|
|
(d||f)||"menuitemcheckbox"===f?"checkbox":"radio"===(d||f)||"menuitemradio"===f?"radio":"range"===d||"progressbar"===f||"slider"===f?"range":""}return{restrict:"A",require:"ngModel",priority:200,compile:function(e,k){if(!k.hasOwnProperty("ngAriaDisable")){var d=g(k,e);return{post:function(f,b,h,e){function g(){return e.$modelValue}function k(a){b.attr("aria-checked",h.value==e.$viewValue)}function l(){b.attr("aria-checked",!e.$isEmpty(e.$viewValue))}var n=c("tabindex","tabindex",b,!1);switch(d){case "radio":case "checkbox":m(d,
|
|
|
|
b)&&b.attr("role",d);c("aria-checked","ariaChecked",b,!1)&&f.$watch(g,"radio"===d?k:l);n&&b.attr("tabindex",0);break;case "range":m(d,b)&&b.attr("role","slider");if(a.config("ariaValue")){var p=!b.attr("aria-valuemin")&&(h.hasOwnProperty("min")||h.hasOwnProperty("ngMin")),q=!b.attr("aria-valuemax")&&(h.hasOwnProperty("max")||h.hasOwnProperty("ngMax")),r=!b.attr("aria-valuenow");p&&h.$observe("min",function(a){b.attr("aria-valuemin",a)});q&&h.$observe("max",function(a){b.attr("aria-valuemax",a)});
|
|
|
|
r&&f.$watch(g,function(a){b.attr("aria-valuenow",a)})}n&&b.attr("tabindex",0)}!h.hasOwnProperty("ngRequired")&&e.$validators.required&&c("aria-required","ariaRequired",b,!1)&&h.$observe("required",function(){b.attr("aria-required",!!h.required)});c("aria-invalid","ariaInvalid",b,!0)&&f.$watch(function(){return e.$invalid},function(a){b.attr("aria-invalid",!!a)})}}}}}}]).directive("ngDisabled",["$aria",function(a){return a.$$watchExpr("ngDisabled","aria-disabled",e,!1)}]).directive("ngMessages",function(){return{restrict:"A",
|
|
|
|
require:"?ngMessages",link:function(a,c,e,g){e.hasOwnProperty("ngAriaDisable")||c.attr("aria-live")||c.attr("aria-live","assertive")}}}).directive("ngClick",["$aria","$parse",function(a,c){return{restrict:"A",compile:function(m,g){if(!g.hasOwnProperty("ngAriaDisable")){var n=c(g.ngClick);return function(c,d,f){if(!l(d,e)&&(a.config("bindRoleForClick")&&!d.attr("role")&&d.attr("role","button"),a.config("tabindex")&&!d.attr("tabindex")&&d.attr("tabindex",0),a.config("bindKeydown")&&!f.ngKeydown&&!f.ngKeypress&&
|
|
|
|
!f.ngKeyup))d.on("keydown",function(a){function d(){n(c,{$event:a})}var e=a.which||a.keyCode;if(13===e||32===e)a.preventDefault(),c.$apply(d)})}}}}}]).directive("ngDblclick",["$aria",function(a){return function(c,m,g){g.hasOwnProperty("ngAriaDisable")||!a.config("tabindex")||m.attr("tabindex")||l(m,e)||m.attr("tabindex",0)}}])})(window,window.angular);
|
2015-08-07 16:37:36 +02:00
|
|
|
//# sourceMappingURL=angular-aria.min.js.map
|