ng-inline-svg
Advanced tools
Comparing version 8.6.0 to 9.0.0
@@ -0,1 +1,10 @@ | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); | ||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | ||
return c > 3 && r && Object.defineProperty(target, key, r), r; | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
import { ChangeDetectionStrategy, Component, ElementRef, Input } from '@angular/core'; | ||
@@ -20,21 +29,28 @@ import { InlineSVGDirective } from './inline-svg.directive'; | ||
}; | ||
InlineSVGComponent.decorators = [ | ||
{ type: Component, args: [{ | ||
selector: 'inline-svg', | ||
template: '', | ||
changeDetection: ChangeDetectionStrategy.OnPush | ||
},] }, | ||
]; | ||
InlineSVGComponent.ctorParameters = function () { return [ | ||
{ type: InlineSVGService }, | ||
{ type: ElementRef } | ||
]; }; | ||
InlineSVGComponent.propDecorators = { | ||
context: [{ type: Input }], | ||
content: [{ type: Input }], | ||
replaceContents: [{ type: Input }], | ||
prepend: [{ type: Input }] | ||
}; | ||
__decorate([ | ||
Input(), | ||
__metadata("design:type", InlineSVGDirective) | ||
], InlineSVGComponent.prototype, "context", void 0); | ||
__decorate([ | ||
Input(), | ||
__metadata("design:type", Element) | ||
], InlineSVGComponent.prototype, "content", void 0); | ||
__decorate([ | ||
Input(), | ||
__metadata("design:type", Boolean) | ||
], InlineSVGComponent.prototype, "replaceContents", void 0); | ||
__decorate([ | ||
Input(), | ||
__metadata("design:type", Boolean) | ||
], InlineSVGComponent.prototype, "prepend", void 0); | ||
InlineSVGComponent = __decorate([ | ||
Component({ | ||
selector: 'inline-svg', | ||
template: '', | ||
changeDetection: ChangeDetectionStrategy.OnPush | ||
}), | ||
__metadata("design:paramtypes", [InlineSVGService, ElementRef]) | ||
], InlineSVGComponent); | ||
return InlineSVGComponent; | ||
}()); | ||
export { InlineSVGComponent }; |
@@ -0,1 +1,13 @@ | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); | ||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | ||
return c > 3 && r && Object.defineProperty(target, key, r), r; | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
var __param = (this && this.__param) || function (paramIndex, decorator) { | ||
return function (target, key) { decorator(target, key, paramIndex); } | ||
}; | ||
import { ComponentFactoryResolver, Directive, ElementRef, EventEmitter, Inject, Input, Optional, Output, PLATFORM_ID, Renderer2, ViewContainerRef, } from '@angular/core'; | ||
@@ -127,35 +139,72 @@ import { isPlatformBrowser, isPlatformServer } from '@angular/common'; | ||
}; | ||
InlineSVGDirective.decorators = [ | ||
{ type: Directive, args: [{ | ||
selector: '[inlineSVG]', | ||
providers: [SVGCacheService] | ||
},] }, | ||
]; | ||
InlineSVGDirective.ctorParameters = function () { return [ | ||
{ type: ElementRef }, | ||
{ type: ViewContainerRef }, | ||
{ type: ComponentFactoryResolver }, | ||
{ type: SVGCacheService }, | ||
{ type: Renderer2 }, | ||
{ type: InlineSVGService }, | ||
{ type: InlineSVGConfig, decorators: [{ type: Optional }] }, | ||
{ type: Object, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] } | ||
]; }; | ||
InlineSVGDirective.propDecorators = { | ||
inlineSVG: [{ type: Input }], | ||
replaceContents: [{ type: Input }], | ||
prepend: [{ type: Input }], | ||
injectComponent: [{ type: Input }], | ||
cacheSVG: [{ type: Input }], | ||
setSVGAttributes: [{ type: Input }], | ||
removeSVGAttributes: [{ type: Input }], | ||
forceEvalStyles: [{ type: Input }], | ||
evalScripts: [{ type: Input }], | ||
fallbackImgUrl: [{ type: Input }], | ||
onSVGLoaded: [{ type: Input }], | ||
onSVGInserted: [{ type: Output }], | ||
onSVGFailed: [{ type: Output }] | ||
}; | ||
__decorate([ | ||
Input(), | ||
__metadata("design:type", String) | ||
], InlineSVGDirective.prototype, "inlineSVG", void 0); | ||
__decorate([ | ||
Input(), | ||
__metadata("design:type", Boolean) | ||
], InlineSVGDirective.prototype, "replaceContents", void 0); | ||
__decorate([ | ||
Input(), | ||
__metadata("design:type", Boolean) | ||
], InlineSVGDirective.prototype, "prepend", void 0); | ||
__decorate([ | ||
Input(), | ||
__metadata("design:type", Boolean) | ||
], InlineSVGDirective.prototype, "injectComponent", void 0); | ||
__decorate([ | ||
Input(), | ||
__metadata("design:type", Boolean) | ||
], InlineSVGDirective.prototype, "cacheSVG", void 0); | ||
__decorate([ | ||
Input(), | ||
__metadata("design:type", Object) | ||
], InlineSVGDirective.prototype, "setSVGAttributes", void 0); | ||
__decorate([ | ||
Input(), | ||
__metadata("design:type", Array) | ||
], InlineSVGDirective.prototype, "removeSVGAttributes", void 0); | ||
__decorate([ | ||
Input(), | ||
__metadata("design:type", Boolean) | ||
], InlineSVGDirective.prototype, "forceEvalStyles", void 0); | ||
__decorate([ | ||
Input(), | ||
__metadata("design:type", String) | ||
], InlineSVGDirective.prototype, "evalScripts", void 0); | ||
__decorate([ | ||
Input(), | ||
__metadata("design:type", String) | ||
], InlineSVGDirective.prototype, "fallbackImgUrl", void 0); | ||
__decorate([ | ||
Input(), | ||
__metadata("design:type", Function) | ||
], InlineSVGDirective.prototype, "onSVGLoaded", void 0); | ||
__decorate([ | ||
Output(), | ||
__metadata("design:type", EventEmitter) | ||
], InlineSVGDirective.prototype, "onSVGInserted", void 0); | ||
__decorate([ | ||
Output(), | ||
__metadata("design:type", EventEmitter) | ||
], InlineSVGDirective.prototype, "onSVGFailed", void 0); | ||
InlineSVGDirective = __decorate([ | ||
Directive({ | ||
selector: '[inlineSVG]', | ||
providers: [SVGCacheService] | ||
}), | ||
__param(6, Optional()), | ||
__param(7, Inject(PLATFORM_ID)), | ||
__metadata("design:paramtypes", [ElementRef, | ||
ViewContainerRef, | ||
ComponentFactoryResolver, | ||
SVGCacheService, | ||
Renderer2, | ||
InlineSVGService, | ||
InlineSVGConfig, | ||
Object]) | ||
], InlineSVGDirective); | ||
return InlineSVGDirective; | ||
}()); | ||
export { InlineSVGDirective }; |
@@ -0,1 +1,7 @@ | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); | ||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | ||
return c > 3 && r && Object.defineProperty(target, key, r), r; | ||
}; | ||
import { NgModule } from '@angular/core'; | ||
@@ -8,5 +14,6 @@ import { InlineSVGComponent } from './inline-svg.component'; | ||
} | ||
InlineSVGModule_1 = InlineSVGModule; | ||
InlineSVGModule.forRoot = function (config) { | ||
return { | ||
ngModule: InlineSVGModule, | ||
ngModule: InlineSVGModule_1, | ||
providers: [ | ||
@@ -17,11 +24,12 @@ { provide: InlineSVGConfig, useValue: config } | ||
}; | ||
InlineSVGModule.decorators = [ | ||
{ type: NgModule, args: [{ | ||
declarations: [InlineSVGDirective, InlineSVGComponent], | ||
exports: [InlineSVGDirective], | ||
entryComponents: [InlineSVGComponent] | ||
},] }, | ||
]; | ||
var InlineSVGModule_1; | ||
InlineSVGModule = InlineSVGModule_1 = __decorate([ | ||
NgModule({ | ||
declarations: [InlineSVGDirective, InlineSVGComponent], | ||
exports: [InlineSVGDirective], | ||
entryComponents: [InlineSVGComponent] | ||
}) | ||
], InlineSVGModule); | ||
return InlineSVGModule; | ||
}()); | ||
export { InlineSVGModule }; |
@@ -0,1 +1,10 @@ | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); | ||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | ||
return c > 3 && r && Object.defineProperty(target, key, r), r; | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
import { Injectable, RendererFactory2 } from '@angular/core'; | ||
@@ -45,13 +54,11 @@ import * as i0 from "@angular/core"; | ||
}; | ||
InlineSVGService.decorators = [ | ||
{ type: Injectable, args: [{ | ||
providedIn: 'root' | ||
},] }, | ||
]; | ||
InlineSVGService.ctorParameters = function () { return [ | ||
{ type: RendererFactory2 } | ||
]; }; | ||
InlineSVGService.ngInjectableDef = i0.defineInjectable({ factory: function InlineSVGService_Factory() { return new InlineSVGService(i0.inject(i0.RendererFactory2)); }, token: InlineSVGService, providedIn: "root" }); | ||
InlineSVGService.ngInjectableDef = i0.ɵɵdefineInjectable({ factory: function InlineSVGService_Factory() { return new InlineSVGService(i0.ɵɵinject(i0.RendererFactory2)); }, token: InlineSVGService, providedIn: "root" }); | ||
InlineSVGService = __decorate([ | ||
Injectable({ | ||
providedIn: 'root' | ||
}), | ||
__metadata("design:paramtypes", [RendererFactory2]) | ||
], InlineSVGService); | ||
return InlineSVGService; | ||
}()); | ||
export { InlineSVGService }; |
@@ -0,1 +1,13 @@ | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); | ||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | ||
return c > 3 && r && Object.defineProperty(target, key, r), r; | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
var __param = (this && this.__param) || function (paramIndex, decorator) { | ||
return function (target, key) { decorator(target, key, paramIndex); } | ||
}; | ||
import { Inject, Injectable, Optional, RendererFactory2 } from '@angular/core'; | ||
@@ -19,9 +31,10 @@ import { APP_BASE_HREF, PlatformLocation } from '@angular/common'; | ||
this.setBaseUrl(); | ||
if (!SVGCacheService._cache) { | ||
SVGCacheService._cache = new Map(); | ||
if (!SVGCacheService_1._cache) { | ||
SVGCacheService_1._cache = new Map(); | ||
} | ||
if (!SVGCacheService._inProgressReqs) { | ||
SVGCacheService._inProgressReqs = new Map(); | ||
if (!SVGCacheService_1._inProgressReqs) { | ||
SVGCacheService_1._inProgressReqs = new Map(); | ||
} | ||
} | ||
SVGCacheService_1 = SVGCacheService; | ||
SVGCacheService.prototype.getSVG = function (url, cache) { | ||
@@ -31,17 +44,17 @@ var _this = this; | ||
var absUrl = this.getAbsoluteUrl(url); | ||
if (cache && SVGCacheService._cache.has(absUrl)) { | ||
return of(this._cloneSVG(SVGCacheService._cache.get(absUrl))); | ||
if (cache && SVGCacheService_1._cache.has(absUrl)) { | ||
return of(this._cloneSVG(SVGCacheService_1._cache.get(absUrl))); | ||
} | ||
if (SVGCacheService._inProgressReqs.has(absUrl)) { | ||
return SVGCacheService._inProgressReqs.get(absUrl); | ||
if (SVGCacheService_1._inProgressReqs.has(absUrl)) { | ||
return SVGCacheService_1._inProgressReqs.get(absUrl); | ||
} | ||
var req = this._http.get(absUrl, { responseType: 'text' }) | ||
.pipe(finalize(function () { | ||
SVGCacheService._inProgressReqs.delete(absUrl); | ||
SVGCacheService_1._inProgressReqs.delete(absUrl); | ||
}), share(), map(function (svgText) { | ||
var svgEl = _this._svgElementFromString(svgText); | ||
SVGCacheService._cache.set(absUrl, svgEl); | ||
SVGCacheService_1._cache.set(absUrl, svgEl); | ||
return _this._cloneSVG(svgEl); | ||
})); | ||
SVGCacheService._inProgressReqs.set(absUrl, req); | ||
SVGCacheService_1._inProgressReqs.set(absUrl, req); | ||
return req; | ||
@@ -83,17 +96,18 @@ }; | ||
}; | ||
SVGCacheService.decorators = [ | ||
{ type: Injectable, args: [{ | ||
providedIn: 'root' | ||
},] }, | ||
]; | ||
SVGCacheService.ctorParameters = function () { return [ | ||
{ type: String, decorators: [{ type: Optional }, { type: Inject, args: [APP_BASE_HREF,] }] }, | ||
{ type: PlatformLocation, decorators: [{ type: Optional }] }, | ||
{ type: InlineSVGConfig, decorators: [{ type: Optional }] }, | ||
{ type: HttpClient }, | ||
{ type: RendererFactory2 } | ||
]; }; | ||
SVGCacheService.ngInjectableDef = i0.defineInjectable({ factory: function SVGCacheService_Factory() { return new SVGCacheService(i0.inject(i1.APP_BASE_HREF, 8), i0.inject(i1.PlatformLocation, 8), i0.inject(i2.InlineSVGConfig, 8), i0.inject(i3.HttpClient), i0.inject(i0.RendererFactory2)); }, token: SVGCacheService, providedIn: "root" }); | ||
var SVGCacheService_1; | ||
SVGCacheService.ngInjectableDef = i0.ɵɵdefineInjectable({ factory: function SVGCacheService_Factory() { return new SVGCacheService(i0.ɵɵinject(i1.APP_BASE_HREF, 8), i0.ɵɵinject(i1.PlatformLocation, 8), i0.ɵɵinject(i2.InlineSVGConfig, 8), i0.ɵɵinject(i3.HttpClient), i0.ɵɵinject(i0.RendererFactory2)); }, token: SVGCacheService, providedIn: "root" }); | ||
SVGCacheService = SVGCacheService_1 = __decorate([ | ||
Injectable({ | ||
providedIn: 'root' | ||
}), | ||
__param(0, Optional()), __param(0, Inject(APP_BASE_HREF)), | ||
__param(1, Optional()), | ||
__param(2, Optional()), | ||
__metadata("design:paramtypes", [String, PlatformLocation, | ||
InlineSVGConfig, | ||
HttpClient, | ||
RendererFactory2]) | ||
], SVGCacheService); | ||
return SVGCacheService; | ||
}()); | ||
export { SVGCacheService }; |
{ | ||
"name": "ng-inline-svg", | ||
"version": "8.6.0", | ||
"version": "9.0.0", | ||
"description": "Angular directive for inserting an SVG inline within an element.", | ||
@@ -37,18 +37,18 @@ "repository": { | ||
"peerDependencies": { | ||
"@angular/core": ">=6.0.0", | ||
"@angular/common": ">=6.0.0", | ||
"rxjs": "^6.0.0" | ||
"@angular/core": ">=8.0.0", | ||
"@angular/common": ">=8.0.0", | ||
"rxjs": "^6.5.2" | ||
}, | ||
"devDependencies": { | ||
"@angular/common": "^6.1.10", | ||
"@angular/compiler": "^6.1.10", | ||
"@angular/compiler-cli": "^6.1.10", | ||
"@angular/core": "^6.1.10", | ||
"@angular/platform-browser": "^6.1.10", | ||
"rimraf": "^2.6.3", | ||
"rxjs": "^6.4.0", | ||
"tslint": "^5.15.0", | ||
"typescript": "~2.9.2", | ||
"zone.js": "^0.8.20" | ||
"@angular/common": "^8.2.3", | ||
"@angular/compiler": "^8.2.3", | ||
"@angular/compiler-cli": "^8.2.3", | ||
"@angular/core": "^8.2.3", | ||
"@angular/platform-browser": "^8.2.3", | ||
"rimraf": "^3.0.0", | ||
"rxjs": "^6.5.2", | ||
"tslint": "^5.19.0", | ||
"typescript": "~3.4.0", | ||
"zone.js": "~0.9.1" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
61500
1100