@pega/dx-component-builder-sdk
Version:
Utility for building custom UI components
44 lines (40 loc) • 1.05 kB
text/typescript
import { Component, Input, Output, EventEmitter } from '@angular/core';
import { CommonModule } from '@angular/common';
import { MatIconModule } from '@angular/material/icon';
({
selector: 'app-alert',
templateUrl: './alert.component.html',
styleUrls: ['./alert.component.scss'],
standalone: true,
imports: [CommonModule, MatIconModule]
})
export class AlertComponent {
() message: any[];
() severity;
() hideClose;
() onClose: EventEmitter<any> = new EventEmitter();
getMatIcon(severity) {
let variant;
switch (severity) {
case 'error':
variant = 'error_outline';
break;
case 'warning':
variant = 'warning_amber';
break;
case 'success':
variant = 'task_alt';
break;
case 'info':
variant = 'info_outline';
break;
default:
break;
}
return variant;
}
onCloseClick() {
alert('Close clicked');
this.onClose.emit({ Page: 'Page', target: 'target', type: 'type' });
}
}