unicorn-components
Version:
<a target="_blank" href="https://getunicorn.io"><img src="https://bitbucket-assetroot.s3.amazonaws.com/c/photos/2017/Jul/07/2615006260-5-nitsnetsstudios-ondemand-UNI_avatar.png" align="left"></a>
34 lines (27 loc) • 1.34 kB
text/typescript
import { Component, EventEmitter, HostBinding, Input, Output } from '@angular/core';
import { Observable } from 'rxjs/Rx';
import { UniBaseComponent } from '../../base/base/base.component';
export class UniAlertComponent extends UniBaseComponent {
componentClass = true;
icon: string;
closable = true;
close = new EventEmitter();
get isLight() { return this.color === 'light'; }
get isDefault() { return this.color === 'default'; }
get isPrimary() { return this.color === 'primary'; }
get isSuccess() { return this.color === 'success'; }
get isWarning() { return this.color === 'warning'; }
get isError() { return this.color === 'error'; }
opacity = 1;
display = 'block';
onClose() {
this.close.emit();
this.opacity = 0;
setTimeout(() => this.display = 'none', 200);
}
}