mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-17 07:50:12 +01:00
fix: remove unused pipe
This commit is contained in:
parent
0de547db6c
commit
7248e1b727
1 changed files with 0 additions and 50 deletions
|
|
@ -1,50 +0,0 @@
|
||||||
/**
|
|
||||||
* @license
|
|
||||||
* Copyright Akveo. All Rights Reserved.
|
|
||||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { DomSanitizer } from '@angular/platform-browser';
|
|
||||||
import { Pipe, PipeTransform } from '@angular/core';
|
|
||||||
import { icons } from 'eva-icons';
|
|
||||||
|
|
||||||
@Pipe({ name: 'eva' })
|
|
||||||
export class EvaIconsPipe implements PipeTransform {
|
|
||||||
|
|
||||||
private defaultOptions = {
|
|
||||||
height: 24,
|
|
||||||
width: 24,
|
|
||||||
fill: 'inherit',
|
|
||||||
animationHover: true,
|
|
||||||
animationInfinity: false,
|
|
||||||
};
|
|
||||||
|
|
||||||
constructor(private sanitizer: DomSanitizer) {}
|
|
||||||
|
|
||||||
transform(icon: string,
|
|
||||||
options: {
|
|
||||||
height: number;
|
|
||||||
width: number;
|
|
||||||
fill: string;
|
|
||||||
animationType?: string;
|
|
||||||
animationHover?: boolean;
|
|
||||||
animationInfinity?: boolean;
|
|
||||||
},
|
|
||||||
) {
|
|
||||||
const mergedOptions = {
|
|
||||||
...this.defaultOptions,
|
|
||||||
...options,
|
|
||||||
};
|
|
||||||
const { width, height, fill, animationType, animationHover, animationInfinity } = mergedOptions;
|
|
||||||
const animation = animationType ?
|
|
||||||
{ type: animationType, hover: animationHover, infinite: animationInfinity } :
|
|
||||||
null;
|
|
||||||
|
|
||||||
return this.sanitizer.bypassSecurityTrustHtml(icons[icon].toSvg({
|
|
||||||
width,
|
|
||||||
height,
|
|
||||||
fill,
|
|
||||||
animation,
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue