Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angular-svg-icon

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-svg-icon - npm Package Compare versions

Comparing version 5.1.0 to 5.1.1

2

angular-svg-icon.metadata.json

@@ -1,1 +0,1 @@

{"__symbolic":"module","version":4,"metadata":{"AngularSvgIconModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":7,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":9,"character":2}],"declarations":[{"__symbolic":"reference","name":"SvgIconComponent"}],"providers":[{"__symbolic":"reference","name":"SVG_ICON_REGISTRY_PROVIDER"}],"exports":[{"__symbolic":"reference","name":"SvgIconComponent"}]}]}],"members":{}},"SvgIconRegistryService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":14,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/common/http","name":"HttpClient","line":20,"character":26}]}],"loadSvg":[{"__symbolic":"method"}],"unloadSvg":[{"__symbolic":"method"}]}},"SVG_ICON_REGISTRY_PROVIDER_FACTORY":{"__symbolic":"function","parameters":["parentRegistry","http"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"reference","name":"parentRegistry"},"right":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"SvgIconRegistryService"},"arguments":[{"__symbolic":"reference","name":"http"}]}}},"SVG_ICON_REGISTRY_PROVIDER":{"provide":{"__symbolic":"reference","name":"SvgIconRegistryService"},"deps":[[{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":67,"character":14}},{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"SkipSelf","line":67,"character":30}},{"__symbolic":"reference","name":"SvgIconRegistryService"}],{"__symbolic":"reference","module":"@angular/common/http","name":"HttpClient","line":20,"character":26}],"useFactory":{"__symbolic":"reference","name":"SVG_ICON_REGISTRY_PROVIDER_FACTORY"}},"SvgIconComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":9,"character":1},"arguments":[{"selector":"svg-icon","styles":[":host { display: inline-block; }"],"template":"<ng-content></ng-content>"}]}],"members":{"src":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":16,"character":2}}]}],"stretch":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":17,"character":2}}]}],"svgStyle":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":20,"character":2}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":33,"character":29},{"__symbolic":"reference","module":"@angular/core","name":"KeyValueDiffers","line":34,"character":18},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":35,"character":19},{"__symbolic":"reference","name":"SvgIconRegistryService"}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"ngDoCheck":[{"__symbolic":"method"}],"init":[{"__symbolic":"method"}],"destroy":[{"__symbolic":"method"}],"setSvg":[{"__symbolic":"method"}],"stylize":[{"__symbolic":"method"}],"applyChanges":[{"__symbolic":"method"}],"setStyle":[{"__symbolic":"method"}]}}},"origins":{"AngularSvgIconModule":"./src/angular-svg-icon.module","SvgIconRegistryService":"./src/svg-icon-registry.service","SVG_ICON_REGISTRY_PROVIDER_FACTORY":"./src/svg-icon-registry.service","SVG_ICON_REGISTRY_PROVIDER":"./src/svg-icon-registry.service","SvgIconComponent":"./src/svg-icon.component"},"importAs":"angular-svg-icon"}
{"__symbolic":"module","version":4,"metadata":{"AngularSvgIconModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":7,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":9,"character":2}],"declarations":[{"__symbolic":"reference","name":"SvgIconComponent"}],"providers":[{"__symbolic":"reference","name":"SVG_ICON_REGISTRY_PROVIDER"}],"exports":[{"__symbolic":"reference","name":"SvgIconComponent"}]}]}],"members":{}},"SvgIconRegistryService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":14,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/common/http","name":"HttpClient","line":20,"character":26}]}],"loadSvg":[{"__symbolic":"method"}],"unloadSvg":[{"__symbolic":"method"}]}},"SVG_ICON_REGISTRY_PROVIDER_FACTORY":{"__symbolic":"function","parameters":["parentRegistry","http"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"reference","name":"parentRegistry"},"right":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"SvgIconRegistryService"},"arguments":[{"__symbolic":"reference","name":"http"}]}}},"SVG_ICON_REGISTRY_PROVIDER":{"provide":{"__symbolic":"reference","name":"SvgIconRegistryService"},"deps":[[{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":67,"character":14}},{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"SkipSelf","line":67,"character":30}},{"__symbolic":"reference","name":"SvgIconRegistryService"}],{"__symbolic":"reference","module":"@angular/common/http","name":"HttpClient","line":20,"character":26}],"useFactory":{"__symbolic":"reference","name":"SVG_ICON_REGISTRY_PROVIDER_FACTORY"}},"SvgIconComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":9,"character":1},"arguments":[{"selector":"svg-icon","styles":[":host { display: inline-block; }"],"template":"<ng-content></ng-content>"}]}],"members":{"src":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":16,"character":2}}]}],"stretch":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":17,"character":2}}]}],"svgStyle":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":20,"character":2}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":33,"character":29},{"__symbolic":"reference","module":"@angular/core","name":"KeyValueDiffers","line":34,"character":18},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":35,"character":19},{"__symbolic":"reference","name":"SvgIconRegistryService"}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"ngDoCheck":[{"__symbolic":"method"}],"init":[{"__symbolic":"method"}],"destroy":[{"__symbolic":"method"}],"resetDiffer":[{"__symbolic":"method"}],"setSvg":[{"__symbolic":"method"}],"stylize":[{"__symbolic":"method"}],"applyChanges":[{"__symbolic":"method"}],"setStyle":[{"__symbolic":"method"}]}}},"origins":{"AngularSvgIconModule":"./src/angular-svg-icon.module","SvgIconRegistryService":"./src/svg-icon-registry.service","SVG_ICON_REGISTRY_PROVIDER_FACTORY":"./src/svg-icon-registry.service","SVG_ICON_REGISTRY_PROVIDER":"./src/svg-icon-registry.service","SvgIconComponent":"./src/svg-icon.component"},"importAs":"angular-svg-icon"}

