@svgflex/angular 0.1.5 → 0.2.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,7 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, inject, ChangeDetectorRef, HostBinding, Input, Component } from '@angular/core';
|
|
2
|
+
import { isDevMode, Injectable, inject, ChangeDetectorRef, HostBinding, Input, Component } from '@angular/core';
|
|
3
3
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
4
|
-
import { CommonModule } from '@angular/common';
|
|
5
4
|
import { of } from 'rxjs';
|
|
6
5
|
import { map, catchError, shareReplay } from 'rxjs/operators';
|
|
7
6
|
import { sanitizeSvg, processSvgConfig } from '@svgflex/core';
|
|
@@ -23,18 +22,24 @@ class SvgLoaderService {
|
|
|
23
22
|
* @param replaceColors - Whether to replace hardcoded colors with currentColor (default: true)
|
|
24
23
|
*/
|
|
25
24
|
loadSvg(url, replaceColors = true) {
|
|
26
|
-
|
|
25
|
+
if (isDevMode()) {
|
|
26
|
+
console.log('[SvgLoaderService] Loading SVG from:', url, 'replaceColors:', replaceColors);
|
|
27
|
+
}
|
|
27
28
|
// Check cache with both url and replaceColors as key
|
|
28
29
|
if (!this.cache.has(url)) {
|
|
29
30
|
this.cache.set(url, new Map());
|
|
30
31
|
}
|
|
31
32
|
const urlCache = this.cache.get(url);
|
|
32
33
|
if (urlCache.has(replaceColors)) {
|
|
33
|
-
|
|
34
|
+
if (isDevMode()) {
|
|
35
|
+
console.log('[SvgLoaderService] Returning cached SVG for:', url, 'replaceColors:', replaceColors);
|
|
36
|
+
}
|
|
34
37
|
return urlCache.get(replaceColors);
|
|
35
38
|
}
|
|
36
39
|
const svg$ = this.http.get(url, { responseType: 'text' }).pipe(map(svgContent => {
|
|
37
|
-
|
|
40
|
+
if (isDevMode()) {
|
|
41
|
+
console.log('[SvgLoaderService] Successfully loaded SVG from:', url, 'Length:', svgContent.length);
|
|
42
|
+
}
|
|
38
43
|
return sanitizeSvg(svgContent, replaceColors);
|
|
39
44
|
}), catchError(error => {
|
|
40
45
|
console.error(`[SvgLoaderService] Failed to load SVG from ${url}:`, error);
|
|
@@ -49,10 +54,10 @@ class SvgLoaderService {
|
|
|
49
54
|
clearCache() {
|
|
50
55
|
this.cache.clear();
|
|
51
56
|
}
|
|
52
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
53
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
57
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: SvgLoaderService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
58
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: SvgLoaderService, providedIn: 'root' });
|
|
54
59
|
}
|
|
55
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
60
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: SvgLoaderService, decorators: [{
|
|
56
61
|
type: Injectable,
|
|
57
62
|
args: [{
|
|
58
63
|
providedIn: 'root'
|
|
@@ -121,13 +126,15 @@ class SvgflexComponent {
|
|
|
121
126
|
this.height = processed.height;
|
|
122
127
|
this.processedReplaceColors = processed.replaceColors;
|
|
123
128
|
this.ariaLabel = processed.ariaLabel;
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
if (isDevMode()) {
|
|
130
|
+
console.log('[SvgflexComponent] Processed config:', {
|
|
131
|
+
width: this.width,
|
|
132
|
+
height: this.height,
|
|
133
|
+
color: this.color,
|
|
134
|
+
replaceColors: this.processedReplaceColors,
|
|
135
|
+
src: this.src
|
|
136
|
+
});
|
|
137
|
+
}
|
|
131
138
|
// Load SVG content if inline mode is enabled
|
|
132
139
|
// Check if src or inline changed, or if it's the first change (firstChange)
|
|
133
140
|
if (this.inline && (changes['src'] || changes['inline'] || changes['replaceColors'] || Object.keys(changes).length > 0)) {
|
|
@@ -135,32 +142,42 @@ class SvgflexComponent {
|
|
|
135
142
|
}
|
|
136
143
|
}
|
|
137
144
|
loadSvgContent() {
|
|
138
|
-
|
|
145
|
+
if (isDevMode()) {
|
|
146
|
+
console.log('[SvgflexComponent] loadSvgContent called, src:', this.src, 'inline:', this.inline, 'replaceColors:', this.processedReplaceColors);
|
|
147
|
+
}
|
|
139
148
|
if (!this.src) {
|
|
140
|
-
|
|
149
|
+
if (isDevMode()) {
|
|
150
|
+
console.log('[SvgflexComponent] No src provided, skipping load');
|
|
151
|
+
}
|
|
141
152
|
return;
|
|
142
153
|
}
|
|
143
154
|
this.svgLoader.loadSvg(this.src, this.processedReplaceColors).subscribe((content) => {
|
|
144
|
-
|
|
155
|
+
if (isDevMode()) {
|
|
156
|
+
console.log('[SvgflexComponent] Received SVG content, length:', content.length);
|
|
157
|
+
}
|
|
145
158
|
if (content) {
|
|
146
159
|
// SVG is already sanitized by SvgLoaderService
|
|
147
160
|
// Directly bypass security and trust the HTML
|
|
148
161
|
this.svgContent = this.sanitizer.bypassSecurityTrustHtml(content);
|
|
149
|
-
|
|
162
|
+
if (isDevMode()) {
|
|
163
|
+
console.log('[SvgflexComponent] SVG content set successfully');
|
|
164
|
+
}
|
|
150
165
|
}
|
|
151
166
|
else {
|
|
152
|
-
|
|
167
|
+
if (isDevMode()) {
|
|
168
|
+
console.log('[SvgflexComponent] Received empty content');
|
|
169
|
+
}
|
|
153
170
|
}
|
|
154
171
|
// Manually trigger change detection for Zoneless compatibility
|
|
155
172
|
this.cdr.markForCheck();
|
|
156
173
|
});
|
|
157
174
|
}
|
|
158
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
159
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
175
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: SvgflexComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
176
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.7", type: SvgflexComponent, isStandalone: true, selector: "svgflex", inputs: { src: "src", color: "color", size: "size", class: "class", ariaLabel: "ariaLabel", alt: "alt", inline: "inline", replaceColors: "replaceColors" }, host: { properties: { "class": "this.hostClasses", "style.width": "this.hostWidth", "style.height": "this.hostHeight" } }, usesOnChanges: true, ngImport: i0, template: "<div\n class=\"svgflex-container\"\n [style.color]=\"color || null\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.role]=\"ariaLabel ? 'img' : null\"\n [attr.title]=\"ariaLabel\"\n>\n @if (inline && svgContent) {\n <div [innerHTML]=\"svgContent\" class=\"svgflex-inline\"></div>\n } @else if (!inline) {\n <img\n [src]=\"src\"\n [alt]=\"ariaLabel || ''\"\n [title]=\"ariaLabel\"\n [style.width]=\"width\"\n [style.height]=\"height\"\n />\n } @else {\n <div class=\"svgflex-loading\"></div>\n }\n</div>\n", styles: [":host{display:inline-flex;align-items:center;justify-content:center}:host.block{display:block}:host.flex{display:flex}.svgflex-container{display:flex;align-items:center;justify-content:center;width:100%;height:100%;color:inherit}.svgflex-inline{display:contents}.svgflex-inline ::ng-deep svg{width:100%;height:100%;fill:currentColor}.svgflex-inline ::ng-deep svg path:not([fill=none]):not([fill=transparent]),.svgflex-inline ::ng-deep svg circle:not([fill=none]):not([fill=transparent]),.svgflex-inline ::ng-deep svg rect:not([fill=none]):not([fill=transparent]),.svgflex-inline ::ng-deep svg polygon:not([fill=none]):not([fill=transparent]),.svgflex-inline ::ng-deep svg polyline:not([fill=none]):not([fill=transparent]),.svgflex-inline ::ng-deep svg ellipse:not([fill=none]):not([fill=transparent]),.svgflex-inline ::ng-deep svg line:not([fill=none]):not([fill=transparent]){fill:currentColor}.svgflex-inline ::ng-deep svg[stroke]{stroke:currentColor}.svgflex-inline ::ng-deep svg[stroke] path,.svgflex-inline ::ng-deep svg[stroke] circle,.svgflex-inline ::ng-deep svg[stroke] rect,.svgflex-inline ::ng-deep svg[stroke] polygon,.svgflex-inline ::ng-deep svg[stroke] polyline,.svgflex-inline ::ng-deep svg[stroke] ellipse,.svgflex-inline ::ng-deep svg[stroke] line{stroke:currentColor}.svgflex-loading{width:100%;height:100%;background-color:currentColor;opacity:.1;border-radius:2px}img{display:block;max-width:100%;max-height:100%}:host.icon-sm{width:16px;height:16px}:host.icon-md{width:24px;height:24px}:host.icon-lg{width:32px;height:32px}:host.icon-xl{width:48px;height:48px}:host.icon-2xl{width:64px;height:64px}\n"] });
|
|
160
177
|
}
|
|
161
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
178
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: SvgflexComponent, decorators: [{
|
|
162
179
|
type: Component,
|
|
163
|
-
args: [{ selector: 'svgflex', standalone: true, imports: [
|
|
180
|
+
args: [{ selector: 'svgflex', standalone: true, imports: [], template: "<div\n class=\"svgflex-container\"\n [style.color]=\"color || null\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.role]=\"ariaLabel ? 'img' : null\"\n [attr.title]=\"ariaLabel\"\n>\n @if (inline && svgContent) {\n <div [innerHTML]=\"svgContent\" class=\"svgflex-inline\"></div>\n } @else if (!inline) {\n <img\n [src]=\"src\"\n [alt]=\"ariaLabel || ''\"\n [title]=\"ariaLabel\"\n [style.width]=\"width\"\n [style.height]=\"height\"\n />\n } @else {\n <div class=\"svgflex-loading\"></div>\n }\n</div>\n", styles: [":host{display:inline-flex;align-items:center;justify-content:center}:host.block{display:block}:host.flex{display:flex}.svgflex-container{display:flex;align-items:center;justify-content:center;width:100%;height:100%;color:inherit}.svgflex-inline{display:contents}.svgflex-inline ::ng-deep svg{width:100%;height:100%;fill:currentColor}.svgflex-inline ::ng-deep svg path:not([fill=none]):not([fill=transparent]),.svgflex-inline ::ng-deep svg circle:not([fill=none]):not([fill=transparent]),.svgflex-inline ::ng-deep svg rect:not([fill=none]):not([fill=transparent]),.svgflex-inline ::ng-deep svg polygon:not([fill=none]):not([fill=transparent]),.svgflex-inline ::ng-deep svg polyline:not([fill=none]):not([fill=transparent]),.svgflex-inline ::ng-deep svg ellipse:not([fill=none]):not([fill=transparent]),.svgflex-inline ::ng-deep svg line:not([fill=none]):not([fill=transparent]){fill:currentColor}.svgflex-inline ::ng-deep svg[stroke]{stroke:currentColor}.svgflex-inline ::ng-deep svg[stroke] path,.svgflex-inline ::ng-deep svg[stroke] circle,.svgflex-inline ::ng-deep svg[stroke] rect,.svgflex-inline ::ng-deep svg[stroke] polygon,.svgflex-inline ::ng-deep svg[stroke] polyline,.svgflex-inline ::ng-deep svg[stroke] ellipse,.svgflex-inline ::ng-deep svg[stroke] line{stroke:currentColor}.svgflex-loading{width:100%;height:100%;background-color:currentColor;opacity:.1;border-radius:2px}img{display:block;max-width:100%;max-height:100%}:host.icon-sm{width:16px;height:16px}:host.icon-md{width:24px;height:24px}:host.icon-lg{width:32px;height:32px}:host.icon-xl{width:48px;height:48px}:host.icon-2xl{width:64px;height:64px}\n"] }]
|
|
164
181
|
}], propDecorators: { src: [{
|
|
165
182
|
type: Input,
|
|
166
183
|
args: [{ required: true }]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"svgflex-angular.mjs","sources":["../../../packages/angular/src/lib/services/svg-loader.service.ts","../../../packages/angular/src/lib/components/svgflex.component.ts","../../../packages/angular/src/lib/components/svgflex.component.html","../../../packages/angular/src/public-api.ts","../../../packages/angular/src/svgflex-angular.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport { Observable, of } from 'rxjs';\nimport { map, catchError, shareReplay } from 'rxjs/operators';\nimport { sanitizeSvg } from '@svgflex/core';\n\n/**\n * Service for loading and caching SVG content\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class SvgLoaderService {\n private cache = new Map<string, Map<boolean, Observable<string>>>();\n\n constructor(private http: HttpClient) {}\n\n /**\n * Loads SVG content from a URL with caching\n * @param url - URL to load the SVG from\n * @param replaceColors - Whether to replace hardcoded colors with currentColor (default: true)\n */\n loadSvg(url: string, replaceColors: boolean = true): Observable<string> {\n console.log('[SvgLoaderService] Loading SVG from:', url, 'replaceColors:', replaceColors);\n\n // Check cache with both url and replaceColors as key\n if (!this.cache.has(url)) {\n this.cache.set(url, new Map());\n }\n\n const urlCache = this.cache.get(url)!;\n if (urlCache.has(replaceColors)) {\n console.log('[SvgLoaderService] Returning cached SVG for:', url, 'replaceColors:', replaceColors);\n return urlCache.get(replaceColors)!;\n }\n\n const svg$ = this.http.get(url, { responseType: 'text' }).pipe(\n map(svgContent => {\n console.log('[SvgLoaderService] Successfully loaded SVG from:', url, 'Length:', svgContent.length);\n return sanitizeSvg(svgContent, replaceColors);\n }),\n catchError(error => {\n console.error(`[SvgLoaderService] Failed to load SVG from ${url}:`, error);\n return of('');\n }),\n shareReplay(1)\n );\n\n urlCache.set(replaceColors, svg$);\n return svg$;\n }\n\n /**\n * Clears the SVG cache\n */\n clearCache(): void {\n this.cache.clear();\n }\n}\n","import {\n Component,\n Input,\n OnChanges,\n SimpleChanges,\n HostBinding,\n inject,\n ChangeDetectorRef\n} from '@angular/core';\nimport { DomSanitizer } from '@angular/platform-browser';\nimport { CommonModule } from '@angular/common';\nimport { SvgLoaderService } from '../services/svg-loader.service';\nimport { processSvgConfig, SvgFlexConfig, SvgSize, SvgColor } from '@svgflex/core';\n\n/**\n * SVGFlex Component\n *\n * Renders SVG icons with customizable color and size.\n * Supports both inline SVG (for full style control) and external references.\n * Compatible with both Zone.js and Zoneless Angular applications.\n *\n * @example\n * <svgflex src=\"assets/icons/home.svg\" color=\"red\" size=\"32\"></svgflex>\n * <svgflex src=\"assets/icons/user.svg\" color=\"currentColor\" [size]=\"{width: '2rem', height: '2rem'}\"></svgflex>\n */\n@Component({\n selector: 'svgflex',\n standalone: true,\n imports: [CommonModule],\n templateUrl: './svgflex.component.html',\n styleUrl: './svgflex.component.scss'\n})\nexport class SvgflexComponent implements OnChanges {\n private svgLoader = inject(SvgLoaderService);\n private sanitizer = inject(DomSanitizer);\n private cdr = inject(ChangeDetectorRef);\n\n /** Path or URL to the SVG file */\n @Input({ required: true }) src!: string;\n\n /** Color for the SVG (defaults to 'currentColor') */\n @Input() color?: SvgColor;\n\n /** Size for the SVG (number in px, string with units, or {width, height} object) */\n @Input() size?: SvgSize;\n\n /** Additional CSS classes */\n @Input() class?: string;\n\n /** Accessibility label */\n @Input() ariaLabel?: string;\n\n /** Alternative text / Accessibility label (alias for ariaLabel) */\n @Input() alt?: string;\n\n /** Whether to inline the SVG (default: true) */\n @Input() inline: boolean = true;\n\n /** Whether to replace hardcoded colors with currentColor (default: true) */\n @Input() replaceColors: boolean = true;\n\n // Processed values\n protected width: string = '24px';\n protected height: string = '24px';\n protected processedReplaceColors: boolean = true;\n protected svgContent: any = null;\n\n // Apply CSS classes to :host element\n @HostBinding('class')\n get hostClasses(): string {\n return this.class || '';\n }\n\n // Apply inline styles to :host element when size is specified\n @HostBinding('style.width')\n get hostWidth(): string | null {\n return this.size ? this.width : null;\n }\n\n @HostBinding('style.height')\n get hostHeight(): string | null {\n return this.size ? this.height : null;\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n const config: SvgFlexConfig = {\n src: this.src,\n color: this.color,\n size: this.size,\n class: this.class,\n ariaLabel: this.ariaLabel || this.alt,\n inline: this.inline,\n replaceColors: this.replaceColors\n };\n\n const processed = processSvgConfig(config);\n\n this.width = processed.width;\n this.height = processed.height;\n this.processedReplaceColors = processed.replaceColors;\n this.ariaLabel = processed.ariaLabel;\n\n console.log('[SvgflexComponent] Processed config:', {\n width: this.width,\n height: this.height,\n color: this.color,\n replaceColors: this.processedReplaceColors,\n src: this.src\n });\n\n // Load SVG content if inline mode is enabled\n // Check if src or inline changed, or if it's the first change (firstChange)\n if (this.inline && (changes['src'] || changes['inline'] || changes['replaceColors'] || Object.keys(changes).length > 0)) {\n this.loadSvgContent();\n }\n }\n\n private loadSvgContent(): void {\n console.log('[SvgflexComponent] loadSvgContent called, src:', this.src, 'inline:', this.inline, 'replaceColors:', this.processedReplaceColors);\n\n if (!this.src) {\n console.log('[SvgflexComponent] No src provided, skipping load');\n return;\n }\n\n this.svgLoader.loadSvg(this.src, this.processedReplaceColors).subscribe((content: string) => {\n console.log('[SvgflexComponent] Received SVG content, length:', content.length);\n if (content) {\n // SVG is already sanitized by SvgLoaderService\n // Directly bypass security and trust the HTML\n this.svgContent = this.sanitizer.bypassSecurityTrustHtml(content);\n console.log('[SvgflexComponent] SVG content set successfully');\n } else {\n console.log('[SvgflexComponent] Received empty content');\n }\n // Manually trigger change detection for Zoneless compatibility\n this.cdr.markForCheck();\n });\n }\n}\n","<div\n class=\"svgflex-container\"\n [style.color]=\"color || null\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.role]=\"ariaLabel ? 'img' : null\"\n [attr.title]=\"ariaLabel\"\n>\n @if (inline && svgContent) {\n <div [innerHTML]=\"svgContent\" class=\"svgflex-inline\"></div>\n } @else if (!inline) {\n <img\n [src]=\"src\"\n [alt]=\"ariaLabel || ''\"\n [title]=\"ariaLabel\"\n [style.width]=\"width\"\n [style.height]=\"height\"\n />\n } @else {\n <div class=\"svgflex-loading\"></div>\n }\n</div>\n","/*\n * Public API Surface of @svgflex/angular\n */\n\n// Components\nexport * from './lib/components/svgflex.component';\n\n// Services\nexport * from './lib/services/svg-loader.service';\n\n// Re-export core types and utils for convenience\nexport * from '@svgflex/core';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;AAMA;;AAEG;MAIU,gBAAgB,CAAA;AAGP,IAAA,IAAA;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AAA,EAAA,aAAA,EAAA,eAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,OAAA,EAAA,kBAAA,EAAA,aAAA,EAAA,gBAAA,EAAA,cAAA,EAAA,iBAAA,EAAA,EAAA,EAAA,aAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EChC7B,miBAqBA,EAAA,MAAA,EAAA,CAAA,yzCAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDOY,YAAY,EAAA,CAAA,EAAA,CAAA;;2FAIX,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAP5B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,SAAS,EAAA,UAAA,EACP,IAAI,EAAA,OAAA,EACP,CAAC,YAAY,CAAC,EAAA,QAAA,EAAA,miBAAA,EAAA,MAAA,EAAA,CAAA,yzCAAA,CAAA,EAAA;;sBAUtB,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;;sBAGxB;;sBAGA;;sBAGA;;sBAGA;;sBAGA;;sBAGA;;sBAGA;;sBASA,WAAW;uBAAC,OAAO;;sBAMnB,WAAW;uBAAC,aAAa;;sBAKzB,WAAW;uBAAC,cAAc;;;AE/E7B;;AAEG;AAEH;;ACJA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"svgflex-angular.mjs","sources":["../../../packages/angular/src/lib/services/svg-loader.service.ts","../../../packages/angular/src/lib/components/svgflex.component.ts","../../../packages/angular/src/lib/components/svgflex.component.html","../../../packages/angular/src/public-api.ts","../../../packages/angular/src/svgflex-angular.ts"],"sourcesContent":["import { Injectable, isDevMode } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport { Observable, of } from 'rxjs';\nimport { map, catchError, shareReplay } from 'rxjs/operators';\nimport { sanitizeSvg } from '@svgflex/core';\n\n/**\n * Service for loading and caching SVG content\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class SvgLoaderService {\n private cache = new Map<string, Map<boolean, Observable<string>>>();\n\n constructor(private http: HttpClient) {}\n\n /**\n * Loads SVG content from a URL with caching\n * @param url - URL to load the SVG from\n * @param replaceColors - Whether to replace hardcoded colors with currentColor (default: true)\n */\n loadSvg(url: string, replaceColors: boolean = true): Observable<string> {\n if (isDevMode()) {\n console.log('[SvgLoaderService] Loading SVG from:', url, 'replaceColors:', replaceColors);\n }\n\n // Check cache with both url and replaceColors as key\n if (!this.cache.has(url)) {\n this.cache.set(url, new Map());\n }\n\n const urlCache = this.cache.get(url)!;\n if (urlCache.has(replaceColors)) {\n if (isDevMode()) {\n console.log('[SvgLoaderService] Returning cached SVG for:', url, 'replaceColors:', replaceColors);\n }\n return urlCache.get(replaceColors)!;\n }\n\n const svg$ = this.http.get(url, { responseType: 'text' }).pipe(\n map(svgContent => {\n if (isDevMode()) {\n console.log('[SvgLoaderService] Successfully loaded SVG from:', url, 'Length:', svgContent.length);\n }\n return sanitizeSvg(svgContent, replaceColors);\n }),\n catchError(error => {\n console.error(`[SvgLoaderService] Failed to load SVG from ${url}:`, error);\n return of('');\n }),\n shareReplay(1)\n );\n\n urlCache.set(replaceColors, svg$);\n return svg$;\n }\n\n /**\n * Clears the SVG cache\n */\n clearCache(): void {\n this.cache.clear();\n }\n}\n","import {\n Component,\n Input,\n OnChanges,\n SimpleChanges,\n HostBinding,\n inject,\n ChangeDetectorRef,\n isDevMode\n} from '@angular/core';\nimport { DomSanitizer } from '@angular/platform-browser';\n\nimport { SvgLoaderService } from '../services/svg-loader.service';\nimport { processSvgConfig, SvgFlexConfig, SvgSize, SvgColor } from '@svgflex/core';\n\n/**\n * SVGFlex Component\n *\n * Renders SVG icons with customizable color and size.\n * Supports both inline SVG (for full style control) and external references.\n * Compatible with both Zone.js and Zoneless Angular applications.\n *\n * @example\n * <svgflex src=\"assets/icons/home.svg\" color=\"red\" size=\"32\"></svgflex>\n * <svgflex src=\"assets/icons/user.svg\" color=\"currentColor\" [size]=\"{width: '2rem', height: '2rem'}\"></svgflex>\n */\n@Component({\n selector: 'svgflex',\n standalone: true,\n imports: [],\n templateUrl: './svgflex.component.html',\n styleUrl: './svgflex.component.scss'\n})\nexport class SvgflexComponent implements OnChanges {\n private svgLoader = inject(SvgLoaderService);\n private sanitizer = inject(DomSanitizer);\n private cdr = inject(ChangeDetectorRef);\n\n /** Path or URL to the SVG file */\n @Input({ required: true }) src!: string;\n\n /** Color for the SVG (defaults to 'currentColor') */\n @Input() color?: SvgColor;\n\n /** Size for the SVG (number in px, string with units, or {width, height} object) */\n @Input() size?: SvgSize;\n\n /** Additional CSS classes */\n @Input() class?: string;\n\n /** Accessibility label */\n @Input() ariaLabel?: string;\n\n /** Alternative text / Accessibility label (alias for ariaLabel) */\n @Input() alt?: string;\n\n /** Whether to inline the SVG (default: true) */\n @Input() inline: boolean = true;\n\n /** Whether to replace hardcoded colors with currentColor (default: true) */\n @Input() replaceColors: boolean = true;\n\n // Processed values\n protected width: string = '24px';\n protected height: string = '24px';\n protected processedReplaceColors: boolean = true;\n protected svgContent: any = null;\n\n // Apply CSS classes to :host element\n @HostBinding('class')\n get hostClasses(): string {\n return this.class || '';\n }\n\n // Apply inline styles to :host element when size is specified\n @HostBinding('style.width')\n get hostWidth(): string | null {\n return this.size ? this.width : null;\n }\n\n @HostBinding('style.height')\n get hostHeight(): string | null {\n return this.size ? this.height : null;\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n const config: SvgFlexConfig = {\n src: this.src,\n color: this.color,\n size: this.size,\n class: this.class,\n ariaLabel: this.ariaLabel || this.alt,\n inline: this.inline,\n replaceColors: this.replaceColors\n };\n\n const processed = processSvgConfig(config);\n\n this.width = processed.width;\n this.height = processed.height;\n this.processedReplaceColors = processed.replaceColors;\n this.ariaLabel = processed.ariaLabel;\n\n if (isDevMode()) {\n console.log('[SvgflexComponent] Processed config:', {\n width: this.width,\n height: this.height,\n color: this.color,\n replaceColors: this.processedReplaceColors,\n src: this.src\n });\n }\n\n // Load SVG content if inline mode is enabled\n // Check if src or inline changed, or if it's the first change (firstChange)\n if (this.inline && (changes['src'] || changes['inline'] || changes['replaceColors'] || Object.keys(changes).length > 0)) {\n this.loadSvgContent();\n }\n }\n\n private loadSvgContent(): void {\n if (isDevMode()) {\n console.log('[SvgflexComponent] loadSvgContent called, src:', this.src, 'inline:', this.inline, 'replaceColors:', this.processedReplaceColors);\n }\n\n if (!this.src) {\n if (isDevMode()) {\n console.log('[SvgflexComponent] No src provided, skipping load');\n }\n return;\n }\n\n this.svgLoader.loadSvg(this.src, this.processedReplaceColors).subscribe((content: string) => {\n if (isDevMode()) {\n console.log('[SvgflexComponent] Received SVG content, length:', content.length);\n }\n if (content) {\n // SVG is already sanitized by SvgLoaderService\n // Directly bypass security and trust the HTML\n this.svgContent = this.sanitizer.bypassSecurityTrustHtml(content);\n if (isDevMode()) {\n console.log('[SvgflexComponent] SVG content set successfully');\n }\n } else {\n if (isDevMode()) {\n console.log('[SvgflexComponent] Received empty content');\n }\n }\n // Manually trigger change detection for Zoneless compatibility\n this.cdr.markForCheck();\n });\n }\n}\n","<div\n class=\"svgflex-container\"\n [style.color]=\"color || null\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.role]=\"ariaLabel ? 'img' : null\"\n [attr.title]=\"ariaLabel\"\n>\n @if (inline && svgContent) {\n <div [innerHTML]=\"svgContent\" class=\"svgflex-inline\"></div>\n } @else if (!inline) {\n <img\n [src]=\"src\"\n [alt]=\"ariaLabel || ''\"\n [title]=\"ariaLabel\"\n [style.width]=\"width\"\n [style.height]=\"height\"\n />\n } @else {\n <div class=\"svgflex-loading\"></div>\n }\n</div>\n","/*\n * Public API Surface of @svgflex/angular\n */\n\n// Components\nexport * from './lib/components/svgflex.component';\n\n// Services\nexport * from './lib/services/svg-loader.service';\n\n// Re-export core types and utils for convenience\nexport * from '@svgflex/core';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;A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AAA,CAAC,CAAC;IACJ;uGAtHW,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAhB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,gBAAgB,+WCjC7B,miBAqBA,EAAA,MAAA,EAAA,CAAA,wlDAAA,CAAA,EAAA,CAAA;;2FDYa,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAP5B,SAAS;+BACE,SAAS,EAAA,UAAA,EACP,IAAI,EAAA,OAAA,EACP,EAAE,EAAA,QAAA,EAAA,miBAAA,EAAA,MAAA,EAAA,CAAA,wlDAAA,CAAA,EAAA;;sBAUV,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;;sBAGxB;;sBAGA;;sBAGA;;sBAGA;;sBAGA;;sBAGA;;sBAGA;;sBASA,WAAW;uBAAC,OAAO;;sBAMnB,WAAW;uBAAC,aAAa;;sBAKzB,WAAW;uBAAC,cAAc;;;AEhF7B;;AAEG;AAEH;;ACJA;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@svgflex/angular",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Angular library for SVG icons with easy color and size customization",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"svg",
|
|
@@ -26,23 +26,24 @@
|
|
|
26
26
|
"access": "public"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@angular/common": "
|
|
30
|
-
"@angular/core": "
|
|
31
|
-
"@svgflex/core": "^0.
|
|
29
|
+
"@angular/common": ">=20.0.0",
|
|
30
|
+
"@angular/core": ">=20.0.0",
|
|
31
|
+
"@svgflex/core": "^0.2.0"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"tslib": "^2.3.0"
|
|
35
35
|
},
|
|
36
36
|
"sideEffects": false,
|
|
37
37
|
"module": "fesm2022/svgflex-angular.mjs",
|
|
38
|
-
"typings": "
|
|
38
|
+
"typings": "types/svgflex-angular.d.ts",
|
|
39
39
|
"exports": {
|
|
40
40
|
"./package.json": {
|
|
41
41
|
"default": "./package.json"
|
|
42
42
|
},
|
|
43
43
|
".": {
|
|
44
|
-
"types": "./
|
|
44
|
+
"types": "./types/svgflex-angular.d.ts",
|
|
45
45
|
"default": "./fesm2022/svgflex-angular.mjs"
|
|
46
46
|
}
|
|
47
|
-
}
|
|
47
|
+
},
|
|
48
|
+
"type": "module"
|
|
48
49
|
}
|
|
File without changes
|