icon.component.ts 775 B

1234567891011121314151617181920212223242526
  1. import { Component, Input, OnInit } from '@angular/core';
  2. @Component({
  3. selector: 'evt-icon',
  4. templateUrl: './icon.component.html',
  5. styleUrls: ['./icon.component.scss'],
  6. })
  7. export class IconComponent implements OnInit {
  8. @Input() iconInfo: EvtIconInfo;
  9. ngOnInit(): void {
  10. if (this.iconInfo) {
  11. this.iconInfo.iconSet = this.iconInfo.iconSet ? this.iconInfo.iconSet : 'fas'; // Default set is Fontawesome Solid
  12. this.iconInfo.additionalClasses = this.iconInfo.additionalClasses || '';
  13. this.iconInfo.rotate = this.iconInfo.rotate !== undefined ? this.iconInfo.rotate : 0;
  14. }
  15. }
  16. }
  17. export interface EvtIconInfo {
  18. icon: string;
  19. iconSet?: 'evt' | 'fas' | 'far';
  20. additionalClasses?: string;
  21. rotate?: number;
  22. transform?: string;
  23. mask?;
  24. }