legacy-progress-bar.mjs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. import * as i0 from '@angular/core';
  2. import { EventEmitter, Component, ChangeDetectionStrategy, ViewEncapsulation, Optional, Inject, Input, ViewChild, Output, NgModule } from '@angular/core';
  3. import * as i1 from '@angular/common';
  4. import { CommonModule } from '@angular/common';
  5. import { mixinColor, MatCommonModule } from '@angular/material/core';
  6. import { coerceNumberProperty } from '@angular/cdk/coercion';
  7. import { MAT_PROGRESS_BAR_LOCATION, MAT_PROGRESS_BAR_DEFAULT_OPTIONS } from '@angular/material/progress-bar';
  8. export { MAT_PROGRESS_BAR_DEFAULT_OPTIONS as MAT_LEGACY_PROGRESS_BAR_DEFAULT_OPTIONS, MAT_PROGRESS_BAR_LOCATION as MAT_LEGACY_PROGRESS_BAR_LOCATION, MAT_PROGRESS_BAR_LOCATION_FACTORY as MAT_LEGACY_PROGRESS_BAR_LOCATION_FACTORY } from '@angular/material/progress-bar';
  9. import { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations';
  10. import { Subscription, fromEvent } from 'rxjs';
  11. import { filter } from 'rxjs/operators';
  12. // TODO(josephperrott): Add ARIA attributes for progress bar "for".
  13. // Boilerplate for applying mixins to MatProgressBar.
  14. /** @docs-private */
  15. const _MatProgressBarBase = mixinColor(class {
  16. constructor(_elementRef) {
  17. this._elementRef = _elementRef;
  18. }
  19. }, 'primary');
  20. /** Counter used to generate unique IDs for progress bars. */
  21. let progressbarId = 0;
  22. /**
  23. * `<mat-progress-bar>` component.
  24. * @deprecated Use `MatProgressBar` from `@angular/material/progress-bar` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
  25. * @breaking-change 17.0.0
  26. */
  27. class MatLegacyProgressBar extends _MatProgressBarBase {
  28. constructor(elementRef, _ngZone, _animationMode,
  29. /**
  30. * @deprecated `location` parameter to be made required.
  31. * @breaking-change 8.0.0
  32. */
  33. location, defaults,
  34. /**
  35. * @deprecated `_changeDetectorRef` parameter to be made required.
  36. * @breaking-change 11.0.0
  37. */
  38. _changeDetectorRef) {
  39. super(elementRef);
  40. this._ngZone = _ngZone;
  41. this._animationMode = _animationMode;
  42. this._changeDetectorRef = _changeDetectorRef;
  43. /** Flag that indicates whether NoopAnimations mode is set to true. */
  44. this._isNoopAnimation = false;
  45. this._value = 0;
  46. this._bufferValue = 0;
  47. /**
  48. * Event emitted when animation of the primary progress bar completes. This event will not
  49. * be emitted when animations are disabled, nor will it be emitted for modes with continuous
  50. * animations (indeterminate and query).
  51. */
  52. this.animationEnd = new EventEmitter();
  53. /** Reference to animation end subscription to be unsubscribed on destroy. */
  54. this._animationEndSubscription = Subscription.EMPTY;
  55. /**
  56. * Mode of the progress bar.
  57. *
  58. * Input must be one of these values: determinate, indeterminate, buffer, query, defaults to
  59. * 'determinate'.
  60. * Mirrored to mode attribute.
  61. */
  62. this.mode = 'determinate';
  63. /** ID of the progress bar. */
  64. this.progressbarId = `mat-progress-bar-${progressbarId++}`;
  65. // We need to prefix the SVG reference with the current path, otherwise they won't work
  66. // in Safari if the page has a `<base>` tag. Note that we need quotes inside the `url()`,
  67. // because named route URLs can contain parentheses (see #12338). Also we don't use `Location`
  68. // since we can't tell the difference between whether the consumer is using the hash location
  69. // strategy or not, because `Location` normalizes both `/#/foo/bar` and `/foo/bar` to
  70. // the same thing.
  71. const path = location ? location.getPathname().split('#')[0] : '';
  72. this._rectangleFillValue = `url('${path}#${this.progressbarId}')`;
  73. this._isNoopAnimation = _animationMode === 'NoopAnimations';
  74. if (defaults) {
  75. if (defaults.color) {
  76. this.color = this.defaultColor = defaults.color;
  77. }
  78. this.mode = defaults.mode || this.mode;
  79. }
  80. }
  81. /** Value of the progress bar. Defaults to zero. Mirrored to aria-valuenow. */
  82. get value() {
  83. return this._value;
  84. }
  85. set value(v) {
  86. this._value = clamp(coerceNumberProperty(v) || 0);
  87. // @breaking-change 11.0.0 Remove null check for _changeDetectorRef.
  88. this._changeDetectorRef?.markForCheck();
  89. }
  90. /** Buffer value of the progress bar. Defaults to zero. */
  91. get bufferValue() {
  92. return this._bufferValue;
  93. }
  94. set bufferValue(v) {
  95. this._bufferValue = clamp(v || 0);
  96. // @breaking-change 11.0.0 Remove null check for _changeDetectorRef.
  97. this._changeDetectorRef?.markForCheck();
  98. }
  99. /** Gets the current transform value for the progress bar's primary indicator. */
  100. _primaryTransform() {
  101. // We use a 3d transform to work around some rendering issues in iOS Safari. See #19328.
  102. const scale = this.value / 100;
  103. return { transform: `scale3d(${scale}, 1, 1)` };
  104. }
  105. /**
  106. * Gets the current transform value for the progress bar's buffer indicator. Only used if the
  107. * progress mode is set to buffer, otherwise returns an undefined, causing no transformation.
  108. */
  109. _bufferTransform() {
  110. if (this.mode === 'buffer') {
  111. // We use a 3d transform to work around some rendering issues in iOS Safari. See #19328.
  112. const scale = this.bufferValue / 100;
  113. return { transform: `scale3d(${scale}, 1, 1)` };
  114. }
  115. return null;
  116. }
  117. ngAfterViewInit() {
  118. // Run outside angular so change detection didn't get triggered on every transition end
  119. // instead only on the animation that we care about (primary value bar's transitionend)
  120. this._ngZone.runOutsideAngular(() => {
  121. const element = this._primaryValueBar.nativeElement;
  122. this._animationEndSubscription = fromEvent(element, 'transitionend')
  123. .pipe(filter((e) => e.target === element))
  124. .subscribe(() => {
  125. if (this.animationEnd.observers.length === 0) {
  126. return;
  127. }
  128. if (this.mode === 'determinate' || this.mode === 'buffer') {
  129. this._ngZone.run(() => this.animationEnd.next({ value: this.value }));
  130. }
  131. });
  132. });
  133. }
  134. ngOnDestroy() {
  135. this._animationEndSubscription.unsubscribe();
  136. }
  137. static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: MatLegacyProgressBar, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: ANIMATION_MODULE_TYPE, optional: true }, { token: MAT_PROGRESS_BAR_LOCATION, optional: true }, { token: MAT_PROGRESS_BAR_DEFAULT_OPTIONS, optional: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
  138. static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: MatLegacyProgressBar, selector: "mat-progress-bar", inputs: { color: "color", value: "value", bufferValue: "bufferValue", mode: "mode" }, outputs: { animationEnd: "animationEnd" }, host: { attributes: { "role": "progressbar", "aria-valuemin": "0", "aria-valuemax": "100", "tabindex": "-1" }, properties: { "attr.aria-valuenow": "(mode === \"indeterminate\" || mode === \"query\") ? null : value", "attr.mode": "mode", "class._mat-animation-noopable": "_isNoopAnimation" }, classAttribute: "mat-progress-bar" }, viewQueries: [{ propertyName: "_primaryValueBar", first: true, predicate: ["primaryValueBar"], descendants: true }], exportAs: ["matProgressBar"], usesInheritance: true, ngImport: i0, template: "<!--\n All children need to be hidden for screen readers in order to support ChromeVox.\n More context in the issue: https://github.com/angular/components/issues/22165.\n-->\n<div aria-hidden=\"true\">\n <svg width=\"100%\" height=\"4\" focusable=\"false\" class=\"mat-progress-bar-background mat-progress-bar-element\">\n <defs>\n <pattern [id]=\"progressbarId\" x=\"4\" y=\"0\" width=\"8\" height=\"4\" patternUnits=\"userSpaceOnUse\">\n <circle cx=\"2\" cy=\"2\" r=\"2\"/>\n </pattern>\n </defs>\n <rect [attr.fill]=\"_rectangleFillValue\" width=\"100%\" height=\"100%\"/>\n </svg>\n <!--\n The background div is named as such because it appears below the other divs and is not sized based\n on values.\n -->\n <div class=\"mat-progress-bar-buffer mat-progress-bar-element\" [ngStyle]=\"_bufferTransform()\"></div>\n <div class=\"mat-progress-bar-primary mat-progress-bar-fill mat-progress-bar-element\" [ngStyle]=\"_primaryTransform()\" #primaryValueBar></div>\n <div class=\"mat-progress-bar-secondary mat-progress-bar-fill mat-progress-bar-element\"></div>\n</div>\n", styles: [".mat-progress-bar{display:block;height:4px;overflow:hidden;position:relative;transition:opacity 250ms linear;width:100%}.mat-progress-bar._mat-animation-noopable{transition:none !important;animation:none !important}.mat-progress-bar .mat-progress-bar-element,.mat-progress-bar .mat-progress-bar-fill::after{height:100%;position:absolute;width:100%}.mat-progress-bar .mat-progress-bar-background{width:calc(100% + 10px)}.cdk-high-contrast-active .mat-progress-bar .mat-progress-bar-background{display:none}.mat-progress-bar .mat-progress-bar-buffer{transform-origin:top left;transition:transform 250ms ease}.cdk-high-contrast-active .mat-progress-bar .mat-progress-bar-buffer{border-top:solid 5px;opacity:.5}.mat-progress-bar .mat-progress-bar-secondary{display:none}.mat-progress-bar .mat-progress-bar-fill{animation:none;transform-origin:top left;transition:transform 250ms ease}.cdk-high-contrast-active .mat-progress-bar .mat-progress-bar-fill{border-top:solid 4px}.mat-progress-bar .mat-progress-bar-fill::after{animation:none;content:\"\";display:inline-block;left:0}.mat-progress-bar[dir=rtl],[dir=rtl] .mat-progress-bar{transform:rotateY(180deg)}.mat-progress-bar[mode=query]{transform:rotateZ(180deg)}.mat-progress-bar[mode=query][dir=rtl],[dir=rtl] .mat-progress-bar[mode=query]{transform:rotateZ(180deg) rotateY(180deg)}.mat-progress-bar[mode=indeterminate] .mat-progress-bar-fill,.mat-progress-bar[mode=query] .mat-progress-bar-fill{transition:none}.mat-progress-bar[mode=indeterminate] .mat-progress-bar-primary,.mat-progress-bar[mode=query] .mat-progress-bar-primary{-webkit-backface-visibility:hidden;backface-visibility:hidden;animation:mat-progress-bar-primary-indeterminate-translate 2000ms infinite linear;left:-145.166611%}.mat-progress-bar[mode=indeterminate] .mat-progress-bar-primary.mat-progress-bar-fill::after,.mat-progress-bar[mode=query] .mat-progress-bar-primary.mat-progress-bar-fill::after{-webkit-backface-visibility:hidden;backface-visibility:hidden;animation:mat-progress-bar-primary-indeterminate-scale 2000ms infinite linear}.mat-progress-bar[mode=indeterminate] .mat-progress-bar-secondary,.mat-progress-bar[mode=query] .mat-progress-bar-secondary{-webkit-backface-visibility:hidden;backface-visibility:hidden;animation:mat-progress-bar-secondary-indeterminate-translate 2000ms infinite linear;left:-54.888891%;display:block}.mat-progress-bar[mode=indeterminate] .mat-progress-bar-secondary.mat-progress-bar-fill::after,.mat-progress-bar[mode=query] .mat-progress-bar-secondary.mat-progress-bar-fill::after{-webkit-backface-visibility:hidden;backface-visibility:hidden;animation:mat-progress-bar-secondary-indeterminate-scale 2000ms infinite linear}.mat-progress-bar[mode=buffer] .mat-progress-bar-background{-webkit-backface-visibility:hidden;backface-visibility:hidden;animation:mat-progress-bar-background-scroll 250ms infinite linear;display:block}.mat-progress-bar._mat-animation-noopable .mat-progress-bar-fill,.mat-progress-bar._mat-animation-noopable .mat-progress-bar-fill::after,.mat-progress-bar._mat-animation-noopable .mat-progress-bar-buffer,.mat-progress-bar._mat-animation-noopable .mat-progress-bar-primary,.mat-progress-bar._mat-animation-noopable .mat-progress-bar-primary.mat-progress-bar-fill::after,.mat-progress-bar._mat-animation-noopable .mat-progress-bar-secondary,.mat-progress-bar._mat-animation-noopable .mat-progress-bar-secondary.mat-progress-bar-fill::after,.mat-progress-bar._mat-animation-noopable .mat-progress-bar-background{animation:none;transition-duration:1ms}@keyframes mat-progress-bar-primary-indeterminate-translate{0%{transform:translateX(0)}20%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(0)}59.15%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(83.67142%)}100%{transform:translateX(200.611057%)}}@keyframes mat-progress-bar-primary-indeterminate-scale{0%{transform:scaleX(0.08)}36.65%{animation-timing-function:cubic-bezier(0.334731, 0.12482, 0.785844, 1);transform:scaleX(0.08)}69.15%{animation-timing-function:cubic-bezier(0.06, 0.11, 0.6, 1);transform:scaleX(0.661479)}100%{transform:scaleX(0.08)}}@keyframes mat-progress-bar-secondary-indeterminate-translate{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);transform:translateX(0)}25%{animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);transform:translateX(37.651913%)}48.35%{animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);transform:translateX(84.386165%)}100%{transform:translateX(160.277782%)}}@keyframes mat-progress-bar-secondary-indeterminate-scale{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);transform:scaleX(0.08)}19.15%{animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);transform:scaleX(0.457104)}44.15%{animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);transform:scaleX(0.72796)}100%{transform:scaleX(0.08)}}@keyframes mat-progress-bar-background-scroll{to{transform:translateX(-8px)}}"], dependencies: [{ kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
  139. }
  140. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: MatLegacyProgressBar, decorators: [{
  141. type: Component,
  142. args: [{ selector: 'mat-progress-bar', exportAs: 'matProgressBar', host: {
  143. 'role': 'progressbar',
  144. 'aria-valuemin': '0',
  145. 'aria-valuemax': '100',
  146. // set tab index to -1 so screen readers will read the aria-label
  147. // Note: there is a known issue with JAWS that does not read progressbar aria labels on FireFox
  148. 'tabindex': '-1',
  149. '[attr.aria-valuenow]': '(mode === "indeterminate" || mode === "query") ? null : value',
  150. '[attr.mode]': 'mode',
  151. 'class': 'mat-progress-bar',
  152. '[class._mat-animation-noopable]': '_isNoopAnimation',
  153. }, inputs: ['color'], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<!--\n All children need to be hidden for screen readers in order to support ChromeVox.\n More context in the issue: https://github.com/angular/components/issues/22165.\n-->\n<div aria-hidden=\"true\">\n <svg width=\"100%\" height=\"4\" focusable=\"false\" class=\"mat-progress-bar-background mat-progress-bar-element\">\n <defs>\n <pattern [id]=\"progressbarId\" x=\"4\" y=\"0\" width=\"8\" height=\"4\" patternUnits=\"userSpaceOnUse\">\n <circle cx=\"2\" cy=\"2\" r=\"2\"/>\n </pattern>\n </defs>\n <rect [attr.fill]=\"_rectangleFillValue\" width=\"100%\" height=\"100%\"/>\n </svg>\n <!--\n The background div is named as such because it appears below the other divs and is not sized based\n on values.\n -->\n <div class=\"mat-progress-bar-buffer mat-progress-bar-element\" [ngStyle]=\"_bufferTransform()\"></div>\n <div class=\"mat-progress-bar-primary mat-progress-bar-fill mat-progress-bar-element\" [ngStyle]=\"_primaryTransform()\" #primaryValueBar></div>\n <div class=\"mat-progress-bar-secondary mat-progress-bar-fill mat-progress-bar-element\"></div>\n</div>\n", styles: [".mat-progress-bar{display:block;height:4px;overflow:hidden;position:relative;transition:opacity 250ms linear;width:100%}.mat-progress-bar._mat-animation-noopable{transition:none !important;animation:none !important}.mat-progress-bar .mat-progress-bar-element,.mat-progress-bar .mat-progress-bar-fill::after{height:100%;position:absolute;width:100%}.mat-progress-bar .mat-progress-bar-background{width:calc(100% + 10px)}.cdk-high-contrast-active .mat-progress-bar .mat-progress-bar-background{display:none}.mat-progress-bar .mat-progress-bar-buffer{transform-origin:top left;transition:transform 250ms ease}.cdk-high-contrast-active .mat-progress-bar .mat-progress-bar-buffer{border-top:solid 5px;opacity:.5}.mat-progress-bar .mat-progress-bar-secondary{display:none}.mat-progress-bar .mat-progress-bar-fill{animation:none;transform-origin:top left;transition:transform 250ms ease}.cdk-high-contrast-active .mat-progress-bar .mat-progress-bar-fill{border-top:solid 4px}.mat-progress-bar .mat-progress-bar-fill::after{animation:none;content:\"\";display:inline-block;left:0}.mat-progress-bar[dir=rtl],[dir=rtl] .mat-progress-bar{transform:rotateY(180deg)}.mat-progress-bar[mode=query]{transform:rotateZ(180deg)}.mat-progress-bar[mode=query][dir=rtl],[dir=rtl] .mat-progress-bar[mode=query]{transform:rotateZ(180deg) rotateY(180deg)}.mat-progress-bar[mode=indeterminate] .mat-progress-bar-fill,.mat-progress-bar[mode=query] .mat-progress-bar-fill{transition:none}.mat-progress-bar[mode=indeterminate] .mat-progress-bar-primary,.mat-progress-bar[mode=query] .mat-progress-bar-primary{-webkit-backface-visibility:hidden;backface-visibility:hidden;animation:mat-progress-bar-primary-indeterminate-translate 2000ms infinite linear;left:-145.166611%}.mat-progress-bar[mode=indeterminate] .mat-progress-bar-primary.mat-progress-bar-fill::after,.mat-progress-bar[mode=query] .mat-progress-bar-primary.mat-progress-bar-fill::after{-webkit-backface-visibility:hidden;backface-visibility:hidden;animation:mat-progress-bar-primary-indeterminate-scale 2000ms infinite linear}.mat-progress-bar[mode=indeterminate] .mat-progress-bar-secondary,.mat-progress-bar[mode=query] .mat-progress-bar-secondary{-webkit-backface-visibility:hidden;backface-visibility:hidden;animation:mat-progress-bar-secondary-indeterminate-translate 2000ms infinite linear;left:-54.888891%;display:block}.mat-progress-bar[mode=indeterminate] .mat-progress-bar-secondary.mat-progress-bar-fill::after,.mat-progress-bar[mode=query] .mat-progress-bar-secondary.mat-progress-bar-fill::after{-webkit-backface-visibility:hidden;backface-visibility:hidden;animation:mat-progress-bar-secondary-indeterminate-scale 2000ms infinite linear}.mat-progress-bar[mode=buffer] .mat-progress-bar-background{-webkit-backface-visibility:hidden;backface-visibility:hidden;animation:mat-progress-bar-background-scroll 250ms infinite linear;display:block}.mat-progress-bar._mat-animation-noopable .mat-progress-bar-fill,.mat-progress-bar._mat-animation-noopable .mat-progress-bar-fill::after,.mat-progress-bar._mat-animation-noopable .mat-progress-bar-buffer,.mat-progress-bar._mat-animation-noopable .mat-progress-bar-primary,.mat-progress-bar._mat-animation-noopable .mat-progress-bar-primary.mat-progress-bar-fill::after,.mat-progress-bar._mat-animation-noopable .mat-progress-bar-secondary,.mat-progress-bar._mat-animation-noopable .mat-progress-bar-secondary.mat-progress-bar-fill::after,.mat-progress-bar._mat-animation-noopable .mat-progress-bar-background{animation:none;transition-duration:1ms}@keyframes mat-progress-bar-primary-indeterminate-translate{0%{transform:translateX(0)}20%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(0)}59.15%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(83.67142%)}100%{transform:translateX(200.611057%)}}@keyframes mat-progress-bar-primary-indeterminate-scale{0%{transform:scaleX(0.08)}36.65%{animation-timing-function:cubic-bezier(0.334731, 0.12482, 0.785844, 1);transform:scaleX(0.08)}69.15%{animation-timing-function:cubic-bezier(0.06, 0.11, 0.6, 1);transform:scaleX(0.661479)}100%{transform:scaleX(0.08)}}@keyframes mat-progress-bar-secondary-indeterminate-translate{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);transform:translateX(0)}25%{animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);transform:translateX(37.651913%)}48.35%{animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);transform:translateX(84.386165%)}100%{transform:translateX(160.277782%)}}@keyframes mat-progress-bar-secondary-indeterminate-scale{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);transform:scaleX(0.08)}19.15%{animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);transform:scaleX(0.457104)}44.15%{animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);transform:scaleX(0.72796)}100%{transform:scaleX(0.08)}}@keyframes mat-progress-bar-background-scroll{to{transform:translateX(-8px)}}"] }]
  154. }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: undefined, decorators: [{
  155. type: Optional
  156. }, {
  157. type: Inject,
  158. args: [ANIMATION_MODULE_TYPE]
  159. }] }, { type: undefined, decorators: [{
  160. type: Optional
  161. }, {
  162. type: Inject,
  163. args: [MAT_PROGRESS_BAR_LOCATION]
  164. }] }, { type: undefined, decorators: [{
  165. type: Optional
  166. }, {
  167. type: Inject,
  168. args: [MAT_PROGRESS_BAR_DEFAULT_OPTIONS]
  169. }] }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { value: [{
  170. type: Input
  171. }], bufferValue: [{
  172. type: Input
  173. }], _primaryValueBar: [{
  174. type: ViewChild,
  175. args: ['primaryValueBar']
  176. }], animationEnd: [{
  177. type: Output
  178. }], mode: [{
  179. type: Input
  180. }] } });
  181. /** Clamps a value to be between two numbers, by default 0 and 100. */
  182. function clamp(v, min = 0, max = 100) {
  183. return Math.max(min, Math.min(max, v));
  184. }
  185. /**
  186. * @deprecated Use `MatProgressBarModule` from `@angular/material/progress-bar` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
  187. * @breaking-change 17.0.0
  188. */
  189. class MatLegacyProgressBarModule {
  190. static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: MatLegacyProgressBarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
  191. static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.0", ngImport: i0, type: MatLegacyProgressBarModule, declarations: [MatLegacyProgressBar], imports: [CommonModule, MatCommonModule], exports: [MatLegacyProgressBar, MatCommonModule] }); }
  192. static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: MatLegacyProgressBarModule, imports: [CommonModule, MatCommonModule, MatCommonModule] }); }
  193. }
  194. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: MatLegacyProgressBarModule, decorators: [{
  195. type: NgModule,
  196. args: [{
  197. imports: [CommonModule, MatCommonModule],
  198. exports: [MatLegacyProgressBar, MatCommonModule],
  199. declarations: [MatLegacyProgressBar],
  200. }]
  201. }] });
  202. /**
  203. * Generated bundle index. Do not edit.
  204. */
  205. export { MatLegacyProgressBar, MatLegacyProgressBarModule };
  206. //# sourceMappingURL=legacy-progress-bar.mjs.map