@ng-icons/core 18.0.0 → 18.0.1
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.
|
@@ -33,5 +33,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0", ngImpor
|
|
|
33
33
|
/**
|
|
34
34
|
* Exporting component array for support with standalone components
|
|
35
35
|
*/
|
|
36
|
-
export const NG_ICON_DIRECTIVES =
|
|
37
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
36
|
+
export const NG_ICON_DIRECTIVES = IconComponent;
|
|
37
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWNvbi5tb2R1bGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb3JlL3NyYy9saWIvaWNvbi5tb2R1bGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUF1QixRQUFRLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDOUQsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBQ2pELE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQzs7O0FBTTdDLE1BQU0sT0FBTyxhQUFhO0lBQ3hCLFlBQTZCLFdBQXdCO1FBQXhCLGdCQUFXLEdBQVgsV0FBVyxDQUFhO1FBQ25ELElBQUksTUFBTSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsV0FBVyxDQUFDLEtBQUssQ0FBQyxDQUFDLE1BQU0sS0FBSyxDQUFDLEVBQUU7WUFDcEQsTUFBTSxJQUFJLEtBQUssQ0FDYixxSEFBcUgsQ0FDdEgsQ0FBQztTQUNIO0lBQ0gsQ0FBQztJQUVEOzs7O09BSUc7SUFDSCxNQUFNLENBQUMsU0FBUyxDQUNkLEtBQTZCO1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IGljb25zIGJ5IGltcG9ydGluZyB0aGVtIHVzaW5nIE5nSWNvbnNNb2R1bGUud2l0aEljb25zKHsgLi4uIH0pLicsXG4gICAgICApO1xuICAgIH1cbiAgfVxuXG4gIC8qKlxuICAgKiBEZWZpbmUgdGhlIGljb25zIHRoYXQgd2lsbCBiZSBpbmNsdWRlZCBpbiB0aGUgYXBwbGljYXRpb24uIFRoaXMgYWxsb3dzIHVudXNlZCBpY29ucyB0b1xuICAgKiBiZSB0cmVlLXNoYWtlbiBhd2F5IHRvIHJlZHVjZSBidW5kbGUgc2l6ZVxuICAgKiBAcGFyYW0gaWNvbnMgVGhlIG9iamVjdCBjb250YWluaW5nIHRoZSByZXF1aXJlZCBpY29uc1xuICAgKi9cbiAgc3RhdGljIHdpdGhJY29ucyhcbiAgICBpY29uczogUmVjb3JkPHN0cmluZywgc3RyaW5nPixcbiAgKTogTW9kdWxlV2l0aFByb3ZpZGVyczxOZ0ljb25zTW9kdWxlPiB7XG4gICAgSWNvblNlcnZpY2UuYWRkSWNvbnMoaWNvbnMpO1xuXG4gICAgcmV0dXJuIHsgbmdNb2R1bGU6IE5nSWNvbnNNb2R1bGUgfTtcbiAgfVxufVxuXG4vKipcbiAqIEV4cG9ydGluZyBjb21wb25lbnQgYXJyYXkgZm9yIHN1cHBvcnQgd2l0aCBzdGFuZGFsb25lIGNvbXBvbmVudHNcbiAqL1xuZXhwb3J0IGNvbnN0IE5HX0lDT05fRElSRUNUSVZFUyA9IEljb25Db21wb25lbnQ7XG4iXX0=
|
|
@@ -137,7 +137,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0", ngImpor
|
|
|
137
137
|
/**
|
|
138
138
|
* Exporting component array for support with standalone components
|
|
139
139
|
*/
|
|
140
|
-
const NG_ICON_DIRECTIVES =
|
|
140
|
+
const NG_ICON_DIRECTIVES = IconComponent;
|
|
141
141
|
|
|
142
142
|
function provideIcons(icons) {
|
|
143
143
|
return [
|
|
@@ -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 IconComponent {\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 { IconComponent } from './icon.component';\nimport { IconService } from './icon.service';\n\n@NgModule({\n imports: [IconComponent],\n exports: [IconComponent],\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\n/**\n * Exporting component array for support with standalone components\n */\nexport const NG_ICON_DIRECTIVES =
|
|
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 IconComponent {\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 { IconComponent } from './icon.component';\nimport { IconService } from './icon.service';\n\n@NgModule({\n imports: [IconComponent],\n exports: [IconComponent],\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\n/**\n * Exporting component array for support with standalone components\n */\nexport const NG_ICON_DIRECTIVES = IconComponent;\n","import { InjectionToken, Provider } from '@angular/core';\nimport { IconService } from './icon.service';\n\nexport function provideIcons(icons: Record<string, string>): Provider[] {\n return [\n {\n provide: ICONS_TOKEN,\n useFactory: () => IconService.addIcons(icons),\n },\n ];\n}\n\nconst ICONS_TOKEN = new InjectionToken('noop icons token');\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,CAAC;AAED;;AAEG;AACG,SAAU,aAAa,CAAC,GAAW,EAAA;AACvC,IAAA,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACrD;;MCnBa,WAAW,CAAA;;AAKtB,IAAA,IAAI,KAAK,GAAA;QACP,OAAO,WAAW,CAAC,KAAK,CAAC;KAC1B;AAED;;AAEG;IACH,OAAO,QAAQ,CAAC,KAA6B,EAAA;QAC3C,WAAW,CAAC,KAAK,GAAQ,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,WAAW,CAAC,KAAK,CAAA,EAAK,KAAK,CAAE,CAAC;KACxD;;AAbD;AACe,WAAK,CAAA,KAAA,GAAqC,EAAG,CAAA;wGAFjD,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAX,WAAA,CAAA,KA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,MAAM,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC;AAC9C,SAAA;KACF,CAAC;AACJ,CAAC;AAED,MAAM,WAAW,GAAG,IAAI,cAAc,CAAC,kBAAkB,CAAC;;ACZ1D;;AAEG;;;;"}
|
|
@@ -137,7 +137,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0", ngImpor
|
|
|
137
137
|
/**
|
|
138
138
|
* Exporting component array for support with standalone components
|
|
139
139
|
*/
|
|
140
|
-
const NG_ICON_DIRECTIVES =
|
|
140
|
+
const NG_ICON_DIRECTIVES = IconComponent;
|
|
141
141
|
|
|
142
142
|
function provideIcons(icons) {
|
|
143
143
|
return [
|
|
@@ -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 IconComponent {\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 { IconComponent } from './icon.component';\nimport { IconService } from './icon.service';\n\n@NgModule({\n imports: [IconComponent],\n exports: [IconComponent],\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\n/**\n * Exporting component array for support with standalone components\n */\nexport const NG_ICON_DIRECTIVES =
|
|
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 IconComponent {\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 { IconComponent } from './icon.component';\nimport { IconService } from './icon.service';\n\n@NgModule({\n imports: [IconComponent],\n exports: [IconComponent],\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\n/**\n * Exporting component array for support with standalone components\n */\nexport const NG_ICON_DIRECTIVES = IconComponent;\n","import { InjectionToken, Provider } from '@angular/core';\nimport { IconService } from './icon.service';\n\nexport function provideIcons(icons: Record<string, string>): Provider[] {\n return [\n {\n provide: ICONS_TOKEN,\n useFactory: () => IconService.addIcons(icons),\n },\n ];\n}\n\nconst ICONS_TOKEN = new InjectionToken('noop icons token');\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i2.IconService","i1.IconService"],"mappings":";;;;MAKa,WAAW,CAAA;;AAKtB,IAAA,IAAI,KAAK,GAAA;QACP,OAAO,WAAW,CAAC,KAAK,CAAC;KAC1B;AAED;;AAEG;IACH,OAAO,QAAQ,CAAC,KAA6B,EAAA;AAC3C,QAAA,WAAW,CAAC,KAAK,GAAG,EAAE,GAAG,WAAW,CAAC,KAAK,EAAE,GAAG,KAAK,EAAE,CAAC;KACxD;;AAbD;AACe,WAAK,CAAA,KAAA,GAAqC,EAAG,CAAA;wGAFjD,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAX,WAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAW,cAFV,MAAM,EAAA,CAAA,CAAA;2FAEP,WAAW,EAAA,UAAA,EAAA,CAAA;kBAHvB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,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