import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; import { IconService } from './services/icon.service'; @Component({ selector: 'bcac-icon', templateUrl: './bcac-icon.component.html', styleUrls: ['./bcac-icon.component.scss'], host: { '[class.bcac-icon-lg]': `iconSize === 'large'`, '[class.bcac-icon-sm]': `iconSize === 'small'` } }) export class BcacIconComponent implements OnInit { constructor( public iconService: IconService ) { } ngOnInit() { if (this.iconType === "add") { this.iconHtml = this.iconService.getAddIcon; } else if (this.iconType === "config") { this.iconHtml = this.iconService.getConfigSvg; } else if (this.iconType === "delete") { this.iconHtml = this.iconService.getDeleteIcon; } else if (this.iconType === "save") { this.iconHtml = this.iconService.getSaveIcon; } else if (this.iconType === "excel_out") { this.iconHtml = this.iconService.getExcelIcon; } else if (this.iconType === "pdf_out") { this.iconHtml = this.iconService.getPdfIcon; } else if (this.iconType === "batch_download") { this.iconHtml = this.iconService.getDownloadPackageIcon; } else if (this.iconType === "import") { this.iconHtml = this.iconService.getImportIcon; } else if (this.iconType === "calculate") { this.iconHtml = this.iconService.getCalculateIcon; } else if (this.iconType === "detail") { this.iconHtml = this.iconService.getDetailsIcon; } else if (this.iconType === "editor") { this.iconHtml = this.iconService.getEditIcon; } else if (this.iconType === "download") { this.iconHtml = this.iconService.getDownloadIcon; } else if (this.iconType === "review") { this.iconHtml = this.iconService.getReviewIcon; } else if (this.iconType === "report") { this.iconHtml = this.iconService.getGenerateReportIcon; } else if (this.iconType === "preview") { this.iconHtml = this.iconService.getPreviewIcon; } else if (this.iconType === "calendar") { this.iconHtml = this.iconService.getCalendarIcon; } else if (this.iconType === "day_time") { this.iconHtml = this.iconService.getDayTimeIcon; } else if (this.iconType === "night_time") { this.iconHtml = this.iconService.getNightIcon; } else if (this.iconType === "temperature") { this.iconHtml = this.iconService.getTemperatureIcon; } else if (this.iconType === "wind_speed") { this.iconHtml = this.iconService.getWindSpeedIconSvg; } else if (this.iconType === "rain_fall") { this.iconHtml = this.iconService.getRainFallIconSvg; } else if (this.iconType === "humidity") { this.iconHtml = this.iconService.getHumidityIcon; } else if (this.iconType === "air_pressure") { this.iconHtml = this.iconService.getAirPressureIconSvg; } else if (this.iconType === "wind_direction") { this.iconHtml = this.iconService.getWindDirectionIcon; } else if (this.iconType === "home_point") { this.iconHtml = this.iconService.getHomePointIcon; } else if (this.iconType === "range") { this.iconHtml = this.iconService.getRangIcon; } else if (this.iconType === "refresh") { this.iconHtml = this.iconService.getRefreshIcon; } else if (this.iconType === "print") { this.iconHtml = this.iconService.getPrintIcon; } else if (this.iconType === "layer_switch") { this.iconHtml =this.iconService.getLayerSwitchIcon; } else if (this.iconType === "map_site") { this.iconHtml =this.iconService.getMapSiteIcon; } else if (this.iconType === "noise") { this.iconHtml =this.iconService.getNoiseIcon; } else if (this.iconType === "template_download") { this.iconHtml =this.iconService.getDownloadTemplateIcon; } else if (this.iconType === "data_inject") { this.iconHtml = this.iconService.getDataInjectionIcon; } else if (this.iconType === "copy_table") { this.iconHtml = this.iconService.getCopyTableIcon; } else if (this.iconType === "copy_picture") { this.iconHtml = this.iconService.getCopyPictureIcon; } else if (this.iconType === "handle_work_order") { this.iconHtml = this.iconService.getHandleWorkOrderIcon; } else if (this.iconType === "receive_work_order") { this.iconHtml = this.iconService.getReceiveWorkOrderIconSvg; } else if (this.iconType === "transfer_work_order") { this.iconHtml = this.iconService.getTransferOrderIcon; } else if (this.iconType === "fill_in") { this.iconHtml = this.iconService.getFillInIcon; } else if (this.iconType === "turn_down") { this.iconHtml = this.iconService.getTurnDownIconSvg; } else if (this.iconType === "report_open") { this.iconHtml = this.iconService.getReportOpenIcon; } else if (this.iconType === "report_pack") { this.iconHtml = this.iconService.getReportPackIcon; } else if (this.iconType === "change_table") { this.iconHtml = this.iconService.getChangeTableSvg; } else if (this.iconType === "review_record"){ this.iconHtml = this.iconService.getReviewRecordIcon; } else { this.iconHtml = this.iconService.getAddIcon; } } iconHtml; @Input() iconSize: string = "default"; @Input() iconType: string = "add"; @Input() tooltipTitle: string = ""; @Input() toolTipPlacement: string = "top"; @Input() iconColor: string = "#04a294"; // @Output() // click = new EventEmitter(); // addIconClick() { // this.click.emit("click"); // } }