/** * @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 */ import { Injectable, NgModule } from '@angular/core'; import { MatIconRegistry } from '@angular/material/icon'; import { of as observableOf } from 'rxjs'; import * as i0 from "@angular/core"; /** * A null icon registry that must be imported to allow disabling of custom * icons. */ export class FakeMatIconRegistry { addSvgIcon() { return this; } addSvgIconLiteral() { return this; } addSvgIconInNamespace() { return this; } addSvgIconLiteralInNamespace() { return this; } addSvgIconSet() { return this; } addSvgIconSetLiteral() { return this; } addSvgIconSetInNamespace() { return this; } addSvgIconSetLiteralInNamespace() { return this; } registerFontClassAlias() { return this; } classNameForFontAlias(alias) { return alias; } getDefaultFontSetClass() { return ['material-icons']; } getSvgIconFromUrl() { return observableOf(this._generateEmptySvg()); } getNamedSvgIcon() { return observableOf(this._generateEmptySvg()); } setDefaultFontSetClass() { return this; } addSvgIconResolver() { return this; } ngOnDestroy() { } _generateEmptySvg() { const emptySvg = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); emptySvg.classList.add('fake-testing-svg'); // Emulate real icon characteristics from `MatIconRegistry` so size remains consistent in tests. emptySvg.setAttribute('fit', ''); emptySvg.setAttribute('height', '100%'); emptySvg.setAttribute('width', '100%'); emptySvg.setAttribute('preserveAspectRatio', 'xMidYMid meet'); emptySvg.setAttribute('focusable', 'false'); return emptySvg; } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: FakeMatIconRegistry, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); } static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: FakeMatIconRegistry }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: FakeMatIconRegistry, decorators: [{ type: Injectable }] }); /** Import this module in tests to install the null icon registry. */ export class MatIconTestingModule { static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: MatIconTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); } static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.1", ngImport: i0, type: MatIconTestingModule }); } static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: MatIconTestingModule, providers: [{ provide: MatIconRegistry, useClass: FakeMatIconRegistry }] }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: MatIconTestingModule, decorators: [{ type: NgModule, args: [{ providers: [{ provide: MatIconRegistry, useClass: FakeMatIconRegistry }], }] }] }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFrZS1pY29uLXJlZ2lzdHJ5LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vc3JjL21hdGVyaWFsL2ljb24vdGVzdGluZy9mYWtlLWljb24tcmVnaXN0cnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HO0FBRUgsT0FBTyxFQUFDLFVBQVUsRUFBRSxRQUFRLEVBQVksTUFBTSxlQUFlLENBQUM7QUFDOUQsT0FBTyxFQUFDLGVBQWUsRUFBQyxNQUFNLHdCQUF3QixDQUFDO0FBQ3ZELE9BQU8sRUFBYSxFQUFFLElBQUksWUFBWSxFQUFDLE1BQU0sTUFBTSxDQUFDOztBQU1wRDs7O0dBR0c7QUFFSCxNQUFNLE9BQU8sbUJBQW1CO0lBQzlCLFVBQVU7UUFDUixPQUFPLElBQUksQ0FBQztJQUNkLENBQUM7SUFFRCxpQkFBaUI7UUFDZixPQUFPLElBQUksQ0FBQztJQUNkLENBQUM7SUFFRCxxQkFBcUI7UUFDbkIsT0FBTyxJQUFJLENBQUM7SUFDZCxDQUFDO0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