leaf-framework
Version:
Light Everis Angular Frontend Framework
29 lines • 1.15 kB
JavaScript
import { MessageStatus } from './message-status';
import { MessageType } from './message-type';
var Message = /** @class */ (function () {
function Message(text, status, type) {
if (status === void 0) { status = MessageStatus.DANGER; }
if (type === void 0) { type = MessageType.BLOCKING; }
this.text = text;
this.status = status;
this.type = type;
status = status.toUpperCase();
if (status !== MessageStatus.INFO &&
status !== MessageStatus.SUCCESS &&
status !== MessageStatus.WARNING &&
status !== MessageStatus.DANGER) {
throw new Error('Invalid message status. Should be Info, Success, Warning or Danger.');
}
type = type.toUpperCase();
if (type !== MessageType.BLOCKING &&
type !== MessageType.CONFIRM) {
throw new Error('Invalid message type. Should be Blocking or Confirm.');
}
this.text = text;
this.status = status;
this.type = type;
}
return Message;
}());
export { Message };
//# sourceMappingURL=message.js.map