@hugeicons/angular 1.0.5 → 1.0.6
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.
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
# @hugeicons/angular
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
## 1.0.6
|
|
5
|
+
|
|
6
|
+
### Patch Changes
|
|
7
|
+
|
|
8
|
+
- Fixed TypeScript type compatibility issue with icon data packages
|
|
9
|
+
- `IconSvgObject` now accepts both strict (`SvgPathAttributes`) and loose path attribute formats
|
|
10
|
+
- Resolves "Property 'd' is missing" type error when using icons from `@hugeicons/core-*` packages
|
|
11
|
+
|
|
12
|
+
|
|
4
13
|
## 1.0.5
|
|
5
14
|
|
|
6
15
|
### Patch Changes
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvbGliL3R5cGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyIvKiogU1ZHIHBhdGggYXR0cmlidXRlcyAtIHN0cmljdCB2ZXJzaW9uIHdpdGggcmVxdWlyZWQgZCBwcm9wZXJ0eSAqL1xuZXhwb3J0IGludGVyZmFjZSBTdmdQYXRoQXR0cmlidXRlcyB7XG4gIGQ6IHN0cmluZztcbiAgZmlsbD86IHN0cmluZztcbiAgb3BhY2l0eT86IHN0cmluZztcbiAgZmlsbFJ1bGU/OiAnbm9uemVybycgfCAnZXZlbm9kZCc7XG4gIHN0cm9rZT86IHN0cmluZztcbiAgc3Ryb2tlV2lkdGg/OiBudW1iZXIgfCBzdHJpbmc7XG4gIHN0cm9rZUxpbmVj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uXG5leHBvcnQgaW50ZXJmYWNlIEljb25NZXRhZGF0YSB7XG4gIG5hbWU6IEljb25OYW1lO1xuICBjYXRlZ29yeTogc3RyaW5nO1xuICB0YWdzOiBzdHJpbmdbXTtcbiAgcGFjazogc3RyaW5nO1xuICBzdHlsZT86IEljb25TdHlsZTtcbn1cblxuZXhwb3J0IGludGVyZmFjZSBJY29uRGF0YSB7XG4gIGljb246IEljb25TdmdPYmplY3Q7XG4gIG1ldGFkYXRhOiBJY29uTWV0YWRhdGE7XG59XG5cbmV4cG9ydCBpbnRlcmZhY2UgSHVnZWljb25zUHJvcHMge1xuICBzaXplPzogc3RyaW5nIHwgbnVtYmVyO1xuICBzdHJva2VXaWR0aD86IG51bWJlcjtcbiAgYWJzb2x1dGVTdHJva2VXaWR0aD86IGJvb2xlYW47XG4gIGljb246IEljb25TdmdPYmplY3Q7XG4gIGFsdEljb24/OiBJY29uU3ZnT2JqZWN0O1xuICBjb2xvcj86IHN0cmluZztcbiAgY2xhc3M/OiBzdHJpbmc7XG4gIHNob3dBbHQ/OiBib29sZWFuO1xufSAiXX0=
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, computed,
|
|
2
|
+
import { input, computed, Component, ChangeDetectionStrategy } from '@angular/core';
|
|
3
3
|
|
|
4
4
|
class HugeiconsIconComponent {
|
|
5
5
|
// Signal inputs - modern Angular 17.1+ approach
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hugeicons-angular.mjs","sources":["../../src/components/hugeicons-icon.component.ts","../../src/hugeicons-angular.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, computed, input } from '@angular/core';\nimport { IconSvgObject } from '../lib/types';\n\ninterface PathData {\n d: string;\n fill: string;\n opacity?: string;\n fillRule?: string;\n stroke?: string;\n strokeWidth?: number;\n}\n\n@Component({\n selector: 'hugeicons-icon',\n standalone: true,\n template: `\n <svg\n [attr.width]=\"size()\"\n [attr.height]=\"size()\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n [attr.color]=\"color()\"\n [class]=\"iconClass()\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n @for (path of paths(); track $index) {\n <path\n [attr.d]=\"path.d\"\n [attr.fill]=\"path.fill\"\n [attr.opacity]=\"path.opacity\"\n [attr.fill-rule]=\"path.fillRule\"\n [attr.stroke]=\"path.stroke\"\n [attr.stroke-width]=\"path.strokeWidth\"\n />\n }\n </svg>\n `,\n host: {\n style: 'display: inline-flex; align-items: center; justify-content: center;'\n },\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class HugeiconsIconComponent {\n // Signal inputs - modern Angular 17.1+ approach\n readonly size = input<string | number>(24);\n readonly strokeWidth = input<number | undefined>(undefined);\n readonly absoluteStrokeWidth = input<boolean>(false);\n readonly icon = input.required<IconSvgObject>();\n readonly altIcon = input<IconSvgObject | undefined>(undefined);\n readonly color = input<string>('currentColor');\n readonly iconClass = input<string>('', { alias: 'class' });\n readonly showAlt = input<boolean>(false);\n\n // Computed signal for reactive path updates\n readonly paths = computed<PathData[]>(() => {\n const currentIcon = this.showAlt() && this.altIcon() ? this.altIcon()! : this.icon();\n\n if (!currentIcon || !Array.isArray(currentIcon)) {\n return [];\n }\n\n const strokeWidthValue = this.strokeWidth();\n const calculatedStrokeWidth = strokeWidthValue !== undefined\n ? (this.absoluteStrokeWidth() \n ? (Number(strokeWidthValue) * 24) / Number(this.size()) \n : strokeWidthValue)\n : undefined;\n\n const strokeProps = calculatedStrokeWidth !== undefined \n ? { strokeWidth: calculatedStrokeWidth, stroke: 'currentColor' } \n : {};\n\n return currentIcon.map(([_, attrs]) => ({\n d: attrs['d'],\n fill: attrs['fill'] || 'none',\n opacity: attrs['opacity'],\n fillRule: attrs['fillRule'],\n ...strokeProps\n }));\n });\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MA0Ca,sBAAsB,CAAA;;AAExB,IAAA,IAAI,GAAG,KAAK,CAAkB,EAAE,CAAC;AACjC,IAAA,WAAW,GAAG,KAAK,CAAqB,SAAS,CAAC;AAClD,IAAA,mBAAmB,GAAG,KAAK,CAAU,KAAK,CAAC;AAC3C,IAAA,IAAI,GAAG,KAAK,CAAC,QAAQ,EAAiB;AACtC,IAAA,OAAO,GAAG,KAAK,CAA4B,SAAS,CAAC;AACrD,IAAA,KAAK,GAAG,KAAK,CAAS,cAAc,CAAC;IACrC,SAAS,GAAG,KAAK,CAAS,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AACjD,IAAA,OAAO,GAAG,KAAK,CAAU,KAAK,CAAC;;AAG/B,IAAA,KAAK,GAAG,QAAQ,CAAa,MAAK;QACzC,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,OAAO,EAAG,GAAG,IAAI,CAAC,IAAI,EAAE;QAEpF,IAAI,CAAC,WAAW,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;AAC/C,YAAA,OAAO,EAAE;AACV
|
|
1
|
+
{"version":3,"file":"hugeicons-angular.mjs","sources":["../../src/components/hugeicons-icon.component.ts","../../src/hugeicons-angular.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, computed, input } from '@angular/core';\nimport { IconSvgObject } from '../lib/types';\n\ninterface PathData {\n d: string;\n fill: string;\n opacity?: string;\n fillRule?: string;\n stroke?: string;\n strokeWidth?: number;\n}\n\n@Component({\n selector: 'hugeicons-icon',\n standalone: true,\n template: `\n <svg\n [attr.width]=\"size()\"\n [attr.height]=\"size()\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n [attr.color]=\"color()\"\n [class]=\"iconClass()\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n @for (path of paths(); track $index) {\n <path\n [attr.d]=\"path.d\"\n [attr.fill]=\"path.fill\"\n [attr.opacity]=\"path.opacity\"\n [attr.fill-rule]=\"path.fillRule\"\n [attr.stroke]=\"path.stroke\"\n [attr.stroke-width]=\"path.strokeWidth\"\n />\n }\n </svg>\n `,\n host: {\n style: 'display: inline-flex; align-items: center; justify-content: center;'\n },\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class HugeiconsIconComponent {\n // Signal inputs - modern Angular 17.1+ approach\n readonly size = input<string | number>(24);\n readonly strokeWidth = input<number | undefined>(undefined);\n readonly absoluteStrokeWidth = input<boolean>(false);\n readonly icon = input.required<IconSvgObject>();\n readonly altIcon = input<IconSvgObject | undefined>(undefined);\n readonly color = input<string>('currentColor');\n readonly iconClass = input<string>('', { alias: 'class' });\n readonly showAlt = input<boolean>(false);\n\n // Computed signal for reactive path updates\n readonly paths = computed<PathData[]>(() => {\n const currentIcon = this.showAlt() && this.altIcon() ? this.altIcon()! : this.icon();\n\n if (!currentIcon || !Array.isArray(currentIcon)) {\n return [];\n }\n\n const strokeWidthValue = this.strokeWidth();\n const calculatedStrokeWidth = strokeWidthValue !== undefined\n ? (this.absoluteStrokeWidth() \n ? (Number(strokeWidthValue) * 24) / Number(this.size()) \n : strokeWidthValue)\n : undefined;\n\n const strokeProps = calculatedStrokeWidth !== undefined \n ? { strokeWidth: calculatedStrokeWidth, stroke: 'currentColor' } \n : {};\n\n return currentIcon.map(([_, attrs]) => ({\n d: attrs['d'],\n fill: attrs['fill'] || 'none',\n opacity: attrs['opacity'],\n fillRule: attrs['fillRule'],\n ...strokeProps\n }));\n });\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MA0Ca,sBAAsB,CAAA;;AAExB,IAAA,IAAI,GAAG,KAAK,CAAkB,EAAE,CAAC;AACjC,IAAA,WAAW,GAAG,KAAK,CAAqB,SAAS,CAAC;AAClD,IAAA,mBAAmB,GAAG,KAAK,CAAU,KAAK,CAAC;AAC3C,IAAA,IAAI,GAAG,KAAK,CAAC,QAAQ,EAAiB;AACtC,IAAA,OAAO,GA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A,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,OAAA,EAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,UAAA,EAAA,SAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,cAAA,EAAA,qEAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;AAqBT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FAMU,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBA9BlC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,gBAAgB;AAC1B,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;AAqBT,EAAA,CAAA;AACD,oBAAA,IAAI,EAAE;AACJ,wBAAA,KAAK,EAAE;AACR,qBAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC;AAC1C,iBAAA;;;ACzCD;;AAEG;;;;"}
|
package/dist/lib/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** SVG path attributes */
|
|
1
|
+
/** SVG path attributes - strict version with required d property */
|
|
2
2
|
export interface SvgPathAttributes {
|
|
3
3
|
d: string;
|
|
4
4
|
fill?: string;
|
|
@@ -10,8 +10,13 @@ export interface SvgPathAttributes {
|
|
|
10
10
|
strokeLinejoin?: 'miter' | 'round' | 'bevel';
|
|
11
11
|
[key: string]: unknown;
|
|
12
12
|
}
|
|
13
|
-
/**
|
|
14
|
-
export type
|
|
13
|
+
/** Loose path attributes type for compatibility with icon data packages */
|
|
14
|
+
export type LooseSvgPathAttributes = {
|
|
15
|
+
d?: string;
|
|
16
|
+
[key: string]: string | number | undefined;
|
|
17
|
+
};
|
|
18
|
+
/** Icon SVG object type - accepts both strict and loose path attribute formats */
|
|
19
|
+
export type IconSvgObject = readonly (readonly [string, SvgPathAttributes | LooseSvgPathAttributes])[];
|
|
15
20
|
export type IconName = string;
|
|
16
21
|
/** Icon style variants */
|
|
17
22
|
export type IconStyle = 'stroke-rounded' | 'stroke-sharp' | 'stroke-standard' | 'solid-rounded' | 'solid-sharp' | 'solid-standard' | 'bulk-rounded' | 'duotone-rounded' | 'duotone-standard' | 'twotone-rounded';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hugeicons/angular",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "Hugeicons Angular Component Library https://hugeicons.com",
|
|
5
5
|
"homepage": "https://hugeicons.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -58,4 +58,4 @@
|
|
|
58
58
|
"icon-library",
|
|
59
59
|
"typescript"
|
|
60
60
|
]
|
|
61
|
-
}
|
|
61
|
+
}
|