@@ -130,3 +130,5 @@ (function (global, factory) {

if (changeRecord['src']) {
this.destroy();
if (this.svg) {
this.destroy();
}
this.init();

@@ -150,5 +152,8 @@ }

_this.setSvg(svg);
_this.resetDiffer();
});
};
SvgIconComponent.prototype.destroy = function () {
this.svg = undefined;
this.differ = undefined;
if (this.icnSub) {

@@ -158,2 +163,9 @@ this.icnSub.unsubscribe();

};
SvgIconComponent.prototype.resetDiffer = function () {
if (this._svgStyle) {
if (!this.differ) {
this.differ = this.differs.find(this._svgStyle).create();
}
}
};
SvgIconComponent.prototype.setSvg = function (svg) {

@@ -160,0 +172,0 @@ if (svg) {

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common/http"),require("rxjs/Observable"),require("rxjs/add/observable/of"),require("rxjs/add/operator/catch"),require("rxjs/add/operator/do"),require("rxjs/add/operator/finally"),require("rxjs/add/operator/map"),require("rxjs/add/operator/share"),require("rxjs/add/observable/throw"),require("@angular/common")):"function"==typeof define&&define.amd?define("angular-svg-icon",["exports","@angular/core","@angular/common/http","rxjs/Observable","rxjs/add/observable/of","rxjs/add/operator/catch","rxjs/add/operator/do","rxjs/add/operator/finally","rxjs/add/operator/map","rxjs/add/operator/share","rxjs/add/observable/throw","@angular/common"],t):t(e["angular-svg-icon"]={},e.ng.core,e.ng.common.http,e.Rx,e.Rx.Observable,e.Rx.Observable.prototype,e.Rx.Observable.prototype,e.Rx.Observable.prototype,e.Rx.Observable.prototype,e.Rx.Observable.prototype,e.Rx.Observable,e.ng.common)}(this,function(e,t,r,n,o,i,s,a,c,l,p,u){"use strict";var d=function(){function e(e){this.http=e,this.iconsByUrl=new Map,this.iconsLoadingByUrl=new Map}return e.prototype.loadSvg=function(t){var r=this;if(this.iconsByUrl.has(t))return n.Observable.of(this.iconsByUrl.get(t));if(this.iconsLoadingByUrl.has(t))return this.iconsLoadingByUrl.get(t);var e=this.http.get(t,{responseType:"text"}).map(function(e){var t=document.createElement("DIV");return t.innerHTML=e,t.querySelector("svg")})["do"](function(e){r.iconsByUrl.set(t,e)})["catch"](function(e){return console.error(e),n.Observable["throw"](e)})["finally"](function(){r.iconsLoadingByUrl["delete"](t)}).share();return this.iconsLoadingByUrl.set(t,e),e},e.prototype.unloadSvg=function(e){this.iconsByUrl.has(e)&&this.iconsByUrl["delete"](e)},e}();function h(e,t){return e||new d(t)}d.decorators=[{type:t.Injectable}],d.ctorParameters=function(){return[{type:r.HttpClient}]};var f={provide:d,deps:[[new t.Optional,new t.SkipSelf,d],r.HttpClient],useFactory:h},y=function(){function e(e,t,r,n){this.element=e,this.differs=t,this.renderer=r,this.iconReg=n,this.stretch=!1}return Object.defineProperty(e.prototype,"svgStyle",{set:function(e){this._svgStyle=e,!this.differ&&e&&(this.differ=this.differs.find(e).create())},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){this.init()},e.prototype.ngOnDestroy=function(){this.destroy()},e.prototype.ngOnChanges=function(e){e.src&&(this.destroy(),this.init()),e.stretch&&this.stylize()},e.prototype.ngDoCheck=function(){if(this.svg&&this.differ){var e=this.differ.diff(this._svgStyle);e&&this.applyChanges(e)}},e.prototype.init=function(){var t=this;this.icnSub=this.iconReg.loadSvg(this.src).subscribe(function(e){t.setSvg(e)})},e.prototype.destroy=function(){this.icnSub&&this.icnSub.unsubscribe()},e.prototype.setSvg=function(e){if(e){var t=(this.svg=e).cloneNode(!0),r=this.element.nativeElement;r.innerHTML="",this.renderer.appendChild(r,t),this.stylize()}},e.prototype.stylize=function(){if(this.svg){var e=this.element.nativeElement.firstChild;!0===this.stretch?this.renderer.setAttribute(e,"preserveAspectRatio","none"):!1===this.stretch&&this.renderer.removeAttribute(e,"preserveAspectRatio")}},e.prototype.applyChanges=function(e){var t=this;e.forEachRemovedItem(function(e){return t.setStyle(e.key,null)}),e.forEachAddedItem(function(e){return t.setStyle(e.key,e.currentValue)}),e.forEachChangedItem(function(e){return t.setStyle(e.key,e.currentValue)})},e.prototype.setStyle=function(e,t){var r=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)s.push(n.value)}catch(a){o={error:a}}finally{try{n&&!n.done&&(r=i["return"])&&r.call(i)}finally{if(o)throw o.error}}return s}(e.split("."),2),n=r[0],o=r[1];t=null!==t&&o?""+t+o:t;var i=this.element.nativeElement.firstChild;null!==t?this.renderer.setStyle(i,n,t):this.renderer.removeStyle(i,n)},e}();y.decorators=[{type:t.Component,args:[{selector:"svg-icon",styles:[":host { display: inline-block; }"],template:"<ng-content></ng-content>"}]}],y.ctorParameters=function(){return[{type:t.ElementRef},{type:t.KeyValueDiffers},{type:t.Renderer2},{type:d}]},y.propDecorators={src:[{type:t.Input}],stretch:[{type:t.Input}],svgStyle:[{type:t.Input}]};var v=function(){};v.decorators=[{type:t.NgModule,args:[{imports:[u.CommonModule],declarations:[y],providers:[f],exports:[y]}]}],e.AngularSvgIconModule=v,e.SvgIconRegistryService=d,e.SVG_ICON_REGISTRY_PROVIDER_FACTORY=h,e.SVG_ICON_REGISTRY_PROVIDER=f,e.SvgIconComponent=y,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common/http"),require("rxjs/Observable"),require("rxjs/add/observable/of"),require("rxjs/add/operator/catch"),require("rxjs/add/operator/do"),require("rxjs/add/operator/finally"),require("rxjs/add/operator/map"),require("rxjs/add/operator/share"),require("rxjs/add/observable/throw"),require("@angular/common")):"function"==typeof define&&define.amd?define("angular-svg-icon",["exports","@angular/core","@angular/common/http","rxjs/Observable","rxjs/add/observable/of","rxjs/add/operator/catch","rxjs/add/operator/do","rxjs/add/operator/finally","rxjs/add/operator/map","rxjs/add/operator/share","rxjs/add/observable/throw","@angular/common"],t):t(e["angular-svg-icon"]={},e.ng.core,e.ng.common.http,e.Rx,e.Rx.Observable,e.Rx.Observable.prototype,e.Rx.Observable.prototype,e.Rx.Observable.prototype,e.Rx.Observable.prototype,e.Rx.Observable.prototype,e.Rx.Observable,e.ng.common)}(this,function(e,t,r,n,o,i,s,a,c,l,p,u){"use strict";var d=function(){function e(e){this.http=e,this.iconsByUrl=new Map,this.iconsLoadingByUrl=new Map}return e.prototype.loadSvg=function(t){var r=this;if(this.iconsByUrl.has(t))return n.Observable.of(this.iconsByUrl.get(t));if(this.iconsLoadingByUrl.has(t))return this.iconsLoadingByUrl.get(t);var e=this.http.get(t,{responseType:"text"}).map(function(e){var t=document.createElement("DIV");return t.innerHTML=e,t.querySelector("svg")})["do"](function(e){r.iconsByUrl.set(t,e)})["catch"](function(e){return console.error(e),n.Observable["throw"](e)})["finally"](function(){r.iconsLoadingByUrl["delete"](t)}).share();return this.iconsLoadingByUrl.set(t,e),e},e.prototype.unloadSvg=function(e){this.iconsByUrl.has(e)&&this.iconsByUrl["delete"](e)},e}();function f(e,t){return e||new d(t)}d.decorators=[{type:t.Injectable}],d.ctorParameters=function(){return[{type:r.HttpClient}]};var h={provide:d,deps:[[new t.Optional,new t.SkipSelf,d],r.HttpClient],useFactory:f},y=function(){function e(e,t,r,n){this.element=e,this.differs=t,this.renderer=r,this.iconReg=n,this.stretch=!1}return Object.defineProperty(e.prototype,"svgStyle",{set:function(e){this._svgStyle=e,!this.differ&&e&&(this.differ=this.differs.find(e).create())},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){this.init()},e.prototype.ngOnDestroy=function(){this.destroy()},e.prototype.ngOnChanges=function(e){e.src&&(this.svg&&this.destroy(),this.init()),e.stretch&&this.stylize()},e.prototype.ngDoCheck=function(){if(this.svg&&this.differ){var e=this.differ.diff(this._svgStyle);e&&this.applyChanges(e)}},e.prototype.init=function(){var t=this;this.icnSub=this.iconReg.loadSvg(this.src).subscribe(function(e){t.setSvg(e),t.resetDiffer()})},e.prototype.destroy=function(){this.svg=undefined,this.differ=undefined,this.icnSub&&this.icnSub.unsubscribe()},e.prototype.resetDiffer=function(){this._svgStyle&&(this.differ||(this.differ=this.differs.find(this._svgStyle).create()))},e.prototype.setSvg=function(e){if(e){var t=(this.svg=e).cloneNode(!0),r=this.element.nativeElement;r.innerHTML="",this.renderer.appendChild(r,t),this.stylize()}},e.prototype.stylize=function(){if(this.svg){var e=this.element.nativeElement.firstChild;!0===this.stretch?this.renderer.setAttribute(e,"preserveAspectRatio","none"):!1===this.stretch&&this.renderer.removeAttribute(e,"preserveAspectRatio")}},e.prototype.applyChanges=function(e){var t=this;e.forEachRemovedItem(function(e){return t.setStyle(e.key,null)}),e.forEachAddedItem(function(e){return t.setStyle(e.key,e.currentValue)}),e.forEachChangedItem(function(e){return t.setStyle(e.key,e.currentValue)})},e.prototype.setStyle=function(e,t){var r=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)s.push(n.value)}catch(a){o={error:a}}finally{try{n&&!n.done&&(r=i["return"])&&r.call(i)}finally{if(o)throw o.error}}return s}(e.split("."),2),n=r[0],o=r[1];t=null!==t&&o?""+t+o:t;var i=this.element.nativeElement.firstChild;null!==t?this.renderer.setStyle(i,n,t):this.renderer.removeStyle(i,n)},e}();y.decorators=[{type:t.Component,args:[{selector:"svg-icon",styles:[":host { display: inline-block; }"],template:"<ng-content></ng-content>"}]}],y.ctorParameters=function(){return[{type:t.ElementRef},{type:t.KeyValueDiffers},{type:t.Renderer2},{type:d}]},y.propDecorators={src:[{type:t.Input}],stretch:[{type:t.Input}],svgStyle:[{type:t.Input}]};var v=function(){};v.decorators=[{type:t.NgModule,args:[{imports:[u.CommonModule],declarations:[y],providers:[h],exports:[y]}]}],e.AngularSvgIconModule=v,e.SvgIconRegistryService=d,e.SVG_ICON_REGISTRY_PROVIDER_FACTORY=f,e.SVG_ICON_REGISTRY_PROVIDER=h,e.SvgIconComponent=y,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=angular-svg-icon.umd.min.js.map

