@ng-icons/core 18.0.2 → 18.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import { InjectionToken } from '@angular/core';
|
|
2
1
|
import { IconService } from './icon.service';
|
|
3
2
|
export function provideIcons(icons) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
provide: ICONS_TOKEN,
|
|
7
|
-
useFactory: () => IconService.addIcons(icons),
|
|
8
|
-
},
|
|
9
|
-
];
|
|
3
|
+
IconService.addIcons(icons);
|
|
4
|
+
return [];
|
|
10
5
|
}
|
|
11
|
-
|
|
12
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWNvbi5wcm92aWRlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvcmUvc3JjL2xpYi9pY29uLnByb3ZpZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxjQUFjLEVBQVksTUFBTSxlQUFlLENBQUM7QUFDekQsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBRTdDLE1BQU0sVUFBVSxZQUFZLENBQUMsS0FBNkI7SUFDeEQsT0FBTztRQUNMO1lBQ0UsT0FBTyxFQUFFLFdBQVc7WUFDcEIsVUFBVSxFQUFFLEdBQUcsRUFBRSxDQUFDLFdBQVcsQ0FBQyxRQUFRLENBQUMsS0FBSyxDQUFDO1NBQzlDO0tBQ0YsQ0FBQztBQUNKLENBQUM7QUFFRCxNQUFNLFdBQVcsR0FBRyxJQUFJLGNBQWMsQ0FBQyxrQkFBa0IsQ0FBQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgSW5qZWN0aW9uVG9rZW4sIFByb3ZpZGVyIH0gZnJ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dHJpbmc+KTogUHJvdmlkZXJbXSB7XG4gIEljb25TZXJ2aWNlLmFkZEljb25zKGljb25zKTtcblxuICByZXR1cm4gW107XG59XG4iXX0=
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, Component, ChangeDetectionStrategy, Input, HostBinding, NgModule
|
|
2
|
+
import { Injectable, Component, ChangeDetectionStrategy, Input, HostBinding, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/platform-browser';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -136,14 +136,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0", ngImpor
|
|
|
136
136
|
}], ctorParameters: function () { return [{ type: IconService }]; } });
|
|
137
137
|
|
|
138
138
|
function provideIcons(icons) {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
provide: ICONS_TOKEN,
|
|
142
|
-
useFactory: () => IconService.addIcons(icons),
|
|
143
|
-
},
|
|
144
|
-
];
|
|
139
|
+
IconService.addIcons(icons);
|
|
140
|
+
return [];
|
|
145
141
|
}
|
|
146
|
-
const ICONS_TOKEN = new InjectionToken('noop icons token');
|
|
147
142
|
|
|
148
143
|
/**
|
|
149
144
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-icons-core.mjs","sources":["../../../../packages/core/src/lib/utils/format.ts","../../../../packages/core/src/lib/icon.service.ts","../../../../packages/core/src/lib/icon.component.ts","../../../../packages/core/src/lib/icon.module.ts","../../../../packages/core/src/lib/icon.provider.ts","../../../../packages/core/src/ng-icons-core.ts"],"sourcesContent":["/**\n * Hyphenated to UpperCamelCase\n */\nexport function toUpperCamelCase(str: string): string {\n return toCapitalCase(toPropertyName(str));\n}\n\n/**\n * Hyphenated to lowerCamelCase\n */\nexport function toPropertyName(str: string): string {\n return str\n .replace(/([^a-zA-Z0-9])+(.)?/g, (_, __, chr) =>\n chr ? chr.toUpperCase() : '',\n )\n .replace(/[^a-zA-Z\\d]/g, '')\n .replace(/^([A-Z])/, m => m.toLowerCase());\n}\n\n/**\n * Capitalizes the first letter of a string\n */\nexport function toCapitalCase(str: string): string {\n return str.charAt(0).toUpperCase() + str.substr(1);\n}\n","import { Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class IconService {\n /** Store the available icons. */\n private static icons: Readonly<Record<string, string>> = {};\n\n /** Access the icons in the class. */\n get icons(): Readonly<Record<string, string>> {\n return IconService.icons;\n }\n\n /**\n * Insert icons into the iconset\n */\n static addIcons(icons: Record<string, string>): void {\n IconService.icons = { ...IconService.icons, ...icons };\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostBinding,\n Input,\n} from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { IconName } from './icon-name';\nimport { IconService } from './icon.service';\nimport { toUpperCamelCase } from './utils/format';\n\n@Component({\n selector: 'ng-icon',\n template: '',\n standalone: true,\n styleUrls: ['./icon.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgIconComponent {\n /** Define the name of the icon to display */\n @Input() set name(name: IconName | string) {\n name = toUpperCamelCase(name);\n\n // if there is no icon with this name warn the user as they probably forgot to import it\n if (!this.iconService.icons.hasOwnProperty(name)) {\n console.warn(\n `No icon named ${name} was found. You may need to import it using the withIcons function.`,\n );\n return;\n }\n\n // insert the SVG into the template\n this.template = this.sanitizer.bypassSecurityTrustHtml(\n this.iconService.icons[name],\n );\n }\n\n /** Store the formatted icon name */\n @HostBinding('innerHTML') template?: SafeHtml;\n\n /** Define the size of the icon */\n @HostBinding('style.--ng-icon__size')\n @Input()\n set size(size: string) {\n // if the size only contains numbers, assume it is in pixels\n this._size = coerceCssPixelValue(size);\n }\n\n get size(): string {\n return this._size;\n }\n\n private _size: string = '1em';\n\n /** Define the stroke-width of the icon */\n @HostBinding('style.--ng-icon__stroke-width')\n @Input()\n strokeWidth?: string | number;\n\n /** Define the color of the icon */\n @HostBinding('style.color')\n @Input()\n color?: string;\n\n constructor(\n private readonly elementRef: ElementRef<HTMLElement>,\n private readonly sanitizer: DomSanitizer,\n private readonly iconService: IconService,\n ) {}\n}\n\nfunction coerceCssPixelValue(value: string): string {\n if (value == null) {\n return '';\n }\n\n return /^\\d+$/.test(value) ? `${value}px` : value;\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { NgIconComponent } from './icon.component';\nimport { IconService } from './icon.service';\n\n@NgModule({\n imports: [NgIconComponent],\n exports: [NgIconComponent],\n})\nexport class NgIconsModule {\n constructor(private readonly iconService: IconService) {\n if (Object.keys(this.iconService.icons).length === 0) {\n throw new Error(\n 'No icons have been provided. Ensure to include some icons by importing them using NgIconsModule.withIcons({ ... }).',\n );\n }\n }\n\n /**\n * Define the icons that will be included in the application. This allows unused icons to\n * be tree-shaken away to reduce bundle size\n * @param icons The object containing the required icons\n */\n static withIcons(\n icons: Record<string, string>,\n ): ModuleWithProviders<NgIconsModule> {\n IconService.addIcons(icons);\n\n return { ngModule: NgIconsModule };\n }\n}\n","import {
|
|
1
|
+
{"version":3,"file":"ng-icons-core.mjs","sources":["../../../../packages/core/src/lib/utils/format.ts","../../../../packages/core/src/lib/icon.service.ts","../../../../packages/core/src/lib/icon.component.ts","../../../../packages/core/src/lib/icon.module.ts","../../../../packages/core/src/lib/icon.provider.ts","../../../../packages/core/src/ng-icons-core.ts"],"sourcesContent":["/**\n * Hyphenated to UpperCamelCase\n */\nexport function toUpperCamelCase(str: string): string {\n return toCapitalCase(toPropertyName(str));\n}\n\n/**\n * Hyphenated to lowerCamelCase\n */\nexport function toPropertyName(str: string): string {\n return str\n .replace(/([^a-zA-Z0-9])+(.)?/g, (_, __, chr) =>\n chr ? chr.toUpperCase() : '',\n )\n .replace(/[^a-zA-Z\\d]/g, '')\n .replace(/^([A-Z])/, m => m.toLowerCase());\n}\n\n/**\n * Capitalizes the first letter of a string\n */\nexport function toCapitalCase(str: string): string {\n return str.charAt(0).toUpperCase() + str.substr(1);\n}\n","import { Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class IconService {\n /** Store the available icons. */\n private static icons: Readonly<Record<string, string>> = {};\n\n /** Access the icons in the class. */\n get icons(): Readonly<Record<string, string>> {\n return IconService.icons;\n }\n\n /**\n * Insert icons into the iconset\n */\n static addIcons(icons: Record<string, string>): void {\n IconService.icons = { ...IconService.icons, ...icons };\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostBinding,\n Input,\n} from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { IconName } from './icon-name';\nimport { IconService } from './icon.service';\nimport { toUpperCamelCase } from './utils/format';\n\n@Component({\n selector: 'ng-icon',\n template: '',\n standalone: true,\n styleUrls: ['./icon.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgIconComponent {\n /** Define the name of the icon to display */\n @Input() set name(name: IconName | string) {\n name = toUpperCamelCase(name);\n\n // if there is no icon with this name warn the user as they probably forgot to import it\n if (!this.iconService.icons.hasOwnProperty(name)) {\n console.warn(\n `No icon named ${name} was found. You may need to import it using the withIcons function.`,\n );\n return;\n }\n\n // insert the SVG into the template\n this.template = this.sanitizer.bypassSecurityTrustHtml(\n this.iconService.icons[name],\n );\n }\n\n /** Store the formatted icon name */\n @HostBinding('innerHTML') template?: SafeHtml;\n\n /** Define the size of the icon */\n @HostBinding('style.--ng-icon__size')\n @Input()\n set size(size: string) {\n // if the size only contains numbers, assume it is in pixels\n this._size = coerceCssPixelValue(size);\n }\n\n get size(): string {\n return this._size;\n }\n\n private _size: string = '1em';\n\n /** Define the stroke-width of the icon */\n @HostBinding('style.--ng-icon__stroke-width')\n @Input()\n strokeWidth?: string | number;\n\n /** Define the color of the icon */\n @HostBinding('style.color')\n @Input()\n color?: string;\n\n constructor(\n private readonly elementRef: ElementRef<HTMLElement>,\n private readonly sanitizer: DomSanitizer,\n private readonly iconService: IconService,\n ) {}\n}\n\nfunction coerceCssPixelValue(value: string): string {\n if (value == null) {\n return '';\n }\n\n return /^\\d+$/.test(value) ? `${value}px` : value;\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { NgIconComponent } from './icon.component';\nimport { IconService } from './icon.service';\n\n@NgModule({\n imports: [NgIconComponent],\n exports: [NgIconComponent],\n})\nexport class NgIconsModule {\n constructor(private readonly iconService: IconService) {\n if (Object.keys(this.iconService.icons).length === 0) {\n throw new Error(\n 'No icons have been provided. Ensure to include some icons by importing them using NgIconsModule.withIcons({ ... }).',\n );\n }\n }\n\n /**\n * Define the icons that will be included in the application. This allows unused icons to\n * be tree-shaken away to reduce bundle size\n * @param icons The object containing the required icons\n */\n static withIcons(\n icons: Record<string, string>,\n ): ModuleWithProviders<NgIconsModule> {\n IconService.addIcons(icons);\n\n return { ngModule: NgIconsModule };\n }\n}\n","import { Provider } from '@angular/core';\nimport { IconService } from './icon.service';\n\nexport function provideIcons(icons: Record<string, string>): Provider[] {\n IconService.addIcons(icons);\n\n return [];\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i2.IconService","i1.IconService"],"mappings":";;;;AAAA;;AAEG;AACG,SAAU,gBAAgB,CAAC,GAAW,EAAA;AAC1C,IAAA,OAAO,aAAa,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;AAC5C,CAAC;AAED;;AAEG;AACG,SAAU,cAAc,CAAC,GAAW,EAAA;AACxC,IAAA,OAAO,GAAG;SACP,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,KAC1C,GAAG,GAAG,GAAG,CAAC,WAAW,EAAE,GAAG,EAAE,CAC7B;AACA,SAAA,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC;AAC3B,SAAA,OAAO,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AAC/C,C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A,CAAA,QAAA,EAAA,CAAA,CAAA;2GAAb,aAAa,EAAA,OAAA,EAAA,CAHd,eAAe,CAAA,EAAA,OAAA,EAAA,CACf,eAAe,CAAA,EAAA,CAAA,CAAA;AAEd,aAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,YAHd,eAAe,CAAA,EAAA,CAAA,CAAA;2FAGd,aAAa,EAAA,UAAA,EAAA,CAAA;kBAJzB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,eAAe,CAAC;oBAC1B,OAAO,EAAE,CAAC,eAAe,CAAC;iBAC3B,CAAA;;;ACJK,SAAU,YAAY,CAAC,KAA6B,EAAA;AACxD,IAAA,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAE5B,IAAA,OAAO,EAAE,CAAC;AACZ;;ACPA;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, Component, ChangeDetectionStrategy, Input, HostBinding, NgModule
|
|
2
|
+
import { Injectable, Component, ChangeDetectionStrategy, Input, HostBinding, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/platform-browser';
|
|
4
4
|
|
|
5
5
|
class IconService {
|
|
@@ -136,14 +136,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0", ngImpor
|
|
|
136
136
|
}], ctorParameters: function () { return [{ type: IconService }]; } });
|
|
137
137
|
|
|
138
138
|
function provideIcons(icons) {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
provide: ICONS_TOKEN,
|
|
142
|
-
useFactory: () => IconService.addIcons(icons),
|
|
143
|
-
},
|
|
144
|
-
];
|
|
139
|
+
IconService.addIcons(icons);
|
|
140
|
+
return [];
|
|
145
141
|
}
|
|
146
|
-
const ICONS_TOKEN = new InjectionToken('noop icons token');
|
|
147
142
|
|
|
148
143
|
/**
|
|
149
144
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-icons-core.mjs","sources":["../../../../packages/core/src/lib/icon.service.ts","../../../../packages/core/src/lib/utils/format.ts","../../../../packages/core/src/lib/icon.component.ts","../../../../packages/core/src/lib/icon.module.ts","../../../../packages/core/src/lib/icon.provider.ts","../../../../packages/core/src/ng-icons-core.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class IconService {\n /** Store the available icons. */\n private static icons: Readonly<Record<string, string>> = {};\n\n /** Access the icons in the class. */\n get icons(): Readonly<Record<string, string>> {\n return IconService.icons;\n }\n\n /**\n * Insert icons into the iconset\n */\n static addIcons(icons: Record<string, string>): void {\n IconService.icons = { ...IconService.icons, ...icons };\n }\n}\n","/**\n * Hyphenated to UpperCamelCase\n */\nexport function toUpperCamelCase(str: string): string {\n return toCapitalCase(toPropertyName(str));\n}\n\n/**\n * Hyphenated to lowerCamelCase\n */\nexport function toPropertyName(str: string): string {\n return str\n .replace(/([^a-zA-Z0-9])+(.)?/g, (_, __, chr) =>\n chr ? chr.toUpperCase() : '',\n )\n .replace(/[^a-zA-Z\\d]/g, '')\n .replace(/^([A-Z])/, m => m.toLowerCase());\n}\n\n/**\n * Capitalizes the first letter of a string\n */\nexport function toCapitalCase(str: string): string {\n return str.charAt(0).toUpperCase() + str.substr(1);\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostBinding,\n Input,\n} from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { IconName } from './icon-name';\nimport { IconService } from './icon.service';\nimport { toUpperCamelCase } from './utils/format';\n\n@Component({\n selector: 'ng-icon',\n template: '',\n standalone: true,\n styleUrls: ['./icon.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgIconComponent {\n /** Define the name of the icon to display */\n @Input() set name(name: IconName | string) {\n name = toUpperCamelCase(name);\n\n // if there is no icon with this name warn the user as they probably forgot to import it\n if (!this.iconService.icons.hasOwnProperty(name)) {\n console.warn(\n `No icon named ${name} was found. You may need to import it using the withIcons function.`,\n );\n return;\n }\n\n // insert the SVG into the template\n this.template = this.sanitizer.bypassSecurityTrustHtml(\n this.iconService.icons[name],\n );\n }\n\n /** Store the formatted icon name */\n @HostBinding('innerHTML') template?: SafeHtml;\n\n /** Define the size of the icon */\n @HostBinding('style.--ng-icon__size')\n @Input()\n set size(size: string) {\n // if the size only contains numbers, assume it is in pixels\n this._size = coerceCssPixelValue(size);\n }\n\n get size(): string {\n return this._size;\n }\n\n private _size: string = '1em';\n\n /** Define the stroke-width of the icon */\n @HostBinding('style.--ng-icon__stroke-width')\n @Input()\n strokeWidth?: string | number;\n\n /** Define the color of the icon */\n @HostBinding('style.color')\n @Input()\n color?: string;\n\n constructor(\n private readonly elementRef: ElementRef<HTMLElement>,\n private readonly sanitizer: DomSanitizer,\n private readonly iconService: IconService,\n ) {}\n}\n\nfunction coerceCssPixelValue(value: string): string {\n if (value == null) {\n return '';\n }\n\n return /^\\d+$/.test(value) ? `${value}px` : value;\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { NgIconComponent } from './icon.component';\nimport { IconService } from './icon.service';\n\n@NgModule({\n imports: [NgIconComponent],\n exports: [NgIconComponent],\n})\nexport class NgIconsModule {\n constructor(private readonly iconService: IconService) {\n if (Object.keys(this.iconService.icons).length === 0) {\n throw new Error(\n 'No icons have been provided. Ensure to include some icons by importing them using NgIconsModule.withIcons({ ... }).',\n );\n }\n }\n\n /**\n * Define the icons that will be included in the application. This allows unused icons to\n * be tree-shaken away to reduce bundle size\n * @param icons The object containing the required icons\n */\n static withIcons(\n icons: Record<string, string>,\n ): ModuleWithProviders<NgIconsModule> {\n IconService.addIcons(icons);\n\n return { ngModule: NgIconsModule };\n }\n}\n","import {
|
|
1
|
+
{"version":3,"file":"ng-icons-core.mjs","sources":["../../../../packages/core/src/lib/icon.service.ts","../../../../packages/core/src/lib/utils/format.ts","../../../../packages/core/src/lib/icon.component.ts","../../../../packages/core/src/lib/icon.module.ts","../../../../packages/core/src/lib/icon.provider.ts","../../../../packages/core/src/ng-icons-core.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class IconService {\n /** Store the available icons. */\n private static icons: Readonly<Record<string, string>> = {};\n\n /** Access the icons in the class. */\n get icons(): Readonly<Record<string, string>> {\n return IconService.icons;\n }\n\n /**\n * Insert icons into the iconset\n */\n static addIcons(icons: Record<string, string>): void {\n IconService.icons = { ...IconService.icons, ...icons };\n }\n}\n","/**\n * Hyphenated to UpperCamelCase\n */\nexport function toUpperCamelCase(str: string): string {\n return toCapitalCase(toPropertyName(str));\n}\n\n/**\n * Hyphenated to lowerCamelCase\n */\nexport function toPropertyName(str: string): string {\n return str\n .replace(/([^a-zA-Z0-9])+(.)?/g, (_, __, chr) =>\n chr ? chr.toUpperCase() : '',\n )\n .replace(/[^a-zA-Z\\d]/g, '')\n .replace(/^([A-Z])/, m => m.toLowerCase());\n}\n\n/**\n * Capitalizes the first letter of a string\n */\nexport function toCapitalCase(str: string): string {\n return str.charAt(0).toUpperCase() + str.substr(1);\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostBinding,\n Input,\n} from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { IconName } from './icon-name';\nimport { IconService } from './icon.service';\nimport { toUpperCamelCase } from './utils/format';\n\n@Component({\n selector: 'ng-icon',\n template: '',\n standalone: true,\n styleUrls: ['./icon.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgIconComponent {\n /** Define the name of the icon to display */\n @Input() set name(name: IconName | string) {\n name = toUpperCamelCase(name);\n\n // if there is no icon with this name warn the user as they probably forgot to import it\n if (!this.iconService.icons.hasOwnProperty(name)) {\n console.warn(\n `No icon named ${name} was found. You may need to import it using the withIcons function.`,\n );\n return;\n }\n\n // insert the SVG into the template\n this.template = this.sanitizer.bypassSecurityTrustHtml(\n this.iconService.icons[name],\n );\n }\n\n /** Store the formatted icon name */\n @HostBinding('innerHTML') template?: SafeHtml;\n\n /** Define the size of the icon */\n @HostBinding('style.--ng-icon__size')\n @Input()\n set size(size: string) {\n // if the size only contains numbers, assume it is in pixels\n this._size = coerceCssPixelValue(size);\n }\n\n get size(): string {\n return this._size;\n }\n\n private _size: string = '1em';\n\n /** Define the stroke-width of the icon */\n @HostBinding('style.--ng-icon__stroke-width')\n @Input()\n strokeWidth?: string | number;\n\n /** Define the color of the icon */\n @HostBinding('style.color')\n @Input()\n color?: string;\n\n constructor(\n private readonly elementRef: ElementRef<HTMLElement>,\n private readonly sanitizer: DomSanitizer,\n private readonly iconService: IconService,\n ) {}\n}\n\nfunction coerceCssPixelValue(value: string): string {\n if (value == null) {\n return '';\n }\n\n return /^\\d+$/.test(value) ? `${value}px` : value;\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { NgIconComponent } from './icon.component';\nimport { IconService } from './icon.service';\n\n@NgModule({\n imports: [NgIconComponent],\n exports: [NgIconComponent],\n})\nexport class NgIconsModule {\n constructor(private readonly iconService: IconService) {\n if (Object.keys(this.iconService.icons).length === 0) {\n throw new Error(\n 'No icons have been provided. Ensure to include some icons by importing them using NgIconsModule.withIcons({ ... }).',\n );\n }\n }\n\n /**\n * Define the icons that will be included in the application. This allows unused icons to\n * be tree-shaken away to reduce bundle size\n * @param icons The object containing the required icons\n */\n static withIcons(\n icons: Record<string, string>,\n ): ModuleWithProviders<NgIconsModule> {\n IconService.addIcons(icons);\n\n return { ngModule: NgIconsModule };\n }\n}\n","import { Provider } from '@angular/core';\nimport { IconService } from './icon.service';\n\nexport function provideIcons(icons: Record<string, string>): Provider[] {\n IconService.addIcons(icons);\n\n return [];\n}\n","/**\n * Generated b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