blob: 2880393e5d2c62c59c068e70b4ea4ef529b4cdac [file] [log] [blame]
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/cdk/coercion"),require("@angular/cdk/platform"),require("@angular/common"),require("@angular/core"),require("@angular/material/core"),require("@angular/platform-browser/animations")):"function"==typeof define&&define.amd?define("@angular/material/progress-spinner",["exports","@angular/cdk/coercion","@angular/cdk/platform","@angular/common","@angular/core","@angular/material/core","@angular/platform-browser/animations"],t):t((e.ng=e.ng||{},e.ng.material=e.ng.material||{},e.ng.material.progressSpinner={}),e.ng.cdk.coercion,e.ng.cdk.platform,e.ng.common,e.ng.core,e.ng.material.core,e.ng.platformBrowser.animations)}(this,function(e,t,r,o,n,a,s){"use strict";function i(e,t){function r(){this.constructor=e}p(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function m(){return{diameter:f}}function d(e,t){if("undefined"!=typeof window){var r=t.head;if(r&&(r.createShadowRoot||r.attachShadow)){var o=e.getRootNode?e.getRootNode():null;if(o instanceof window.ShadowRoot)return o}}return null}var p=function(e,t){return(p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},f=100,c=function(){function e(e){this._elementRef=e}return e}(),l=a.mixinColor(c,"primary"),g=new n.InjectionToken("mat-progress-spinner-default-options",{providedIn:"root",factory:m}),u="\n @keyframes mat-progress-spinner-stroke-rotate-DIAMETER {\n 0% { stroke-dashoffset: START_VALUE; transform: rotate(0); }\n 12.5% { stroke-dashoffset: END_VALUE; transform: rotate(0); }\n 12.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(72.5deg); }\n 25% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(72.5deg); }\n\n 25.0001% { stroke-dashoffset: START_VALUE; transform: rotate(270deg); }\n 37.5% { stroke-dashoffset: END_VALUE; transform: rotate(270deg); }\n 37.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(161.5deg); }\n 50% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(161.5deg); }\n\n 50.0001% { stroke-dashoffset: START_VALUE; transform: rotate(180deg); }\n 62.5% { stroke-dashoffset: END_VALUE; transform: rotate(180deg); }\n 62.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(251.5deg); }\n 75% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(251.5deg); }\n\n 75.0001% { stroke-dashoffset: START_VALUE; transform: rotate(90deg); }\n 87.5% { stroke-dashoffset: END_VALUE; transform: rotate(90deg); }\n 87.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(341.5deg); }\n 100% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(341.5deg); }\n }\n",h=function(e){function a(t,r,o,n,s){var i=e.call(this,t)||this;i._elementRef=t,i._document=o,i._diameter=f,i._value=0,i._fallbackAnimation=!1,i.mode="determinate";var m=a._diameters;m.has(o.head)||m.set(o.head,new Set([f])),i._styleRoot=d(t.nativeElement,o)||o.head,i._fallbackAnimation=r.EDGE||r.TRIDENT,i._noopAnimations="NoopAnimations"===n&&!!s&&!s._forceAnimations,s&&(s.diameter&&(i.diameter=s.diameter),s.strokeWidth&&(i.strokeWidth=s.strokeWidth));var p="mat-progress-spinner-indeterminate"+(i._fallbackAnimation?"-fallback":"")+"-animation";return t.nativeElement.classList.add(p),i}return i(a,e),Object.defineProperty(a.prototype,"diameter",{get:function(){return this._diameter},set:function(e){if(this._diameter=t.coerceNumberProperty(e),!this._fallbackAnimation){var r=a._diameters,o=r.get(this._styleRoot);o&&o.has(this._diameter)||this._attachStyleNode()}},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"strokeWidth",{get:function(){return this._strokeWidth||this.diameter/10},set:function(e){this._strokeWidth=t.coerceNumberProperty(e)},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"value",{get:function(){return"determinate"===this.mode?this._value:0},set:function(e){this._value=Math.max(0,Math.min(100,t.coerceNumberProperty(e)))},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"_circleRadius",{get:function(){return(this.diameter-10)/2},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"_viewBox",{get:function(){var e=2*this._circleRadius+this.strokeWidth;return"0 0 "+e+" "+e},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"_strokeCircumference",{get:function(){return 2*Math.PI*this._circleRadius},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"_strokeDashOffset",{get:function(){return"determinate"===this.mode?this._strokeCircumference*(100-this._value)/100:this._fallbackAnimation&&"indeterminate"===this.mode?.2*this._strokeCircumference:null},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"_circleStrokeWidth",{get:function(){return this.strokeWidth/this.diameter*100},enumerable:!0,configurable:!0}),a.prototype._attachStyleNode=function(){var e=this._document.createElement("style"),t=this._styleRoot,r=this._diameter,o=a._diameters,n=o.get(t);e.setAttribute("mat-spinner-animation",r+""),e.textContent=this._getAnimationText(),t.appendChild(e),n||(n=new Set,o.set(t,n)),n.add(r)},a.prototype._getAnimationText=function(){return u.replace(/START_VALUE/g,""+.95*this._strokeCircumference).replace(/END_VALUE/g,""+.2*this._strokeCircumference).replace(/DIAMETER/g,""+this.diameter)},a._diameters=new WeakMap,a.decorators=[{type:n.Component,args:[{selector:"mat-progress-spinner",exportAs:"matProgressSpinner",host:{role:"progressbar",class:"mat-progress-spinner","[class._mat-animation-noopable]":"_noopAnimations","[style.width.px]":"diameter","[style.height.px]":"diameter","[attr.aria-valuemin]":'mode === "determinate" ? 0 : null',"[attr.aria-valuemax]":'mode === "determinate" ? 100 : null',"[attr.aria-valuenow]":'mode === "determinate" ? value : null',"[attr.mode]":"mode"},inputs:["color"],template:'<svg [style.width.px]="diameter" [style.height.px]="diameter" [attr.viewBox]="_viewBox" preserveAspectRatio="xMidYMid meet" focusable="false" [ngSwitch]="mode === \'indeterminate\'"><circle *ngSwitchCase="true" cx="50%" cy="50%" [attr.r]="_circleRadius" [style.animation-name]="\'mat-progress-spinner-stroke-rotate-\' + diameter" [style.stroke-dashoffset.px]="_strokeDashOffset" [style.stroke-dasharray.px]="_strokeCircumference" [style.stroke-width.%]="_circleStrokeWidth"></circle><circle *ngSwitchCase="false" cx="50%" cy="50%" [attr.r]="_circleRadius" [style.stroke-dashoffset.px]="_strokeDashOffset" [style.stroke-dasharray.px]="_strokeCircumference" [style.stroke-width.%]="_circleStrokeWidth"></circle></svg>',styles:[".mat-progress-spinner{display:block;position:relative}.mat-progress-spinner svg{position:absolute;transform:rotate(-90deg);top:0;left:0;transform-origin:center;overflow:visible}.mat-progress-spinner circle{fill:transparent;transform-origin:center;transition:stroke-dashoffset 225ms linear}._mat-animation-noopable.mat-progress-spinner circle{transition:none;animation:none}.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate]{animation:mat-progress-spinner-linear-rotate 2s linear infinite}._mat-animation-noopable.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate]{transition:none;animation:none}.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate] circle{transition-property:stroke;animation-duration:4s;animation-timing-function:cubic-bezier(.35,0,.25,1);animation-iteration-count:infinite}._mat-animation-noopable.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate] circle{transition:none;animation:none}.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate]{animation:mat-progress-spinner-stroke-rotate-fallback 10s cubic-bezier(.87,.03,.33,1) infinite}._mat-animation-noopable.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate]{transition:none;animation:none}.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate] circle{transition-property:stroke}._mat-animation-noopable.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate] circle{transition:none;animation:none}@keyframes mat-progress-spinner-linear-rotate{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes mat-progress-spinner-stroke-rotate-100{0%{stroke-dashoffset:268.60617px;transform:rotate(0)}12.5%{stroke-dashoffset:56.54867px;transform:rotate(0)}12.5001%{stroke-dashoffset:56.54867px;transform:rotateX(180deg) rotate(72.5deg)}25%{stroke-dashoffset:268.60617px;transform:rotateX(180deg) rotate(72.5deg)}25.0001%{stroke-dashoffset:268.60617px;transform:rotate(270deg)}37.5%{stroke-dashoffset:56.54867px;transform:rotate(270deg)}37.5001%{stroke-dashoffset:56.54867px;transform:rotateX(180deg) rotate(161.5deg)}50%{stroke-dashoffset:268.60617px;transform:rotateX(180deg) rotate(161.5deg)}50.0001%{stroke-dashoffset:268.60617px;transform:rotate(180deg)}62.5%{stroke-dashoffset:56.54867px;transform:rotate(180deg)}62.5001%{stroke-dashoffset:56.54867px;transform:rotateX(180deg) rotate(251.5deg)}75%{stroke-dashoffset:268.60617px;transform:rotateX(180deg) rotate(251.5deg)}75.0001%{stroke-dashoffset:268.60617px;transform:rotate(90deg)}87.5%{stroke-dashoffset:56.54867px;transform:rotate(90deg)}87.5001%{stroke-dashoffset:56.54867px;transform:rotateX(180deg) rotate(341.5deg)}100%{stroke-dashoffset:268.60617px;transform:rotateX(180deg) rotate(341.5deg)}}@keyframes mat-progress-spinner-stroke-rotate-fallback{0%{transform:rotate(0)}25%{transform:rotate(1170deg)}50%{transform:rotate(2340deg)}75%{transform:rotate(3510deg)}100%{transform:rotate(4680deg)}}"],changeDetection:n.ChangeDetectionStrategy.OnPush,encapsulation:n.ViewEncapsulation.None}]}],a.ctorParameters=function(){return[{type:n.ElementRef},{type:r.Platform},{type:void 0,decorators:[{type:n.Optional},{type:n.Inject,args:[o.DOCUMENT]}]},{type:String,decorators:[{type:n.Optional},{type:n.Inject,args:[s.ANIMATION_MODULE_TYPE]}]},{type:void 0,decorators:[{type:n.Inject,args:[g]}]}]},a.propDecorators={diameter:[{type:n.Input}],strokeWidth:[{type:n.Input}],mode:[{type:n.Input}],value:[{type:n.Input}]},a}(l),k=function(e){function t(t,r,o,n,a){var s=e.call(this,t,r,o,n,a)||this;return s.mode="indeterminate",s}return i(t,e),t.decorators=[{type:n.Component,args:[{selector:"mat-spinner",host:{role:"progressbar",mode:"indeterminate",class:"mat-spinner mat-progress-spinner","[class._mat-animation-noopable]":"_noopAnimations","[style.width.px]":"diameter","[style.height.px]":"diameter"},inputs:["color"],template:'<svg [style.width.px]="diameter" [style.height.px]="diameter" [attr.viewBox]="_viewBox" preserveAspectRatio="xMidYMid meet" focusable="false" [ngSwitch]="mode === \'indeterminate\'"><circle *ngSwitchCase="true" cx="50%" cy="50%" [attr.r]="_circleRadius" [style.animation-name]="\'mat-progress-spinner-stroke-rotate-\' + diameter" [style.stroke-dashoffset.px]="_strokeDashOffset" [style.stroke-dasharray.px]="_strokeCircumference" [style.stroke-width.%]="_circleStrokeWidth"></circle><circle *ngSwitchCase="false" cx="50%" cy="50%" [attr.r]="_circleRadius" [style.stroke-dashoffset.px]="_strokeDashOffset" [style.stroke-dasharray.px]="_strokeCircumference" [style.stroke-width.%]="_circleStrokeWidth"></circle></svg>',styles:[".mat-progress-spinner{display:block;position:relative}.mat-progress-spinner svg{position:absolute;transform:rotate(-90deg);top:0;left:0;transform-origin:center;overflow:visible}.mat-progress-spinner circle{fill:transparent;transform-origin:center;transition:stroke-dashoffset 225ms linear}._mat-animation-noopable.mat-progress-spinner circle{transition:none;animation:none}.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate]{animation:mat-progress-spinner-linear-rotate 2s linear infinite}._mat-animation-noopable.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate]{transition:none;animation:none}.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate] circle{transition-property:stroke;animation-duration:4s;animation-timing-function:cubic-bezier(.35,0,.25,1);animation-iteration-count:infinite}._mat-animation-noopable.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate] circle{transition:none;animation:none}.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate]{animation:mat-progress-spinner-stroke-rotate-fallback 10s cubic-bezier(.87,.03,.33,1) infinite}._mat-animation-noopable.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate]{transition:none;animation:none}.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate] circle{transition-property:stroke}._mat-animation-noopable.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate] circle{transition:none;animation:none}@keyframes mat-progress-spinner-linear-rotate{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes mat-progress-spinner-stroke-rotate-100{0%{stroke-dashoffset:268.60617px;transform:rotate(0)}12.5%{stroke-dashoffset:56.54867px;transform:rotate(0)}12.5001%{stroke-dashoffset:56.54867px;transform:rotateX(180deg) rotate(72.5deg)}25%{stroke-dashoffset:268.60617px;transform:rotateX(180deg) rotate(72.5deg)}25.0001%{stroke-dashoffset:268.60617px;transform:rotate(270deg)}37.5%{stroke-dashoffset:56.54867px;transform:rotate(270deg)}37.5001%{stroke-dashoffset:56.54867px;transform:rotateX(180deg) rotate(161.5deg)}50%{stroke-dashoffset:268.60617px;transform:rotateX(180deg) rotate(161.5deg)}50.0001%{stroke-dashoffset:268.60617px;transform:rotate(180deg)}62.5%{stroke-dashoffset:56.54867px;transform:rotate(180deg)}62.5001%{stroke-dashoffset:56.54867px;transform:rotateX(180deg) rotate(251.5deg)}75%{stroke-dashoffset:268.60617px;transform:rotateX(180deg) rotate(251.5deg)}75.0001%{stroke-dashoffset:268.60617px;transform:rotate(90deg)}87.5%{stroke-dashoffset:56.54867px;transform:rotate(90deg)}87.5001%{stroke-dashoffset:56.54867px;transform:rotateX(180deg) rotate(341.5deg)}100%{stroke-dashoffset:268.60617px;transform:rotateX(180deg) rotate(341.5deg)}}@keyframes mat-progress-spinner-stroke-rotate-fallback{0%{transform:rotate(0)}25%{transform:rotate(1170deg)}50%{transform:rotate(2340deg)}75%{transform:rotate(3510deg)}100%{transform:rotate(4680deg)}}"],changeDetection:n.ChangeDetectionStrategy.OnPush,encapsulation:n.ViewEncapsulation.None}]}],t.ctorParameters=function(){return[{type:n.ElementRef},{type:r.Platform},{type:void 0,decorators:[{type:n.Optional},{type:n.Inject,args:[o.DOCUMENT]}]},{type:String,decorators:[{type:n.Optional},{type:n.Inject,args:[s.ANIMATION_MODULE_TYPE]}]},{type:void 0,decorators:[{type:n.Inject,args:[g]}]}]},t}(h),_=function(){function e(){}return e.decorators=[{type:n.NgModule,args:[{imports:[a.MatCommonModule,o.CommonModule],exports:[h,k,a.MatCommonModule],declarations:[h,k]}]}],e}();e.MatProgressSpinner=h,e.MatSpinner=k,e.MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS=g,e.MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS_FACTORY=m,e.MatProgressSpinnerModule=_,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=material-progress-spinner.umd.min.js.map