material-progress-spinner.umd.js 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464
  1. /**
  2. * @license
  3. * Copyright Google LLC All Rights Reserved.
  4. *
  5. * Use of this source code is governed by an MIT-style license that can be
  6. * found in the LICENSE file at https://angular.io/license
  7. */
  8. (function (global, factory) {
  9. typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/cdk/coercion'), require('@angular/cdk/platform'), require('@angular/common'), require('@angular/core'), require('@angular/material/core'), require('@angular/platform-browser/animations')) :
  10. typeof define === 'function' && 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'], factory) :
  11. (factory((global.ng = global.ng || {}, global.ng.material = global.ng.material || {}, global.ng.material.progressSpinner = {}),global.ng.cdk.coercion,global.ng.cdk.platform,global.ng.common,global.ng.core,global.ng.material.core,global.ng.platformBrowser.animations));
  12. }(this, (function (exports,coercion,platform,common,core,core$1,animations) { 'use strict';
  13. /*! *****************************************************************************
  14. Copyright (c) Microsoft Corporation. All rights reserved.
  15. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  16. this file except in compliance with the License. You may obtain a copy of the
  17. License at http://www.apache.org/licenses/LICENSE-2.0
  18. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  19. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  20. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  21. MERCHANTABLITY OR NON-INFRINGEMENT.
  22. See the Apache Version 2.0 License for specific language governing permissions
  23. and limitations under the License.
  24. ***************************************************************************** */
  25. /* global Reflect, Promise */
  26. var extendStatics = function(d, b) {
  27. extendStatics = Object.setPrototypeOf ||
  28. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  29. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  30. return extendStatics(d, b);
  31. };
  32. function __extends(d, b) {
  33. extendStatics(d, b);
  34. function __() { this.constructor = d; }
  35. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  36. }
  37. /**
  38. * @fileoverview added by tsickle
  39. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  40. */
  41. /**
  42. * Base reference size of the spinner.
  43. * \@docs-private
  44. * @type {?}
  45. */
  46. var BASE_SIZE = 100;
  47. /**
  48. * Base reference stroke width of the spinner.
  49. * \@docs-private
  50. * @type {?}
  51. */
  52. var BASE_STROKE_WIDTH = 10;
  53. // Boilerplate for applying mixins to MatProgressSpinner.
  54. /**
  55. * \@docs-private
  56. */
  57. var
  58. // Boilerplate for applying mixins to MatProgressSpinner.
  59. /**
  60. * \@docs-private
  61. */
  62. MatProgressSpinnerBase = /** @class */ (function () {
  63. function MatProgressSpinnerBase(_elementRef) {
  64. this._elementRef = _elementRef;
  65. }
  66. return MatProgressSpinnerBase;
  67. }());
  68. /** @type {?} */
  69. var _MatProgressSpinnerMixinBase = core$1.mixinColor(MatProgressSpinnerBase, 'primary');
  70. /**
  71. * Injection token to be used to override the default options for `mat-progress-spinner`.
  72. * @type {?}
  73. */
  74. var MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS = new core.InjectionToken('mat-progress-spinner-default-options', {
  75. providedIn: 'root',
  76. factory: MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS_FACTORY,
  77. });
  78. /**
  79. * \@docs-private
  80. * @return {?}
  81. */
  82. function MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS_FACTORY() {
  83. return { diameter: BASE_SIZE };
  84. }
  85. // .0001 percentage difference is necessary in order to avoid unwanted animation frames
  86. // for example because the animation duration is 4 seconds, .1% accounts to 4ms
  87. // which are enough to see the flicker described in
  88. // https://github.com/angular/components/issues/8984
  89. /** @type {?} */
  90. var INDETERMINATE_ANIMATION_TEMPLATE = "\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";
  91. /**
  92. * `<mat-progress-spinner>` component.
  93. */
  94. var MatProgressSpinner = /** @class */ (function (_super) {
  95. __extends(MatProgressSpinner, _super);
  96. function MatProgressSpinner(_elementRef, platform$$1, _document, animationMode, defaults) {
  97. var _this = _super.call(this, _elementRef) || this;
  98. _this._elementRef = _elementRef;
  99. _this._document = _document;
  100. _this._diameter = BASE_SIZE;
  101. _this._value = 0;
  102. _this._fallbackAnimation = false;
  103. /**
  104. * Mode of the progress circle
  105. */
  106. _this.mode = 'determinate';
  107. /** @type {?} */
  108. var trackedDiameters = MatProgressSpinner._diameters;
  109. // The base size is already inserted via the component's structural styles. We still
  110. // need to track it so we don't end up adding the same styles again.
  111. if (!trackedDiameters.has(_document.head)) {
  112. trackedDiameters.set(_document.head, new Set([BASE_SIZE]));
  113. }
  114. _this._styleRoot = _getShadowRoot(_elementRef.nativeElement, _document) || _document.head;
  115. _this._fallbackAnimation = platform$$1.EDGE || platform$$1.TRIDENT;
  116. _this._noopAnimations = animationMode === 'NoopAnimations' &&
  117. (!!defaults && !defaults._forceAnimations);
  118. if (defaults) {
  119. if (defaults.diameter) {
  120. _this.diameter = defaults.diameter;
  121. }
  122. if (defaults.strokeWidth) {
  123. _this.strokeWidth = defaults.strokeWidth;
  124. }
  125. }
  126. // On IE and Edge, we can't animate the `stroke-dashoffset`
  127. // reliably so we fall back to a non-spec animation.
  128. /** @type {?} */
  129. var animationClass = "mat-progress-spinner-indeterminate" + (_this._fallbackAnimation ? '-fallback' : '') + "-animation";
  130. _elementRef.nativeElement.classList.add(animationClass);
  131. return _this;
  132. }
  133. Object.defineProperty(MatProgressSpinner.prototype, "diameter", {
  134. /** The diameter of the progress spinner (will set width and height of svg). */
  135. get: /**
  136. * The diameter of the progress spinner (will set width and height of svg).
  137. * @return {?}
  138. */
  139. function () { return this._diameter; },
  140. set: /**
  141. * @param {?} size
  142. * @return {?}
  143. */
  144. function (size) {
  145. this._diameter = coercion.coerceNumberProperty(size);
  146. if (!this._fallbackAnimation) {
  147. /** @type {?} */
  148. var trackedDiameters = MatProgressSpinner._diameters;
  149. /** @type {?} */
  150. var diametersForElement = trackedDiameters.get(this._styleRoot);
  151. if (!diametersForElement || !diametersForElement.has(this._diameter)) {
  152. this._attachStyleNode();
  153. }
  154. }
  155. },
  156. enumerable: true,
  157. configurable: true
  158. });
  159. Object.defineProperty(MatProgressSpinner.prototype, "strokeWidth", {
  160. /** Stroke width of the progress spinner. */
  161. get: /**
  162. * Stroke width of the progress spinner.
  163. * @return {?}
  164. */
  165. function () {
  166. return this._strokeWidth || this.diameter / 10;
  167. },
  168. set: /**
  169. * @param {?} value
  170. * @return {?}
  171. */
  172. function (value) {
  173. this._strokeWidth = coercion.coerceNumberProperty(value);
  174. },
  175. enumerable: true,
  176. configurable: true
  177. });
  178. Object.defineProperty(MatProgressSpinner.prototype, "value", {
  179. /** Value of the progress circle. */
  180. get: /**
  181. * Value of the progress circle.
  182. * @return {?}
  183. */
  184. function () {
  185. return this.mode === 'determinate' ? this._value : 0;
  186. },
  187. set: /**
  188. * @param {?} newValue
  189. * @return {?}
  190. */
  191. function (newValue) {
  192. this._value = Math.max(0, Math.min(100, coercion.coerceNumberProperty(newValue)));
  193. },
  194. enumerable: true,
  195. configurable: true
  196. });
  197. Object.defineProperty(MatProgressSpinner.prototype, "_circleRadius", {
  198. /** The radius of the spinner, adjusted for stroke width. */
  199. get: /**
  200. * The radius of the spinner, adjusted for stroke width.
  201. * @return {?}
  202. */
  203. function () {
  204. return (this.diameter - BASE_STROKE_WIDTH) / 2;
  205. },
  206. enumerable: true,
  207. configurable: true
  208. });
  209. Object.defineProperty(MatProgressSpinner.prototype, "_viewBox", {
  210. /** The view box of the spinner's svg element. */
  211. get: /**
  212. * The view box of the spinner's svg element.
  213. * @return {?}
  214. */
  215. function () {
  216. /** @type {?} */
  217. var viewBox = this._circleRadius * 2 + this.strokeWidth;
  218. return "0 0 " + viewBox + " " + viewBox;
  219. },
  220. enumerable: true,
  221. configurable: true
  222. });
  223. Object.defineProperty(MatProgressSpinner.prototype, "_strokeCircumference", {
  224. /** The stroke circumference of the svg circle. */
  225. get: /**
  226. * The stroke circumference of the svg circle.
  227. * @return {?}
  228. */
  229. function () {
  230. return 2 * Math.PI * this._circleRadius;
  231. },
  232. enumerable: true,
  233. configurable: true
  234. });
  235. Object.defineProperty(MatProgressSpinner.prototype, "_strokeDashOffset", {
  236. /** The dash offset of the svg circle. */
  237. get: /**
  238. * The dash offset of the svg circle.
  239. * @return {?}
  240. */
  241. function () {
  242. if (this.mode === 'determinate') {
  243. return this._strokeCircumference * (100 - this._value) / 100;
  244. }
  245. // In fallback mode set the circle to 80% and rotate it with CSS.
  246. if (this._fallbackAnimation && this.mode === 'indeterminate') {
  247. return this._strokeCircumference * 0.2;
  248. }
  249. return null;
  250. },
  251. enumerable: true,
  252. configurable: true
  253. });
  254. Object.defineProperty(MatProgressSpinner.prototype, "_circleStrokeWidth", {
  255. /** Stroke width of the circle in percent. */
  256. get: /**
  257. * Stroke width of the circle in percent.
  258. * @return {?}
  259. */
  260. function () {
  261. return this.strokeWidth / this.diameter * 100;
  262. },
  263. enumerable: true,
  264. configurable: true
  265. });
  266. /** Dynamically generates a style tag containing the correct animation for this diameter. */
  267. /**
  268. * Dynamically generates a style tag containing the correct animation for this diameter.
  269. * @private
  270. * @return {?}
  271. */
  272. MatProgressSpinner.prototype._attachStyleNode = /**
  273. * Dynamically generates a style tag containing the correct animation for this diameter.
  274. * @private
  275. * @return {?}
  276. */
  277. function () {
  278. /** @type {?} */
  279. var styleTag = this._document.createElement('style');
  280. /** @type {?} */
  281. var styleRoot = this._styleRoot;
  282. /** @type {?} */
  283. var currentDiameter = this._diameter;
  284. /** @type {?} */
  285. var diameters = MatProgressSpinner._diameters;
  286. /** @type {?} */
  287. var diametersForElement = diameters.get(styleRoot);
  288. styleTag.setAttribute('mat-spinner-animation', currentDiameter + '');
  289. styleTag.textContent = this._getAnimationText();
  290. styleRoot.appendChild(styleTag);
  291. if (!diametersForElement) {
  292. diametersForElement = new Set();
  293. diameters.set(styleRoot, diametersForElement);
  294. }
  295. diametersForElement.add(currentDiameter);
  296. };
  297. /** Generates animation styles adjusted for the spinner's diameter. */
  298. /**
  299. * Generates animation styles adjusted for the spinner's diameter.
  300. * @private
  301. * @return {?}
  302. */
  303. MatProgressSpinner.prototype._getAnimationText = /**
  304. * Generates animation styles adjusted for the spinner's diameter.
  305. * @private
  306. * @return {?}
  307. */
  308. function () {
  309. return INDETERMINATE_ANIMATION_TEMPLATE
  310. // Animation should begin at 5% and end at 80%
  311. .replace(/START_VALUE/g, "" + 0.95 * this._strokeCircumference)
  312. .replace(/END_VALUE/g, "" + 0.2 * this._strokeCircumference)
  313. .replace(/DIAMETER/g, "" + this.diameter);
  314. };
  315. /**
  316. * Tracks diameters of existing instances to de-dupe generated styles (default d = 100).
  317. * We need to keep track of which elements the diameters were attached to, because for
  318. * elements in the Shadow DOM the style tags are attached to the shadow root, rather
  319. * than the document head.
  320. */
  321. MatProgressSpinner._diameters = new WeakMap();
  322. MatProgressSpinner.decorators = [
  323. { type: core.Component, args: [{selector: 'mat-progress-spinner',
  324. exportAs: 'matProgressSpinner',
  325. host: {
  326. 'role': 'progressbar',
  327. 'class': 'mat-progress-spinner',
  328. '[class._mat-animation-noopable]': "_noopAnimations",
  329. '[style.width.px]': 'diameter',
  330. '[style.height.px]': 'diameter',
  331. '[attr.aria-valuemin]': 'mode === "determinate" ? 0 : null',
  332. '[attr.aria-valuemax]': 'mode === "determinate" ? 100 : null',
  333. '[attr.aria-valuenow]': 'mode === "determinate" ? value : null',
  334. '[attr.mode]': 'mode',
  335. },
  336. inputs: ['color'],
  337. 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>",
  338. 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)}}"],
  339. changeDetection: core.ChangeDetectionStrategy.OnPush,
  340. encapsulation: core.ViewEncapsulation.None,
  341. },] },
  342. ];
  343. /** @nocollapse */
  344. MatProgressSpinner.ctorParameters = function () { return [
  345. { type: core.ElementRef },
  346. { type: platform.Platform },
  347. { type: undefined, decorators: [{ type: core.Optional }, { type: core.Inject, args: [common.DOCUMENT,] }] },
  348. { type: String, decorators: [{ type: core.Optional }, { type: core.Inject, args: [animations.ANIMATION_MODULE_TYPE,] }] },
  349. { type: undefined, decorators: [{ type: core.Inject, args: [MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS,] }] }
  350. ]; };
  351. MatProgressSpinner.propDecorators = {
  352. diameter: [{ type: core.Input }],
  353. strokeWidth: [{ type: core.Input }],
  354. mode: [{ type: core.Input }],
  355. value: [{ type: core.Input }]
  356. };
  357. return MatProgressSpinner;
  358. }(_MatProgressSpinnerMixinBase));
  359. /**
  360. * `<mat-spinner>` component.
  361. *
  362. * This is a component definition to be used as a convenience reference to create an
  363. * indeterminate `<mat-progress-spinner>` instance.
  364. */
  365. var MatSpinner = /** @class */ (function (_super) {
  366. __extends(MatSpinner, _super);
  367. function MatSpinner(elementRef, platform$$1, document, animationMode, defaults) {
  368. var _this = _super.call(this, elementRef, platform$$1, document, animationMode, defaults) || this;
  369. _this.mode = 'indeterminate';
  370. return _this;
  371. }
  372. MatSpinner.decorators = [
  373. { type: core.Component, args: [{selector: 'mat-spinner',
  374. host: {
  375. 'role': 'progressbar',
  376. 'mode': 'indeterminate',
  377. 'class': 'mat-spinner mat-progress-spinner',
  378. '[class._mat-animation-noopable]': "_noopAnimations",
  379. '[style.width.px]': 'diameter',
  380. '[style.height.px]': 'diameter',
  381. },
  382. inputs: ['color'],
  383. 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>",
  384. 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)}}"],
  385. changeDetection: core.ChangeDetectionStrategy.OnPush,
  386. encapsulation: core.ViewEncapsulation.None,
  387. },] },
  388. ];
  389. /** @nocollapse */
  390. MatSpinner.ctorParameters = function () { return [
  391. { type: core.ElementRef },
  392. { type: platform.Platform },
  393. { type: undefined, decorators: [{ type: core.Optional }, { type: core.Inject, args: [common.DOCUMENT,] }] },
  394. { type: String, decorators: [{ type: core.Optional }, { type: core.Inject, args: [animations.ANIMATION_MODULE_TYPE,] }] },
  395. { type: undefined, decorators: [{ type: core.Inject, args: [MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS,] }] }
  396. ]; };
  397. return MatSpinner;
  398. }(MatProgressSpinner));
  399. /**
  400. * Gets the shadow root of an element, if supported and the element is inside the Shadow DOM.
  401. * @param {?} element
  402. * @param {?} _document
  403. * @return {?}
  404. */
  405. function _getShadowRoot(element, _document) {
  406. // TODO(crisbeto): see whether we should move this into the CDK
  407. // feature detection utilities once #15616 gets merged in.
  408. if (typeof window !== 'undefined') {
  409. /** @type {?} */
  410. var head = _document.head;
  411. // Check whether the browser supports Shadow DOM.
  412. if (head && (((/** @type {?} */ (head))).createShadowRoot || head.attachShadow)) {
  413. /** @type {?} */
  414. var rootNode = element.getRootNode ? element.getRootNode() : null;
  415. // We need to take the `ShadowRoot` off of `window`, because the built-in types are
  416. // incorrect. See https://github.com/Microsoft/TypeScript/issues/27929.
  417. if (rootNode instanceof ((/** @type {?} */ (window))).ShadowRoot) {
  418. return rootNode;
  419. }
  420. }
  421. }
  422. return null;
  423. }
  424. /**
  425. * @fileoverview added by tsickle
  426. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  427. */
  428. var MatProgressSpinnerModule = /** @class */ (function () {
  429. function MatProgressSpinnerModule() {
  430. }
  431. MatProgressSpinnerModule.decorators = [
  432. { type: core.NgModule, args: [{
  433. imports: [core$1.MatCommonModule, common.CommonModule],
  434. exports: [
  435. MatProgressSpinner,
  436. MatSpinner,
  437. core$1.MatCommonModule
  438. ],
  439. declarations: [
  440. MatProgressSpinner,
  441. MatSpinner
  442. ],
  443. },] },
  444. ];
  445. return MatProgressSpinnerModule;
  446. }());
  447. exports.MatProgressSpinner = MatProgressSpinner;
  448. exports.MatSpinner = MatSpinner;
  449. exports.MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS = MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS;
  450. exports.MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS_FACTORY = MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS_FACTORY;
  451. exports.MatProgressSpinnerModule = MatProgressSpinnerModule;
  452. Object.defineProperty(exports, '__esModule', { value: true });
  453. })));
  454. //# sourceMappingURL=material-progress-spinner.umd.js.map