@aotearoan/neon
Version:
Neon is a lightweight design library of Vue 3 components with minimal dependencies.
68 lines (67 loc) • 1.68 kB
JavaScript
var c = Object.defineProperty;
var v = (s, e, r) => e in s ? c(s, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : s[e] = r;
var m = (s, e, r) => v(s, typeof e != "symbol" ? e + "" : e, r);
import { NeonEventBus as i } from "../../common/event/NeonEventBus.es.js";
import { NeonAlertLevel as a } from "../../../model/feedback/alert/NeonAlertLevel.es.js";
const t = class t {
/**
* Send an info message.
*
* @param alert The info message to display.
*/
static info(e) {
t.emit(a.Info, e);
}
/**
* Send a success message.
*
* @param alert The success message to display.
*/
static success(e) {
t.emit(a.Success, e);
}
/**
* Send a warning message.
*
* @param alert The warning message to display.
*/
static warn(e) {
t.emit(a.Warn, e);
}
/**
* Send an error message.
*
* @param alert The error message to display.
*/
static error(e) {
t.emit(a.Error, e);
}
/**
* Remove a message.
*
* @param key Key of the message to delete.
*/
static remove(e) {
i.emit(t.removeEventKey, e);
}
/**
* Generate an event key so that all events are published on the correct topic.
*
* @param eventType Alert level of the event.
*
* @returns The event key for sending a message on <a href="/utils/NeonEventBus">NeonEventBus</a>.
*/
static generateEventKey(e) {
return `${i.messagePrefix}-alert-${e}`;
}
static emit(e, r) {
const o = t.generateEventKey(e);
i.emit(o, r);
}
};
m(t, "removeEventKey", `${i.messagePrefix}-alert-remove`);
let n = t;
export {
n as NeonAlertService
};
//# sourceMappingURL=NeonAlertService.es.js.map