@angular/material
Version:
Angular Material
23 lines • 18 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/material/core"),require("tslib"),require("@angular/cdk/coercion"),require("@angular/cdk/platform"),require("@angular/platform-browser/animations")):"function"==typeof define&&define.amd?define("@angular/material/progress-spinner",["exports","@angular/core","@angular/common","@angular/material/core","tslib","@angular/cdk/coercion","@angular/cdk/platform","@angular/platform-browser/animations"],t):t(((e=e||self).ng=e.ng||{},e.ng.material=e.ng.material||{},e.ng.material.progressSpinner={}),e.ng.core,e.ng.common,e.ng.material.core,e.tslib,e.ng.cdk.coercion,e.ng.cdk.platform,e.ng.platformBrowser.animations)}(this,(function(e,t,r,n,a,o,s,i){"use strict";
/**
* @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
*/var m=100,d=n.mixinColor((function f(e){this._elementRef=e}),"primary"),p=new t.InjectionToken("mat-progress-spinner-default-options",{providedIn:"root",factory:c});function c(){return{diameter:m}}var l=function(e){function n(t,r,a,o,s){var i=e.call(this,t)||this;i._elementRef=t,i._document=a,i._diameter=m,i._value=0,i._fallbackAnimation=!1,i.mode="determinate";var d=n._diameters;return d.has(a.head)||d.set(a.head,new Set([m])),i._fallbackAnimation=r.EDGE||r.TRIDENT,i._noopAnimations="NoopAnimations"===o&&!!s&&!s._forceAnimations,s&&(s.diameter&&(i.diameter=s.diameter),s.strokeWidth&&(i.strokeWidth=s.strokeWidth)),i}return a.__extends(n,e),Object.defineProperty(n.prototype,"diameter",{get:function(){return this._diameter},set:function(e){this._diameter=o.coerceNumberProperty(e),!this._fallbackAnimation&&this._styleRoot&&this._attachStyleNode()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"strokeWidth",{get:function(){return this._strokeWidth||this.diameter/10},set:function(e){this._strokeWidth=o.coerceNumberProperty(e)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return"determinate"===this.mode?this._value:0},set:function(e){this._value=Math.max(0,Math.min(100,o.coerceNumberProperty(e)))},enumerable:!0,configurable:!0}),n.prototype.ngOnInit=function(){var e=this._elementRef.nativeElement;this._styleRoot=function t(e,r){if("undefined"!=typeof window){var n=r.head;if(n&&(n.createShadowRoot||n.attachShadow)){var a=e.getRootNode?e.getRootNode():null;if(a instanceof window.ShadowRoot)return a}}return null}
/**
* @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
*/(e,this._document)||this._document.head,this._attachStyleNode(),e.classList.add("mat-progress-spinner-indeterminate"+(this._fallbackAnimation?"-fallback":"")+"-animation")},Object.defineProperty(n.prototype,"_circleRadius",{get:function(){return(this.diameter-10)/2},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_viewBox",{get:function(){var e=2*this._circleRadius+this.strokeWidth;return"0 0 "+e+" "+e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_strokeCircumference",{get:function(){return 2*Math.PI*this._circleRadius},enumerable:!0,configurable:!0}),Object.defineProperty(n.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(n.prototype,"_circleStrokeWidth",{get:function(){return this.strokeWidth/this.diameter*100},enumerable:!0,configurable:!0}),n.prototype._attachStyleNode=function(){var e=this._styleRoot,t=this._diameter,r=n._diameters,a=r.get(e);if(!a||!a.has(t)){var o=this._document.createElement("style");o.setAttribute("mat-spinner-animation",t+""),o.textContent=this._getAnimationText(),e.appendChild(o),a||(a=new Set,r.set(e,a)),a.add(t)}},n.prototype._getAnimationText=function(){return"\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".replace(/START_VALUE/g,""+.95*this._strokeCircumference).replace(/END_VALUE/g,""+.2*this._strokeCircumference).replace(/DIAMETER/g,""+this.diameter)},n._diameters=new WeakMap,n.decorators=[{type:t.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:'\x3c!--\n preserveAspectRatio of xMidYMid meet as the center of the viewport is the circle\'s\n center. The center of the circle will remain at the center of the mat-progress-spinner\n element containing the SVG. `focusable="false"` prevents IE from allowing the user to\n tab into the SVG element.\n--\x3e\n\n<svg\n [style.width.px]="diameter"\n [style.height.px]="diameter"\n [attr.viewBox]="_viewBox"\n preserveAspectRatio="xMidYMid meet"\n focusable="false"\n [ngSwitch]="mode === \'indeterminate\'">\n\n \x3c!--\n Technically we can reuse the same `circle` element, however Safari has an issue that breaks\n the SVG rendering in determinate mode, after switching between indeterminate and determinate.\n Using a different element avoids the issue. An alternative to this is adding `display: none`\n for a split second and then removing it when switching between modes, but it\'s hard to know\n for how long to hide the element and it can cause the UI to blink.\n --\x3e\n <circle\n *ngSwitchCase="true"\n cx="50%"\n cy="50%"\n [attr.r]="_circleRadius"\n [style.animation-name]="\'mat-progress-spinner-stroke-rotate-\' + diameter"\n [style.stroke-dashoffset.px]="_strokeDashOffset"\n [style.stroke-dasharray.px]="_strokeCircumference"\n [style.stroke-width.%]="_circleStrokeWidth"></circle>\n\n <circle\n *ngSwitchCase="false"\n cx="50%"\n cy="50%"\n [attr.r]="_circleRadius"\n [style.stroke-dashoffset.px]="_strokeDashOffset"\n [style.stroke-dasharray.px]="_strokeCircumference"\n [style.stroke-width.%]="_circleStrokeWidth"></circle>\n</svg>\n',changeDetection:t.ChangeDetectionStrategy.OnPush,encapsulation:t.ViewEncapsulation.None,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 2000ms 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:4000ms;animation-timing-function:cubic-bezier(0.35, 0, 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 10000ms cubic-bezier(0.87, 0.03, 0.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(0deg)}100%{transform:rotate(360deg)}}@keyframes mat-progress-spinner-stroke-rotate-100{0%{stroke-dashoffset:268.606171575px;transform:rotate(0)}12.5%{stroke-dashoffset:56.5486677px;transform:rotate(0)}12.5001%{stroke-dashoffset:56.5486677px;transform:rotateX(180deg) rotate(72.5deg)}25%{stroke-dashoffset:268.606171575px;transform:rotateX(180deg) rotate(72.5deg)}25.0001%{stroke-dashoffset:268.606171575px;transform:rotate(270deg)}37.5%{stroke-dashoffset:56.5486677px;transform:rotate(270deg)}37.5001%{stroke-dashoffset:56.5486677px;transform:rotateX(180deg) rotate(161.5deg)}50%{stroke-dashoffset:268.606171575px;transform:rotateX(180deg) rotate(161.5deg)}50.0001%{stroke-dashoffset:268.606171575px;transform:rotate(180deg)}62.5%{stroke-dashoffset:56.5486677px;transform:rotate(180deg)}62.5001%{stroke-dashoffset:56.5486677px;transform:rotateX(180deg) rotate(251.5deg)}75%{stroke-dashoffset:268.606171575px;transform:rotateX(180deg) rotate(251.5deg)}75.0001%{stroke-dashoffset:268.606171575px;transform:rotate(90deg)}87.5%{stroke-dashoffset:56.5486677px;transform:rotate(90deg)}87.5001%{stroke-dashoffset:56.5486677px;transform:rotateX(180deg) rotate(341.5deg)}100%{stroke-dashoffset:268.606171575px;transform:rotateX(180deg) rotate(341.5deg)}}@keyframes mat-progress-spinner-stroke-rotate-fallback{0%{transform:rotate(0deg)}25%{transform:rotate(1170deg)}50%{transform:rotate(2340deg)}75%{transform:rotate(3510deg)}100%{transform:rotate(4680deg)}}\n"]}]}],n.ctorParameters=function(){return[{type:t.ElementRef},{type:s.Platform},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[r.DOCUMENT]}]},{type:String,decorators:[{type:t.Optional},{type:t.Inject,args:[i.ANIMATION_MODULE_TYPE]}]},{type:void 0,decorators:[{type:t.Inject,args:[p]}]}]},n.propDecorators={diameter:[{type:t.Input}],strokeWidth:[{type:t.Input}],mode:[{type:t.Input}],value:[{type:t.Input}]},n}(d),g=function(e){function n(t,r,n,a,o){var s=e.call(this,t,r,n,a,o)||this;return s.mode="indeterminate",s}return a.__extends(n,e),n.decorators=[{type:t.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:'\x3c!--\n preserveAspectRatio of xMidYMid meet as the center of the viewport is the circle\'s\n center. The center of the circle will remain at the center of the mat-progress-spinner\n element containing the SVG. `focusable="false"` prevents IE from allowing the user to\n tab into the SVG element.\n--\x3e\n\n<svg\n [style.width.px]="diameter"\n [style.height.px]="diameter"\n [attr.viewBox]="_viewBox"\n preserveAspectRatio="xMidYMid meet"\n focusable="false"\n [ngSwitch]="mode === \'indeterminate\'">\n\n \x3c!--\n Technically we can reuse the same `circle` element, however Safari has an issue that breaks\n the SVG rendering in determinate mode, after switching between indeterminate and determinate.\n Using a different element avoids the issue. An alternative to this is adding `display: none`\n for a split second and then removing it when switching between modes, but it\'s hard to know\n for how long to hide the element and it can cause the UI to blink.\n --\x3e\n <circle\n *ngSwitchCase="true"\n cx="50%"\n cy="50%"\n [attr.r]="_circleRadius"\n [style.animation-name]="\'mat-progress-spinner-stroke-rotate-\' + diameter"\n [style.stroke-dashoffset.px]="_strokeDashOffset"\n [style.stroke-dasharray.px]="_strokeCircumference"\n [style.stroke-width.%]="_circleStrokeWidth"></circle>\n\n <circle\n *ngSwitchCase="false"\n cx="50%"\n cy="50%"\n [attr.r]="_circleRadius"\n [style.stroke-dashoffset.px]="_strokeDashOffset"\n [style.stroke-dasharray.px]="_strokeCircumference"\n [style.stroke-width.%]="_circleStrokeWidth"></circle>\n</svg>\n',changeDetection:t.ChangeDetectionStrategy.OnPush,encapsulation:t.ViewEncapsulation.None,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 2000ms 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:4000ms;animation-timing-function:cubic-bezier(0.35, 0, 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 10000ms cubic-bezier(0.87, 0.03, 0.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(0deg)}100%{transform:rotate(360deg)}}@keyframes mat-progress-spinner-stroke-rotate-100{0%{stroke-dashoffset:268.606171575px;transform:rotate(0)}12.5%{stroke-dashoffset:56.5486677px;transform:rotate(0)}12.5001%{stroke-dashoffset:56.5486677px;transform:rotateX(180deg) rotate(72.5deg)}25%{stroke-dashoffset:268.606171575px;transform:rotateX(180deg) rotate(72.5deg)}25.0001%{stroke-dashoffset:268.606171575px;transform:rotate(270deg)}37.5%{stroke-dashoffset:56.5486677px;transform:rotate(270deg)}37.5001%{stroke-dashoffset:56.5486677px;transform:rotateX(180deg) rotate(161.5deg)}50%{stroke-dashoffset:268.606171575px;transform:rotateX(180deg) rotate(161.5deg)}50.0001%{stroke-dashoffset:268.606171575px;transform:rotate(180deg)}62.5%{stroke-dashoffset:56.5486677px;transform:rotate(180deg)}62.5001%{stroke-dashoffset:56.5486677px;transform:rotateX(180deg) rotate(251.5deg)}75%{stroke-dashoffset:268.606171575px;transform:rotateX(180deg) rotate(251.5deg)}75.0001%{stroke-dashoffset:268.606171575px;transform:rotate(90deg)}87.5%{stroke-dashoffset:56.5486677px;transform:rotate(90deg)}87.5001%{stroke-dashoffset:56.5486677px;transform:rotateX(180deg) rotate(341.5deg)}100%{stroke-dashoffset:268.606171575px;transform:rotateX(180deg) rotate(341.5deg)}}@keyframes mat-progress-spinner-stroke-rotate-fallback{0%{transform:rotate(0deg)}25%{transform:rotate(1170deg)}50%{transform:rotate(2340deg)}75%{transform:rotate(3510deg)}100%{transform:rotate(4680deg)}}\n"]}]}],n.ctorParameters=function(){return[{type:t.ElementRef},{type:s.Platform},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[r.DOCUMENT]}]},{type:String,decorators:[{type:t.Optional},{type:t.Inject,args:[i.ANIMATION_MODULE_TYPE]}]},{type:void 0,decorators:[{type:t.Inject,args:[p]}]}]},n}(l),h=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.MatCommonModule,r.CommonModule],exports:[l,g,n.MatCommonModule],declarations:[l,g]}]}],e}();
/**
* @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
*/
e.MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS=p,e.MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS_FACTORY=c,e.MatProgressSpinner=l,e.MatProgressSpinnerModule=h,e.MatSpinner=g,Object.defineProperty(e,"__esModule",{value:!0})}));