{"version":3,"file":"legacy-progress-bar.mjs","sources":["../../../../../../src/material/legacy-progress-bar/progress-bar.ts","../../../../../../src/material/legacy-progress-bar/progress-bar.html","../../../../../../src/material/legacy-progress-bar/progress-bar-module.ts","../../../../../../src/material/legacy-progress-bar/legacy-progress-bar_public_index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {coerceNumberProperty, NumberInput} from '@angular/cdk/coercion';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n Inject,\n Input,\n NgZone,\n OnDestroy,\n Optional,\n Output,\n ViewChild,\n ViewEncapsulation,\n ChangeDetectorRef,\n} from '@angular/core';\nimport {CanColor, mixinColor} from '@angular/material/core';\nimport {\n MatProgressBarDefaultOptions,\n MAT_PROGRESS_BAR_DEFAULT_OPTIONS,\n ProgressAnimationEnd,\n ProgressBarMode,\n MAT_PROGRESS_BAR_LOCATION,\n MatProgressBarLocation,\n} from '@angular/material/progress-bar';\nimport {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';\nimport {fromEvent, Observable, Subscription} from 'rxjs';\nimport {filter} from 'rxjs/operators';\n\n// TODO(josephperrott): Add ARIA attributes for progress bar \"for\".\n\n// Boilerplate for applying mixins to MatProgressBar.\n/** @docs-private */\nconst _MatProgressBarBase = mixinColor(\n class {\n constructor(public _elementRef: ElementRef) {}\n },\n 'primary',\n);\n\n/** Counter used to generate unique IDs for progress bars. */\nlet progressbarId = 0;\n\n/**\n * `` component.\n * @deprecated Use `MatProgressBar` from `@angular/material/progress-bar` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@Component({\n selector: 'mat-progress-bar',\n exportAs: 'matProgressBar',\n host: {\n 'role': 'progressbar',\n 'aria-valuemin': '0',\n 'aria-valuemax': '100',\n // set tab index to -1 so screen readers will read the aria-label\n // Note: there is a known issue with JAWS that does not read progressbar aria labels on FireFox\n 'tabindex': '-1',\n '[attr.aria-valuenow]': '(mode === \"indeterminate\" || mode === \"query\") ? null : value',\n '[attr.mode]': 'mode',\n 'class': 'mat-progress-bar',\n '[class._mat-animation-noopable]': '_isNoopAnimation',\n },\n inputs: ['color'],\n templateUrl: 'progress-bar.html',\n styleUrls: ['progress-bar.css'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class MatLegacyProgressBar\n extends _MatProgressBarBase\n implements CanColor, AfterViewInit, OnDestroy\n{\n constructor(\n elementRef: ElementRef,\n private _ngZone: NgZone,\n @Optional() @Inject(ANIMATION_MODULE_TYPE) public _animationMode?: string,\n /**\n * @deprecated `location` parameter to be made required.\n * @breaking-change 8.0.0\n */\n @Optional() @Inject(MAT_PROGRESS_BAR_LOCATION) location?: MatProgressBarLocation,\n @Optional()\n @Inject(MAT_PROGRESS_BAR_DEFAULT_OPTIONS)\n defaults?: MatProgressBarDefaultOptions,\n /**\n * @deprecated `_changeDetectorRef` parameter to be made required.\n * @breaking-change 11.0.0\n */\n private _changeDetectorRef?: ChangeDetectorRef,\n ) {\n super(elementRef);\n\n // We need to prefix the SVG reference with the current path, otherwise they won't work\n // in Safari if the page has a `` tag. Note that we need quotes inside the `url()`,\n // because named route URLs can contain parentheses (see #12338). Also we don't use `Location`\n // since we can't tell the difference between whether the consumer is using the hash location\n // strategy or not, because `Location` normalizes both `/#/foo/bar` and `/foo/bar` to\n // the same thing.\n const path = location ? location.getPathname().split('#')[0] : '';\n this._rectangleFillValue = `url('${path}#${this.progressbarId}')`;\n this._isNoopAnimation = _animationMode === 'NoopAnimations';\n\n if (defaults) {\n if (defaults.color) {\n this.color = this.defaultColor = defaults.color;\n }\n\n this.mode = defaults.mode || this.mode;\n }\n }\n\n /** Flag that indicates whether NoopAnimations mode is set to true. */\n _isNoopAnimation = false;\n\n /** Value of the progress bar. Defaults to zero. Mirrored to aria-valuenow. */\n @Input()\n get value(): number {\n return this._value;\n }\n set value(v: NumberInput) {\n this._value = clamp(coerceNumberProperty(v) || 0);\n\n // @breaking-change 11.0.0 Remove null check for _changeDetectorRef.\n this._changeDetectorRef?.markForCheck();\n }\n private _value: number = 0;\n\n /** Buffer value of the progress bar. Defaults to zero. */\n @Input()\n get bufferValue(): number {\n return this._bufferValue;\n }\n set bufferValue(v: number) {\n this._bufferValue = clamp(v || 0);\n\n // @breaking-change 11.0.0 Remove null check for _changeDetectorRef.\n this._changeDetectorRef?.markForCheck();\n }\n private _bufferValue: number = 0;\n\n @ViewChild('primaryValueBar') _primaryValueBar: ElementRef;\n\n /**\n * Event emitted when animation of the primary progress bar completes. This event will not\n * be emitted when animations are disabled, nor will it be emitted for modes with continuous\n * animations (indeterminate and query).\n */\n @Output() readonly animationEnd = new EventEmitter();\n\n /** Reference to animation end subscription to be unsubscribed on destroy. */\n private _animationEndSubscription: Subscription = Subscription.EMPTY;\n\n /**\n * Mode of the progress bar.\n *\n * Input must be one of these values: determinate, indeterminate, buffer, query, defaults to\n * 'determinate'.\n * Mirrored to mode attribute.\n */\n @Input() mode: ProgressBarMode = 'determinate';\n\n /** ID of the progress bar. */\n progressbarId = `mat-progress-bar-${progressbarId++}`;\n\n /** Attribute to be used for the `fill` attribute on the internal `rect` element. */\n _rectangleFillValue: string;\n\n /** Gets the current transform value for the progress bar's primary indicator. */\n _primaryTransform() {\n // We use a 3d transform to work around some rendering issues in iOS Safari. See #19328.\n const scale = this.value / 100;\n return {transform: `scale3d(${scale}, 1, 1)`};\n }\n\n /**\n * Gets the current transform value for the progress bar's buffer indicator. Only used if the\n * progress mode is set to buffer, otherwise returns an undefined, causing no transformation.\n */\n _bufferTransform() {\n if (this.mode === 'buffer') {\n // We use a 3d transform to work around some rendering issues in iOS Safari. See #19328.\n const scale = this.bufferValue / 100;\n return {transform: `scale3d(${scale}, 1, 1)`};\n }\n return null;\n }\n\n ngAfterViewInit() {\n // Run outside angular so change detection didn't get triggered on every transition end\n // instead only on the animation that we care about (primary value bar's transitionend)\n this._ngZone.runOutsideAngular(() => {\n const element = this._primaryValueBar.nativeElement;\n\n this._animationEndSubscription = (\n fromEvent(element, 'transitionend') as Observable\n )\n .pipe(filter((e: TransitionEvent) => e.target === element))\n .subscribe(() => {\n if (this.animationEnd.observers.length === 0) {\n return;\n }\n\n if (this.mode === 'determinate' || this.mode === 'buffer') {\n this._ngZone.run(() => this.animationEnd.next({value: this.value}));\n }\n });\n });\n }\n\n ngOnDestroy() {\n this._animationEndSubscription.unsubscribe();\n }\n}\n\n/** Clamps a value to be between two numbers, by default 0 and 100. */\nfunction clamp(v: number, min = 0, max = 100) {\n return Math.max(min, Math.min(max, v));\n}\n","\n
\n \n \n \n \n \n \n \n \n \n
\n
\n
\n
\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {MatCommonModule} from '@angular/material/core';\nimport {MatLegacyProgressBar} from './progress-bar';\n\n/**\n * @deprecated Use `MatProgressBarModule` from `@angular/material/progress-bar` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@NgModule({\n imports: [CommonModule, MatCommonModule],\n exports: [MatLegacyProgressBar, MatCommonModule],\n declarations: [MatLegacyProgressBar],\n})\nexport class MatLegacyProgressBarModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AAqCA;AAEA;AACA;AACA,MAAM,mBAAmB,GAAG,UAAU,CACpC,MAAA;AACE,IAAA,WAAA,CAAmB,WAAuB,EAAA;QAAvB,IAAW,CAAA,WAAA,GAAX,WAAW,CAAY;KAAI;CAC/C,EACD,SAAS,CACV,CAAC;AAEF;AACA,IAAI,aAAa,GAAG,CAAC,CAAC;AAEtB;;;;AAIG;AAsBG,MAAO,oB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