source: trip-planner-front/node_modules/angular-material/modules/js/progressCircular/progressCircular.min.js@ 6a3a178

Last change on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 3.8 KB
Line 
1/*!
2 * AngularJS Material Design
3 * https://github.com/angular/material
4 * @license MIT
5 * v1.2.2-master-0a06f99
6 */
7!function(e,E){"use strict";function t(M,k,s,C,f,e){var I=M.requestAnimationFrame||M.webkitRequestAnimationFrame||E.noop,v=M.cancelAnimationFrame||M.webkitCancelAnimationFrame||M.webkitCancelRequestAnimationFrame||E.noop,g="determinate",x="indeterminate",F="_md-progress-circular-disabled",b="md-mode-indeterminate";return{restrict:"E",scope:{value:"@",mdDiameter:"@",mdMode:"@"},template:'<svg xmlns="http://www.w3.org/2000/svg"><path fill="none"/></svg>',compile:function(e,t){if(e.attr({"aria-valuemin":0,"aria-valuemax":100,role:"progressbar"}),E.isUndefined(t.mdMode)){var r=t.hasOwnProperty("value")?g:x;t.$set("mdMode",r)}else t.$set("mdMode",t.mdMode.trim());return a}};function a(h,d,m){var p,e,t=d[0],o=E.element(t.querySelector("svg")),w=E.element(t.querySelector("path")),r=k.startIndeterminate,a=k.endIndeterminate,n=0,$=0;function u(r,e,t,a,n,i){var o=++$,s=C.now(),d=e-r,m=q(h.mdDiameter),u=D(m),l=t||k.easeFn,c=a||k.duration,f=-90*(n||0),v=i||100;function g(e){w.attr("stroke-dashoffset",A(m,u,e,v)),w.attr("transform","rotate("+f+" "+m/2+" "+m/2+")")}e===r?g(e):p=I(function e(){var t=M.Math.max(0,M.Math.min(C.now()-s,c));g(l(t,r,d,c)),o===$&&t<c&&(p=I(e))})}function i(){u(r,a,k.easeFnIndeterminate,k.durationIndeterminate,n,75),n=++n%4}function l(){e||(e=f(i,k.durationIndeterminate,0,!1),i(),d.addClass(b).removeAttr("aria-valuenow"))}function c(){e&&(f.cancel(e),e=null,d.removeClass(b))}s(d),d.toggleClass(F,m.hasOwnProperty("disabled")),h.mdMode===x&&l(),h.$on("$destroy",function(){c(),p&&v(p)}),h.$watchGroup(["value","mdMode",function(){var e=t.disabled;return!0===e||!1===e?e:E.isDefined(d.attr("disabled"))}],function(e,t){var r=e[1],a=e[2],n=0,i=0;if(a!==t[2]&&d.toggleClass(F,!!a),a)c();else if(r!==g&&r!==x&&(r=x,m.$set("mdMode",r)),r===x)t[1]===g&&(i=D(n=q(h.mdDiameter)),w.attr("d",y(n,i,!0)),w.attr("stroke-dasharray",S(n,i,75))),l();else{var o=P(e[0]),s=P(t[0]);c(),t[1]===x&&(i=D(n=q(h.mdDiameter)),w.attr("d",y(n,i,!1)),w.attr("stroke-dasharray",S(n,i,100))),d.attr("aria-valuenow",o),u(s,o)}}),h.$watch("mdDiameter",function(e){var t=q(e),r=D(t),a=P(h.value),n=t/2+"px",i={width:t+"px",height:t+"px"};o[0].setAttribute("viewBox","0 0 "+t+" "+t),o.css(i).css("transform-origin",n+" "+n+" "+n),d.css(i),w.attr("stroke-width",r),w.attr("stroke-linecap","square"),h.mdMode==x?(w.attr("d",y(t,r,!0)),w.attr("stroke-dasharray",S(t,r,75)),w.attr("stroke-dashoffset",A(t,r,1,75))):(w.attr("d",y(t,r,!1)),w.attr("stroke-dasharray",S(t,r,100)),w.attr("stroke-dashoffset",A(t,r,0,100)),u(a,a))})}function y(e,t,r){var a=e/2,n=t/2,i=a+","+n,o=a-n;return"M"+i+"A"+o+","+o+" 0 1 1 "+(n+","+a)+(r?"":"A"+o+","+o+" 0 0 1 "+i)}function A(e,t,r,a){return n(e,t)*((a-r)/100)}function P(e){return M.Math.max(0,M.Math.min(e||0,100))}function q(e){var t=k.progressSize;if(e){var r=parseFloat(e);return e.lastIndexOf("%")===e.length-1&&(r=r/100*t),r}return t}function D(e){return k.strokeWidth/100*e}function S(e,t,r){return n(e,t)*(r/100)}function n(e,t){return(e-t)*M.Math.PI}}E.module("material.components.progressCircular",["material.core"]),t.$inject=["$window","$mdProgressCircular","$mdTheming","$mdUtil","$interval","$log"],E.module("material.components.progressCircular").directive("mdProgressCircular",t),E.module("material.components.progressCircular").provider("$mdProgressCircular",function(){var t={progressSize:50,strokeWidth:10,duration:100,easeFn:e,durationIndeterminate:1333,startIndeterminate:1,endIndeterminate:149,easeFnIndeterminate:r,easingPresets:{linearEase:e,materialEase:r}};return{configure:function(e){return t=E.extend(t,e||{})},$get:function(){return t}};function e(e,t,r,a){return r*e/a+t}function r(e,t,r,a){var n=(e/=a)*e,i=n*e;return t+r*(6*i*n+-15*n*n+10*i)}})}(window,window.angular);
Note: See TracBrowser for help on using the repository browser.