@ng-icons/core 25.2.0 → 25.3.0

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,8 +1,14 @@
1
1
  import { SafeHtml } from '@angular/platform-browser';
2
- import { IconName } from './icon-name';
2
+ import type { IconName } from './icon-name';
3
3
  import * as i0 from "@angular/core";
4
4
  export type IconType = IconName | (string & {});
5
- export declare class NgIconComponent {
5
+ export declare class NgIcon {
6
+ /** Access the global icon config */
7
+ private readonly config;
8
+ /** Access the sanitizer */
9
+ private readonly sanitizer;
10
+ /** Access the icons */
11
+ private readonly icons;
6
12
  /** Define the name of the icon to display */
7
13
  set name(name: IconType);
8
14
  /** Store the formatted icon name */
@@ -15,8 +21,6 @@ export declare class NgIconComponent {
15
21
  strokeWidth?: string | number;
16
22
  /** Define the color of the icon */
17
23
  color?: string;
18
- private readonly sanitizer;
19
- private readonly icons;
20
- static ɵfac: i0.ɵɵFactoryDeclaration<NgIconComponent, never>;
21
- static ɵcmp: i0.ɵɵComponentDeclaration<NgIconComponent, "ng-icon", never, { "name": { "alias": "name"; "required": false; }; "size": { "alias": "size"; "required": false; }; "strokeWidth": { "alias": "strokeWidth"; "required": false; }; "color": { "alias": "color"; "required": false; }; }, {}, never, never, true, never>;
24
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgIcon, never>;
25
+ static ɵcmp: i0.ɵɵComponentDeclaration<NgIcon, "ng-icon", never, { "name": { "alias": "name"; "required": false; }; "size": { "alias": "size"; "required": false; }; "strokeWidth": { "alias": "strokeWidth"; "required": false; }; "color": { "alias": "color"; "required": false; }; }, {}, never, never, true, never>;
22
26
  }
@@ -1,4 +1,5 @@
1
1
  import { ModuleWithProviders } from '@angular/core';
2
+ import { NgIcon } from './icon.component';
2
3
  import * as i0 from "@angular/core";
3
4
  import * as i1 from "./icon.component";
4
5
  export declare class NgIconsModule {
@@ -10,11 +11,7 @@ export declare class NgIconsModule {
10
11
  */
11
12
  static withIcons(icons: Record<string, string>): ModuleWithProviders<NgIconsModule>;
12
13
  static ɵfac: i0.ɵɵFactoryDeclaration<NgIconsModule, never>;
13
- static ɵmod: i0.ɵɵNgModuleDeclaration<NgIconsModule, never, [typeof i1.NgIconComponent], [typeof i1.NgIconComponent]>;
14
+ static ɵmod: i0.ɵɵNgModuleDeclaration<NgIconsModule, never, [typeof i1.NgIcon], [typeof i1.NgIcon]>;
14
15
  static ɵinj: i0.ɵɵInjectorDeclaration<NgIconsModule>;
15
16
  }
16
- export declare class NG_ICON_DIRECTIVES {
17
- static ɵfac: i0.ɵɵFactoryDeclaration<NG_ICON_DIRECTIVES, never>;
18
- static ɵmod: i0.ɵɵNgModuleDeclaration<NG_ICON_DIRECTIVES, never, [typeof i1.NgIconComponent], [typeof i1.NgIconComponent]>;
19
- static ɵinj: i0.ɵɵInjectorDeclaration<NG_ICON_DIRECTIVES>;
20
- }
17
+ export declare const NG_ICON_DIRECTIVES: readonly [typeof NgIcon];
@@ -0,0 +1,17 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ export interface NgIconConfig {
3
+ /** Define the default size of icons */
4
+ size: string;
5
+ }
6
+ export declare const NgIconConfigToken: InjectionToken<NgIconConfig>;
7
+ /**
8
+ * Provide the configuration for the icons
9
+ * @param config The configuration to use
10
+ */
11
+ export declare function provideNgIconsConfig(config: Partial<NgIconConfig>): NgIconConfig;
12
+ /**
13
+ * Inject the configuration for the icons
14
+ * @returns The configuration to use
15
+ * @internal
16
+ */
17
+ export declare function injectNgIconConfig(): NgIconConfig;
@@ -1,3 +1,13 @@
1
1
  import { InjectionToken, Provider } from '@angular/core';
2
+ /**
3
+ * Define the icons to use
4
+ * @param icons The icons to provide
5
+ */
2
6
  export declare function provideIcons(icons: Record<string, string>): Provider[];
3
7
  export declare const NgIconsToken: InjectionToken<Record<string, string>[]>;
8
+ /**
9
+ * Inject the icons to use
10
+ * @returns The icons to use
11
+ * @internal
12
+ */
13
+ export declare function injectNgIcons(): Record<string, string>[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ng-icons/core",
3
- "version": "25.2.0",
3
+ "version": "25.3.0",
4
4
  "license": "MIT",
5
5
  "keywords": [
6
6
  "angular",
@@ -1,16 +0,0 @@
1
- import { InjectionToken, Optional, SkipSelf } from '@angular/core';
2
- export function provideIcons(icons) {
3
- return [
4
- {
5
- provide: NgIconsToken,
6
- useFactory: (parentIcons) => ({
7
- ...parentIcons?.reduce((acc, icons) => ({ ...acc, ...icons }), {}),
8
- ...icons,
9
- }),
10
- deps: [[NgIconsToken, new Optional(), new SkipSelf()]],
11
- multi: true,
12
- },
13
- ];
14
- }
15
- export const NgIconsToken = new InjectionToken('Icons Token');
16
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWNvbi5wcm92aWRlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvcmUvc3JjL2xpYi9pY29uLnByb3ZpZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxjQUFjLEVBQUUsUUFBUSxFQUFZLFFBQVEsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUU3RSxNQUFNLFVBQVUsWUFBWSxDQUFDLEtBQTZCO0lBQ3hELE9BQU87UUFDTDtZQUNFLE9BQU8sRUFBRSxZQUFZO1lBQ3JCLFVBQVUsRUFBRSxDQUFDLFdBQXNDLEVBQUUsRUFBRSxDQUFDLENBQUM7Z0JBQ3ZELEdBQUcsV0FBVyxFQUFFLE1BQU0sQ0FBQyxDQUFDLEdBQUcsRUFBRSxLQUFLLEVBQUUsRUFBRSxDQUFDLENBQUMsRUFBRSxHQUFHLEdBQUcsRUFBRSxHQUFHLEtBQUssRUFBRSxDQUFDLEVBQUUsRUFBRSxDQUFDO2dCQUNsRSxHQUFHLEtBQUs7YUFDVCxDQUFDO1lBQ0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