Icon component add custom svg input

This commit is contained in:
Konstantinos Triantafyllou 2022-01-18 14:59:14 +02:00
parent 5f7acfdd4d
commit a625e59610
2 changed files with 7 additions and 5 deletions

View File

@ -19,9 +19,13 @@ import {IconsService} from "./icons.service";
`
})
export class IconsComponent implements OnInit {
public svg;
public iconName: string;
public style;
/**
* Custom svg
*/
@Input()
public svg;
/**
* True if this icon should have display flex (Optional, Default: false)
* */
@ -73,9 +77,7 @@ export class IconsComponent implements OnInit {
};
} else {
this.style = {
"font-size.px": this.ratio*20,
fill: this.fill,
stroke: this.stroke
"font-size.px": this.ratio*20
};
}
}

View File

@ -144,7 +144,7 @@ export const send = {
export const print = {
name: 'print',
data: '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z"/></svg>'
data: '<svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 0 24 24" width="240" fill="#000000"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z"/></svg>'
}
/** Add new icon under this line to be sure that it will be added on preview */