@angular/material
Version:
Angular Material
10 lines (9 loc) • 12.6 kB
JavaScript
/**
* @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/core"),require("@angular/material/core"),require("@angular/cdk/platform"),require("@angular/common"),require("@angular/cdk/coercion")):"function"==typeof define&&define.amd?define("@angular/material/progressSpinner",["exports","@angular/core","@angular/material/core","@angular/cdk/platform","@angular/common","@angular/cdk/coercion"],t):t((e.ng=e.ng||{},e.ng.material=e.ng.material||{},e.ng.material.progressSpinner={}),e.ng.core,e.ng.material.core,e.ng.cdk.platform,e.ng.common,e.ng.cdk.coercion)}(this,function(e,t,r,o,a,s){"use strict";function n(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var i=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])},f=100,m=function(){function e(e){this._elementRef=e}return e}(),d=r.mixinColor(m,"primary"),p="\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",c=function(e){function r(t,r,o){var a=e.call(this,t)||this;a._elementRef=t,a._document=o,a._value=0,a._fallbackAnimation=!1,a._diameter=f,a.mode="determinate",a._fallbackAnimation=r.EDGE||r.TRIDENT;var s="mat-progress-spinner-indeterminate"+(a._fallbackAnimation?"-fallback":"")+"-animation";return t.nativeElement.classList.add(s),a}return n(r,e),Object.defineProperty(r.prototype,"diameter",{get:function(){return this._diameter},set:function(e){this._diameter=s.coerceNumberProperty(e),this._fallbackAnimation||r.diameters.has(this._diameter)||this._attachStyleNode()},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"strokeWidth",{get:function(){return this._strokeWidth||this.diameter/10},set:function(e){this._strokeWidth=s.coerceNumberProperty(e)},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"value",{get:function(){return"determinate"===this.mode?this._value:0},set:function(e){this._value=Math.max(0,Math.min(100,s.coerceNumberProperty(e)))},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"_circleRadius",{get:function(){return(this.diameter-10)/2},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"_viewBox",{get:function(){var e=2*this._circleRadius+this.strokeWidth;return"0 0 "+e+" "+e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"_strokeCircumference",{get:function(){return 2*Math.PI*this._circleRadius},enumerable:!0,configurable:!0}),Object.defineProperty(r.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(r.prototype,"_circleStrokeWidth",{get:function(){return this.strokeWidth/this.diameter*100},enumerable:!0,configurable:!0}),r.prototype._attachStyleNode=function(){var e=r.styleTag;e||(e=this._document.createElement("style"),this._document.head.appendChild(e),r.styleTag=e),e&&e.sheet&&e.sheet.insertRule(this._getAnimationText(),0),r.diameters.add(this.diameter)},r.prototype._getAnimationText=function(){return p.replace(/START_VALUE/g,""+.95*this._strokeCircumference).replace(/END_VALUE/g,""+.2*this._strokeCircumference).replace(/DIAMETER/g,""+this.diameter)},r.diameters=new Set([f]),r.styleTag=null,r.decorators=[{type:t.Component,args:[{selector:"mat-progress-spinner",exportAs:"matProgressSpinner",host:{role:"progressbar",class:"mat-progress-spinner","[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]":"value","[attr.mode]":"mode"},inputs:["color"],template:'<svg [style.width.px]="diameter" [style.height.px]="diameter" [attr.viewBox]="_viewBox" preserveAspectRatio="xMidYMid meet" focusable="false"><circle 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></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-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate]{animation:mat-progress-spinner-linear-rotate 2s linear infinite}.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-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-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate] circle{transition-property:stroke}@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:t.ChangeDetectionStrategy.OnPush,encapsulation:t.ViewEncapsulation.None}]}],r.ctorParameters=function(){return[{type:t.ElementRef},{type:o.Platform},{type:Document,decorators:[{type:t.Optional},{type:t.Inject,args:[a.DOCUMENT]}]}]},r.propDecorators={diameter:[{type:t.Input}],strokeWidth:[{type:t.Input}],mode:[{type:t.Input}],value:[{type:t.Input}]},r}(d),l=function(e){function r(t,r,o){var a=e.call(this,t,r,o)||this;return a.mode="indeterminate",a}return n(r,e),r.decorators=[{type:t.Component,args:[{selector:"mat-spinner",host:{role:"progressbar",mode:"indeterminate",class:"mat-spinner mat-progress-spinner","[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"><circle 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></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-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate]{animation:mat-progress-spinner-linear-rotate 2s linear infinite}.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-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-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate] circle{transition-property:stroke}@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:t.ChangeDetectionStrategy.OnPush,encapsulation:t.ViewEncapsulation.None}]}],r.ctorParameters=function(){return[{type:t.ElementRef},{type:o.Platform},{type:Document,decorators:[{type:t.Optional},{type:t.Inject,args:[a.DOCUMENT]}]}]},r}(c),g=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[r.MatCommonModule],exports:[c,l,r.MatCommonModule],declarations:[c,l]}]}],e}();e.MatProgressSpinnerModule=g,e.MatProgressSpinnerBase=m,e._MatProgressSpinnerMixinBase=d,e.MatProgressSpinner=c,e.MatSpinner=l,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=material-progress-spinner.umd.min.js.map