@fortawesome/angular-fontawesome
Advanced tools
Comparing version 0.1.0-4 to 0.1.0-5
import { Component, HostBinding, Input, NgModule } from '@angular/core'; | ||
import { DomSanitizer } from '@angular/platform-browser'; | ||
import { icon, parse } from '@fortawesome/fontawesome'; | ||
import { config, icon, parse } from '@fortawesome/fontawesome'; | ||
@@ -105,4 +105,17 @@ var __assign = (undefined && undefined.__assign) || Object.assign || function(t) { | ||
var /** @type {?} */ renderedIcon = icon(iconSpec, __assign({}, classes, transform, mask, { symbol: this.symbol })); | ||
// @TODO: make sure that it doesn't break things to do html[0] here. | ||
this.renderedIconHTML = this.sanitizer.bypassSecurityTrustHtml(renderedIcon.html[0]); | ||
var /** @type {?} */ html; | ||
if (renderedIcon) { | ||
html = renderedIcon.html[0]; | ||
} | ||
else { | ||
html = "<svg class=\"" + config.replacementClass + "\" viewBox=\"0 0 448 512\"></svg><!--icon not found-->"; | ||
if (iconSpec == null) { | ||
console.error('Could not find icon. ' + | ||
"It looks like you've provided a null or undefined icon object to this component."); | ||
} | ||
else { | ||
console.error("Could not find icon: iconName=" + iconSpec.iconName + ", prefix=" + iconSpec.prefix); | ||
} | ||
} | ||
this.renderedIconHTML = this.sanitizer.bypassSecurityTrustHtml(html); | ||
}; | ||
@@ -109,0 +122,0 @@ FaIconComponent.decorators = [ |
import { Component, HostBinding, Input, NgModule } from '@angular/core'; | ||
import { DomSanitizer } from '@angular/platform-browser'; | ||
import { icon, parse } from '@fortawesome/fontawesome'; | ||
import { config, icon, parse } from '@fortawesome/fontawesome'; | ||
@@ -97,4 +97,17 @@ /** | ||
const /** @type {?} */ renderedIcon = icon(iconSpec, Object.assign({}, classes, transform, mask, { symbol: this.symbol })); | ||
// @TODO: make sure that it doesn't break things to do html[0] here. | ||
this.renderedIconHTML = this.sanitizer.bypassSecurityTrustHtml(renderedIcon.html[0]); | ||
let /** @type {?} */ html; | ||
if (renderedIcon) { | ||
html = renderedIcon.html[0]; | ||
} | ||
else { | ||
html = `<svg class="${config.replacementClass}" viewBox="0 0 448 512"></svg><!--icon not found-->`; | ||
if (iconSpec == null) { | ||
console.error('Could not find icon. ' + | ||
`It looks like you've provided a null or undefined icon object to this component.`); | ||
} | ||
else { | ||
console.error(`Could not find icon: iconName=${iconSpec.iconName}, prefix=${iconSpec.prefix}`); | ||
} | ||
} | ||
this.renderedIconHTML = this.sanitizer.bypassSecurityTrustHtml(html); | ||
} | ||
@@ -101,0 +114,0 @@ } |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":4,"metadata":{"FontAwesomeModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":3,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"FaIconComponent"}],"exports":[{"__symbolic":"reference","name":"FaIconComponent"}]}]}],"members":{}},"FaIconComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":79,"character":1},"arguments":[{"selector":"fa-icon","template":""}]}],"members":{"icon":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":84,"character":3}}]}],"mask":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":85,"character":3}}]}],"symbol":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":86,"character":3}}]}],"className":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":87,"character":3}}]}],"fixedWidth":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":88,"character":3}}]}],"spin":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":89,"character":3}}]}],"pulse":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":90,"character":3}}]}],"border":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":91,"character":3}}]}],"listItem":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":92,"character":3}}]}],"flip":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":93,"character":3}}]}],"size":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":94,"character":3}}]}],"rotate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":95,"character":3}}]}],"pull":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":96,"character":3}}]}],"transform":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":97,"character":3}}]}],"renderedIconHTML":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":99,"character":3},"arguments":["innerHTML"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/platform-browser","name":"DomSanitizer","line":100,"character":33}]}],"ngOnChanges":[{"__symbolic":"method"}]}}},"origins":{"FontAwesomeModule":"./angular-fontawesome.module","FaIconComponent":"./icon.component"},"importAs":"@fortawesome/angular-fontawesome"} | ||
{"__symbolic":"module","version":4,"metadata":{"FontAwesomeModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":3,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"FaIconComponent"}],"exports":[{"__symbolic":"reference","name":"FaIconComponent"}]}]}],"members":{}},"FaIconComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":80,"character":1},"arguments":[{"selector":"fa-icon","template":""}]}],"members":{"icon":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":85,"character":3}}]}],"mask":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":86,"character":3}}]}],"symbol":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":87,"character":3}}]}],"className":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":88,"character":3}}]}],"fixedWidth":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":89,"character":3}}]}],"spin":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":90,"character":3}}]}],"pulse":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":91,"character":3}}]}],"border":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":92,"character":3}}]}],"listItem":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":93,"character":3}}]}],"flip":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":94,"character":3}}]}],"size":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":95,"character":3}}]}],"rotate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":96,"character":3}}]}],"pull":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":97,"character":3}}]}],"transform":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":98,"character":3}}]}],"renderedIconHTML":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":100,"character":3},"arguments":["innerHTML"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/platform-browser","name":"DomSanitizer","line":101,"character":33}]}],"ngOnChanges":[{"__symbolic":"method"}]}}},"origins":{"FontAwesomeModule":"./angular-fontawesome.module","FaIconComponent":"./icon.component"},"importAs":"@fortawesome/angular-fontawesome"} |
@@ -107,4 +107,17 @@ (function (global, factory) { | ||
var /** @type {?} */ renderedIcon = fontawesome.icon(iconSpec, __assign({}, classes, transform, mask, { symbol: this.symbol })); | ||
// @TODO: make sure that it doesn't break things to do html[0] here. | ||
this.renderedIconHTML = this.sanitizer.bypassSecurityTrustHtml(renderedIcon.html[0]); | ||
var /** @type {?} */ html; | ||
if (renderedIcon) { | ||
html = renderedIcon.html[0]; | ||
} | ||
else { | ||
html = "<svg class=\"" + fontawesome.config.replacementClass + "\" viewBox=\"0 0 448 512\"></svg><!--icon not found-->"; | ||
if (iconSpec == null) { | ||
console.error('Could not find icon. ' + | ||
"It looks like you've provided a null or undefined icon object to this component."); | ||
} | ||
else { | ||
console.error("Could not find icon: iconName=" + iconSpec.iconName + ", prefix=" + iconSpec.prefix); | ||
} | ||
} | ||
this.renderedIconHTML = this.sanitizer.bypassSecurityTrustHtml(html); | ||
}; | ||
@@ -111,0 +124,0 @@ FaIconComponent.decorators = [ |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/platform-browser"),require("@fortawesome/fontawesome")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/platform-browser","@fortawesome/fontawesome"],e):e(t.angularFontAwesome={},t.ng.core,t.ng.platformBrowser,t.fontawesome)}(this,function(t,e,r,n){"use strict";var o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t};function i(t){return void 0===t||null===t?null:void 0!==(e=t).prefix&&void 0!==e.iconName?t:Array.isArray(t)&&2===t.length?{prefix:t[0],iconName:t[1]}:"string"==typeof t?{prefix:"fas",iconName:t}:void 0;var e}function s(t,e){return Array.isArray(e)&&e.length>0||!Array.isArray(e)&&e?((r={})[t]=e,r):{};var r}var a=function(){function t(t){this.sanitizer=t}return t.prototype.ngOnChanges=function(t){var e,r,a,p=i(this.icon),l={icon:null,spin:this.spin,pulse:this.pulse,fixedWidth:this.fixedWidth,border:this.border,listItem:this.listItem,flip:this.flip,size:this.size||null,rotate:this.rotate||null,pull:this.pull||null},u=s("classes",(e=l,(r={"fa-spin":e.spin,"fa-pulse":e.pulse,"fa-fw":e.fixedWidth,"fa-border":e.border,"fa-li":e.listItem,"fa-flip-horizontal":"horizontal"===e.flip||"both"===e.flip,"fa-flip-vertical":"vertical"===e.flip||"both"===e.flip})["fa-"+e.size]=null!==e.size,r["fa-rotate-"+e.rotate]=null!==e.rotate,r["fa-pull-"+e.pull]=null!==e.pull,a=r,Object.keys(a).map(function(t){return a[t]?t:null}).filter(function(t){return t})).concat((this.className||"").split(" "))),f=s("transform","string"==typeof this.transform?n.parse.transform(this.transform):this.transform),c=s("mask",i(this.mask)),m=n.icon(p,o({},u,f,c,{symbol:this.symbol}));this.renderedIconHTML=this.sanitizer.bypassSecurityTrustHtml(m.html[0])},t.decorators=[{type:e.Component,args:[{selector:"fa-icon",template:""}]}],t.ctorParameters=function(){return[{type:r.DomSanitizer}]},t.propDecorators={icon:[{type:e.Input}],mask:[{type:e.Input}],symbol:[{type:e.Input}],className:[{type:e.Input}],fixedWidth:[{type:e.Input}],spin:[{type:e.Input}],pulse:[{type:e.Input}],border:[{type:e.Input}],listItem:[{type:e.Input}],flip:[{type:e.Input}],size:[{type:e.Input}],rotate:[{type:e.Input}],pull:[{type:e.Input}],transform:[{type:e.Input}],renderedIconHTML:[{type:e.HostBinding,args:["innerHTML"]}]},t}(),p=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{declarations:[a],exports:[a]}]}],t.ctorParameters=function(){return[]},t}();t.FaIconComponent=a,t.FontAwesomeModule=p,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/platform-browser"),require("@fortawesome/fontawesome")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/platform-browser","@fortawesome/fontawesome"],e):e(t.angularFontAwesome={},t.ng.core,t.ng.platformBrowser,t.fontawesome)}(this,function(t,e,n,r){"use strict";var o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t};function i(t){return void 0===t||null===t?null:void 0!==(e=t).prefix&&void 0!==e.iconName?t:Array.isArray(t)&&2===t.length?{prefix:t[0],iconName:t[1]}:"string"==typeof t?{prefix:"fas",iconName:t}:void 0;var e}function s(t,e){return Array.isArray(e)&&e.length>0||!Array.isArray(e)&&e?((n={})[t]=e,n):{};var n}var a=function(){function t(t){this.sanitizer=t}return t.prototype.ngOnChanges=function(t){var e,n,a,l,p=i(this.icon),u={icon:null,spin:this.spin,pulse:this.pulse,fixedWidth:this.fixedWidth,border:this.border,listItem:this.listItem,flip:this.flip,size:this.size||null,rotate:this.rotate||null,pull:this.pull||null},f=s("classes",(e=u,(n={"fa-spin":e.spin,"fa-pulse":e.pulse,"fa-fw":e.fixedWidth,"fa-border":e.border,"fa-li":e.listItem,"fa-flip-horizontal":"horizontal"===e.flip||"both"===e.flip,"fa-flip-vertical":"vertical"===e.flip||"both"===e.flip})["fa-"+e.size]=null!==e.size,n["fa-rotate-"+e.rotate]=null!==e.rotate,n["fa-pull-"+e.pull]=null!==e.pull,a=n,Object.keys(a).map(function(t){return a[t]?t:null}).filter(function(t){return t})).concat((this.className||"").split(" "))),c=s("transform","string"==typeof this.transform?r.parse.transform(this.transform):this.transform),m=s("mask",i(this.mask)),d=r.icon(p,o({},f,c,m,{symbol:this.symbol}));d?l=d.html[0]:(l='<svg class="'+r.config.replacementClass+'" viewBox="0 0 448 512"></svg>\x3c!--icon not found--\x3e',null==p?console.error("Could not find icon. It looks like you've provided a null or undefined icon object to this component."):console.error("Could not find icon: iconName="+p.iconName+", prefix="+p.prefix)),this.renderedIconHTML=this.sanitizer.bypassSecurityTrustHtml(l)},t.decorators=[{type:e.Component,args:[{selector:"fa-icon",template:""}]}],t.ctorParameters=function(){return[{type:n.DomSanitizer}]},t.propDecorators={icon:[{type:e.Input}],mask:[{type:e.Input}],symbol:[{type:e.Input}],className:[{type:e.Input}],fixedWidth:[{type:e.Input}],spin:[{type:e.Input}],pulse:[{type:e.Input}],border:[{type:e.Input}],listItem:[{type:e.Input}],flip:[{type:e.Input}],size:[{type:e.Input}],rotate:[{type:e.Input}],pull:[{type:e.Input}],transform:[{type:e.Input}],renderedIconHTML:[{type:e.HostBinding,args:["innerHTML"]}]},t}(),l=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{declarations:[a],exports:[a]}]}],t.ctorParameters=function(){return[]},t}();t.FaIconComponent=a,t.FontAwesomeModule=l,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=angular-fontawesome.umd.min.js.map |
{ | ||
"name": "@fortawesome/angular-fontawesome", | ||
"version": "0.1.0-4", | ||
"version": "0.1.0-5", | ||
"description": "Angular Fontawesome, an Angular library", | ||
@@ -5,0 +5,0 @@ "main": "./bundles/angular-fontawesome.umd.js", |
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
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
65046
597