2022-02-24 17:42:05 +01:00
|
|
|
declare var UIkit;
|
|
|
|
|
|
|
|
export type Status = 'danger' | 'success' | 'warning';
|
|
|
|
export type Position = 'bottom-right' | 'bottom-left' | 'bottom-center';
|
|
|
|
|
|
|
|
export class NotificationHandler {
|
2022-07-04 10:32:24 +02:00
|
|
|
private static DEFAULT_TIMEOUT: number = 6000;
|
2022-02-24 17:42:05 +01:00
|
|
|
private static DEFAULT_STATUS: Status = 'success';
|
|
|
|
private static DEFAULT_POSITION: Position = 'bottom-right';
|
|
|
|
|
|
|
|
public static rise(message: string, status: Status = this.DEFAULT_STATUS, position: Position = this.DEFAULT_POSITION) {
|
|
|
|
UIkit.notification(message, {
|
|
|
|
status: status,
|
|
|
|
timeout: this.DEFAULT_TIMEOUT,
|
|
|
|
pos: position
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|