@@ -136,3 +136,5 @@ import { Injectable, Optional, SkipSelf, Component, ElementRef, Input, KeyValueDiffers, Renderer2, NgModule } from '@angular/core';

if (changeRecord['src']) {
this.destroy();
if (this.svg) {
this.destroy();
}
this.init();

@@ -161,2 +163,3 @@ }

this.setSvg(svg);
this.resetDiffer();
});

@@ -168,2 +171,4 @@ }

destroy() {
this.svg = undefined;
this.differ = undefined;
if (this.icnSub) {

@@ -174,2 +179,12 @@ this.icnSub.unsubscribe();

/**
* @return {?}
*/
resetDiffer() {
if (this._svgStyle) {
if (!this.differ) {
this.differ = this.differs.find(this._svgStyle).create();
}
}
}
/**
* @param {?} svg

@@ -176,0 +191,0 @@ * @return {?}

@@ -97,3 +97,5 @@ import { __read } from 'tslib';

if (changeRecord['src']) {
this.destroy();
if (this.svg) {
this.destroy();
}
this.init();

@@ -117,5 +119,8 @@ }

_this.setSvg(svg);
_this.resetDiffer();
});
};
SvgIconComponent.prototype.destroy = function () {
this.svg = undefined;
this.differ = undefined;
if (this.icnSub) {

@@ -125,2 +130,9 @@ this.icnSub.unsubscribe();

};
SvgIconComponent.prototype.resetDiffer = function () {
if (this._svgStyle) {
if (!this.differ) {
this.differ = this.differs.find(this._svgStyle).create();
}
}
};
SvgIconComponent.prototype.setSvg = function (svg) {

@@ -127,0 +139,0 @@ if (svg) {

@@ -5,3 +5,3 @@ {

"description": "Angular 5 component for inlining SVGs allowing them to be easily styled with CSS.",
"version": "5.1.0",
"version": "5.1.1",
"repository": {

@@ -8,0 +8,0 @@ "type": "git",

@@ -26,2 +26,3 @@ import { DoCheck, ElementRef, KeyValueDiffers, OnChanges, OnDestroy, OnInit, Renderer2, SimpleChange } from '@angular/core';

private destroy();
private resetDiffer();
private setSvg(svg);

@@ -28,0 +29,0 @@ private stylize();

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc