@apipass/messages 1.0.7 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -33
- package/assets/css/colors.scss +34 -34
- package/assets/css/pt_sans.scss +143 -143
- package/assets/css/spacing.scss +28 -28
- package/assets/css/texts.scss +18 -18
- package/{esm2020 → esm2022}/apipass-messages.mjs +4 -4
- package/esm2022/exception/base-service.exception.mjs +40 -0
- package/esm2022/exception/base-ui.exception.mjs +26 -0
- package/esm2022/exception/unkown-error.exception.mjs +22 -0
- package/esm2022/message-box/message-box.component.mjs +43 -0
- package/esm2022/messages.module.mjs +47 -0
- package/esm2022/messages.service.mjs +68 -0
- package/esm2022/public-api.mjs +11 -0
- package/esm2022/snack-bar/snack-bar.component.mjs +23 -0
- package/esm2022/success/base-ui.success.mjs +25 -0
- package/esm2022/u-i-message.service.mjs +68 -0
- package/exception/base-service.exception.d.ts +15 -0
- package/exception/base-ui.exception.d.ts +11 -0
- package/exception/unkown-error.exception.d.ts +9 -0
- package/fesm2022/apipass-messages.mjs +344 -0
- package/fesm2022/apipass-messages.mjs.map +1 -0
- package/index.d.ts +5 -5
- package/message-box/message-box.component.d.ts +16 -16
- package/messages.module.d.ts +12 -12
- package/messages.service.d.ts +19 -14
- package/package.json +13 -19
- package/public-api.d.ts +10 -5
- package/snack-bar/snack-bar.component.d.ts +13 -9
- package/success/base-ui.success.d.ts +11 -0
- package/u-i-message.service.d.ts +18 -0
- package/esm2020/message-box/message-box.component.mjs +0 -44
- package/esm2020/messages.module.mjs +0 -46
- package/esm2020/messages.service.mjs +0 -50
- package/esm2020/public-api.mjs +0 -6
- package/esm2020/snack-bar/snack-bar.component.mjs +0 -21
- package/fesm2015/apipass-messages.mjs +0 -159
- package/fesm2015/apipass-messages.mjs.map +0 -1
- package/fesm2020/apipass-messages.mjs +0 -157
- package/fesm2020/apipass-messages.mjs.map +0 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { TranslateService } from '@ngx-translate/core';
|
|
3
|
+
import { BaseUiSuccess } from './success/base-ui.success';
|
|
4
|
+
import { MatSnackBarHorizontalPosition, MatSnackBarVerticalPosition } from '@angular/material/snack-bar';
|
|
5
|
+
import { MessagesService } from './messages.service';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export type LOG_TYPE = 'DEBUG' | 'INFO' | 'WARN' | 'ERROR' | 'TRACE' | 'NO_LOG';
|
|
8
|
+
export declare const APIPASS_COMPONENTS_TRANSLATE: InjectionToken<UIMessageService>;
|
|
9
|
+
export declare class UIMessageService {
|
|
10
|
+
private readonly translateService;
|
|
11
|
+
private readonly messagesService;
|
|
12
|
+
constructor(translateService: TranslateService, messagesService: MessagesService);
|
|
13
|
+
showSuccessMessage(success: BaseUiSuccess, logType?: LOG_TYPE, horizontalPosition?: MatSnackBarHorizontalPosition, verticalPosition?: MatSnackBarVerticalPosition, timeout?: number): Promise<void>;
|
|
14
|
+
showErrorMessage(e: any, logType?: LOG_TYPE, horizontalPosition?: MatSnackBarHorizontalPosition, verticalPosition?: MatSnackBarVerticalPosition, timeout?: number): Promise<void>;
|
|
15
|
+
private logMessage;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UIMessageService, never>;
|
|
17
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<UIMessageService>;
|
|
18
|
+
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { Component, Input, EventEmitter, Output } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
import * as i1 from "@angular/common";
|
|
4
|
-
export class MessageBoxComponent {
|
|
5
|
-
constructor() {
|
|
6
|
-
this.type = 'alert-danger';
|
|
7
|
-
this.title = '';
|
|
8
|
-
this.message = '';
|
|
9
|
-
this.compilerError = false;
|
|
10
|
-
this.errors = [];
|
|
11
|
-
this.onClose = new EventEmitter();
|
|
12
|
-
}
|
|
13
|
-
close() {
|
|
14
|
-
this.onClose.next();
|
|
15
|
-
}
|
|
16
|
-
isArray(error) {
|
|
17
|
-
return Array.isArray(error);
|
|
18
|
-
}
|
|
19
|
-
isErrorObject(error) {
|
|
20
|
-
return error instanceof Object || this.isArray(error);
|
|
21
|
-
}
|
|
22
|
-
getErrorAsString(error) {
|
|
23
|
-
return JSON.stringify(error, undefined, 2);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
MessageBoxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: MessageBoxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
27
|
-
MessageBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: MessageBoxComponent, selector: "message-box", inputs: { type: "type", title: "title", message: "message", compilerError: "compilerError", errors: "errors" }, outputs: { onClose: "onClose" }, ngImport: i0, template: "<div class=\"error-box row\" *ngIf=\"errors.length > 0\">\r\n <div class=\"col-12\">\r\n <div class=\"alert {{type}} alert-dismissible fade show\" role=\"alert\">\r\n <strong class=\"title\" *ngIf=\"title\">{{title}}</strong>\r\n <span class=\"detail-message\" *ngIf=\"message\">{{message}}</span>\r\n <div class=\"alert-text\" *ngFor=\"let error of errors\">\r\n <span class=\"causes\" *ngIf=\"compilerError && isArray(error)\">\r\n <span class=\"error-text\" *ngFor=\"let item of error\" [innerHTML]=\"item.message\"></span>\r\n </span>\r\n\r\n <span class=\"error-text\"\r\n *ngIf=\"(!compilerError || (compilerError && !isArray(error))) && !isErrorObject(error)\" [innerHTML]=\"error\"></span>\r\n <pre *ngIf=\"!compilerError && isErrorObject(error)\">\r\n {{getErrorAsString(error)}}\r\n </pre>\r\n </div>\r\n <button type=\"button\" class=\"close\" (click)=\"close()\" aria-label=\"Close\">\r\n <span aria-hidden=\"true\">×</span>\r\n </button>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".error-box{position:relative;width:100%;background:#f5caca;border:1px solid #8b4646;color:#8b4646;border-radius:5px}.error-box .alert{padding:10px 15px!important}.error-box .alert .close{background:none;border:none;position:absolute;top:2px;right:2px;font-size:20px;color:#8b4646;cursor:pointer}.error-box .alert .title{word-break:break-word;margin-right:5px}.error-box .causes{word-break:break-word}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
28
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: MessageBoxComponent, decorators: [{
|
|
29
|
-
type: Component,
|
|
30
|
-
args: [{ selector: 'message-box', template: "<div class=\"error-box row\" *ngIf=\"errors.length > 0\">\r\n <div class=\"col-12\">\r\n <div class=\"alert {{type}} alert-dismissible fade show\" role=\"alert\">\r\n <strong class=\"title\" *ngIf=\"title\">{{title}}</strong>\r\n <span class=\"detail-message\" *ngIf=\"message\">{{message}}</span>\r\n <div class=\"alert-text\" *ngFor=\"let error of errors\">\r\n <span class=\"causes\" *ngIf=\"compilerError && isArray(error)\">\r\n <span class=\"error-text\" *ngFor=\"let item of error\" [innerHTML]=\"item.message\"></span>\r\n </span>\r\n\r\n <span class=\"error-text\"\r\n *ngIf=\"(!compilerError || (compilerError && !isArray(error))) && !isErrorObject(error)\" [innerHTML]=\"error\"></span>\r\n <pre *ngIf=\"!compilerError && isErrorObject(error)\">\r\n {{getErrorAsString(error)}}\r\n </pre>\r\n </div>\r\n <button type=\"button\" class=\"close\" (click)=\"close()\" aria-label=\"Close\">\r\n <span aria-hidden=\"true\">×</span>\r\n </button>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".error-box{position:relative;width:100%;background:#f5caca;border:1px solid #8b4646;color:#8b4646;border-radius:5px}.error-box .alert{padding:10px 15px!important}.error-box .alert .close{background:none;border:none;position:absolute;top:2px;right:2px;font-size:20px;color:#8b4646;cursor:pointer}.error-box .alert .title{word-break:break-word;margin-right:5px}.error-box .causes{word-break:break-word}\n"] }]
|
|
31
|
-
}], propDecorators: { type: [{
|
|
32
|
-
type: Input
|
|
33
|
-
}], title: [{
|
|
34
|
-
type: Input
|
|
35
|
-
}], message: [{
|
|
36
|
-
type: Input
|
|
37
|
-
}], compilerError: [{
|
|
38
|
-
type: Input
|
|
39
|
-
}], errors: [{
|
|
40
|
-
type: Input
|
|
41
|
-
}], onClose: [{
|
|
42
|
-
type: Output
|
|
43
|
-
}] } });
|
|
44
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVzc2FnZS1ib3guY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcHJvamVjdHMvbWVzc2FnZXMvc3JjL21lc3NhZ2UtYm94L21lc3NhZ2UtYm94LmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uL3Byb2plY3RzL21lc3NhZ2VzL3NyYy9tZXNzYWdlLWJveC9tZXNzYWdlLWJveC5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSxFQUFFLE1BQU0sZUFBZSxDQUFBOzs7QUFPdEUsTUFBTSxPQUFPLG1CQUFtQjtJQUxoQztRQU1rQixTQUFJLEdBQUcsY0FBYyxDQUFBO1FBQ3JCLFVBQUssR0FBRyxFQUFFLENBQUE7UUFDVixZQUFPLEdBQUcsRUFBRSxDQUFBO1FBQ1osa0JBQWEsR0FBRyxLQUFLLENBQUE7UUFDckIsV0FBTSxHQUFPLEVBQUUsQ0FBQTtRQUVkLFlBQU8sR0FBRyxJQUFJLFlBQVksRUFBUSxDQUFBO0tBaUJwRDtJQWZRLEtBQUs7UUFDVixJQUFJ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iBhcmlhLWxhYmVsPVwiQ2xvc2VcIj5cclxuICAgICAgICA8c3BhbiBhcmlhLWhpZGRlbj1cInRydWVcIj4mdGltZXM7PC9zcGFuPlxyXG4gICAgICA8L2J1dHRvbj5cclxuICAgIDwvZGl2PlxyXG4gIDwvZGl2PlxyXG48L2Rpdj5cclxuIl19
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { NgModule } from '@angular/core';
|
|
2
|
-
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
3
|
-
import { CommonModule } from '@angular/common';
|
|
4
|
-
import { MessageBoxComponent } from './message-box/message-box.component';
|
|
5
|
-
import { MessagesService } from './messages.service';
|
|
6
|
-
import { SnackBarComponent } from './snack-bar/snack-bar.component';
|
|
7
|
-
import { MatButtonModule } from '@angular/material/button';
|
|
8
|
-
import { MatSnackBarModule } from '@angular/material/snack-bar';
|
|
9
|
-
import * as i0 from "@angular/core";
|
|
10
|
-
export class MessagesModule {
|
|
11
|
-
}
|
|
12
|
-
MessagesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: MessagesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
13
|
-
MessagesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.3", ngImport: i0, type: MessagesModule, declarations: [MessageBoxComponent,
|
|
14
|
-
SnackBarComponent], imports: [CommonModule,
|
|
15
|
-
FormsModule,
|
|
16
|
-
ReactiveFormsModule,
|
|
17
|
-
MatButtonModule,
|
|
18
|
-
MatSnackBarModule], exports: [MessageBoxComponent,
|
|
19
|
-
SnackBarComponent] });
|
|
20
|
-
MessagesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: MessagesModule, providers: [MessagesService], imports: [CommonModule,
|
|
21
|
-
FormsModule,
|
|
22
|
-
ReactiveFormsModule,
|
|
23
|
-
MatButtonModule,
|
|
24
|
-
MatSnackBarModule] });
|
|
25
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: MessagesModule, decorators: [{
|
|
26
|
-
type: NgModule,
|
|
27
|
-
args: [{
|
|
28
|
-
imports: [
|
|
29
|
-
CommonModule,
|
|
30
|
-
FormsModule,
|
|
31
|
-
ReactiveFormsModule,
|
|
32
|
-
MatButtonModule,
|
|
33
|
-
MatSnackBarModule
|
|
34
|
-
],
|
|
35
|
-
declarations: [
|
|
36
|
-
MessageBoxComponent,
|
|
37
|
-
SnackBarComponent
|
|
38
|
-
],
|
|
39
|
-
exports: [
|
|
40
|
-
MessageBoxComponent,
|
|
41
|
-
SnackBarComponent
|
|
42
|
-
],
|
|
43
|
-
providers: [MessagesService]
|
|
44
|
-
}]
|
|
45
|
-
}] });
|
|
46
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVzc2FnZXMubW9kdWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vcHJvamVjdHMvbWVzc2FnZXMvc3JjL21lc3NhZ2VzLm1vZHVsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0sZUFBZSxDQUFBO0FBQ3hDLE9BQU8sRUFBRSxXQUFXLEVBQUUsbUJBQW1CLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQTtBQUNqRSxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0saUJBQWlCLENBQUE7QUFDOUMsT0FBTyxFQUFFLG1CQUFtQixFQUFFLE1BQU0scUNBQXFDLENBQUE7QUFDekUsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLG9CQUFvQixDQUFBO0FBQ3BELE9BQU8sRUFBRSxpQkFBaUIsRUFBRSxNQUFNLGlDQUFpQyxDQUFBO0FBQ25FLE9BQU8sRUFBRSxlQU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Zyb20gJy4vbWVzc2FnZS1ib3gvbWVzc2FnZS1ib3guY29tcG9uZW50J1xyXG5pbXBvcnQgeyBNZXNzYWdlc1NlcnZpY2UgfSBmcm9tICcuL21lc3NhZ2VzLnNlcnZpY2UnXHJcbmltcG9ydCB7IFNuYWNrQmFyQ29tcG9uZW50IH0gZnJvbSAnLi9zbmFjay1iYXIvc25hY2stYmFyLmNvbXBvbmVudCdcclxuaW1wb3J0IHsgTWF0QnV0dG9uTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvbWF0ZXJpYWwvYnV0dG9uJ1xyXG5pbXBvcnQgeyBNYXRTbmFja0Jhck1vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL21hdGVyaWFsL3NuYWNrLWJhcidcclxuXHJcbkBOZ01vZHVsZSh7XHJcbiAgaW1wb3J0czogW1xyXG4gICAgQ29tbW9uTW9kdWxlLFxyXG4gICAgRm9ybXNNb2R1bGUsXHJcbiAgICBSZWFjdGl2ZUZvcm1zTW9kdWxlLFxyXG4gICAgTWF0QnV0dG9uTW9kdWxlLFxyXG4gICAgTWF0U25hY2tCYXJNb2R1bGVcclxuICBdLFxyXG4gIGRlY2xhcmF0aW9uczogW1xyXG4gICAgTWVzc2FnZUJveENvbXBvbmVudCxcclxuICAgIFNuYWNrQmFyQ29tcG9uZW50XHJcbiAgXSxcclxuICBleHBvcnRzOiBbXHJcbiAgICBNZXNzYWdlQm94Q29tcG9uZW50LFxyXG4gICAgU25hY2tCYXJDb21wb25lbnRcclxuICBdLFxyXG4gIHByb3ZpZGVyczogW01lc3NhZ2VzU2VydmljZV1cclxufSlcclxuZXhwb3J0IGNsYXNzIE1lc3NhZ2VzTW9kdWxlIHt9XHJcbiJdfQ==
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
3
|
-
import { SnackBarComponent } from './snack-bar/snack-bar.component';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
import * as i1 from "@angular/material/snack-bar";
|
|
6
|
-
export class MessagesService {
|
|
7
|
-
constructor(_snackBar) {
|
|
8
|
-
this._snackBar = _snackBar;
|
|
9
|
-
}
|
|
10
|
-
successMessage(title, body, horizontalPosition, verticalPosition, timeout) {
|
|
11
|
-
this.customMessage('success', title, body || '', horizontalPosition, verticalPosition, timeout);
|
|
12
|
-
}
|
|
13
|
-
errorMessage(title, body, horizontalPosition, verticalPosition, timeout) {
|
|
14
|
-
this.customMessage('error', title, body, horizontalPosition, verticalPosition, timeout);
|
|
15
|
-
}
|
|
16
|
-
warnMessage(title, body, horizontalPosition, verticalPosition, timeout) {
|
|
17
|
-
this.customMessage('warn', title, body, horizontalPosition, verticalPosition, timeout);
|
|
18
|
-
}
|
|
19
|
-
message(type, title, body, horizontalPosition, verticalPosition, timeout) {
|
|
20
|
-
this.customMessage(type, title, body, horizontalPosition, verticalPosition, timeout);
|
|
21
|
-
}
|
|
22
|
-
getErrorMessage(statusCode, message) {
|
|
23
|
-
let codeMessage;
|
|
24
|
-
if (message instanceof Object) {
|
|
25
|
-
codeMessage = message.status || statusCode;
|
|
26
|
-
if (message.message) {
|
|
27
|
-
codeMessage += ' - ' + message.message;
|
|
28
|
-
}
|
|
29
|
-
return codeMessage;
|
|
30
|
-
}
|
|
31
|
-
return `${statusCode} - ${message}`;
|
|
32
|
-
}
|
|
33
|
-
customMessage(type, title, body, horizontalPosition, verticalPosition, timeout) {
|
|
34
|
-
this._snackBar.openFromComponent(SnackBarComponent, {
|
|
35
|
-
data: {
|
|
36
|
-
html: `<b>${title}</b> <br/> ${body}`
|
|
37
|
-
},
|
|
38
|
-
panelClass: ['apipass-message', `apipass-message-${type || 'error'}`],
|
|
39
|
-
horizontalPosition: horizontalPosition || 'end',
|
|
40
|
-
verticalPosition: verticalPosition || 'top',
|
|
41
|
-
duration: timeout || 30000
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
MessagesService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: MessagesService, deps: [{ token: i1.MatSnackBar }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
46
|
-
MessagesService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: MessagesService });
|
|
47
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: MessagesService, decorators: [{
|
|
48
|
-
type: Injectable
|
|
49
|
-
}], ctorParameters: function () { return [{ type: i1.MatSnackBar }]; } });
|
|
50
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVzc2FnZXMuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL21lc3NhZ2VzL3NyYy9tZXNzYWdlcy5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUE7QUFDMUMsT0FBTyxFQUFFLFdBQVcsRUFBOEQsTUFBTSw2QkFBNkIsQ0FBQTtBQUNySCxPQUFPLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQTs7O0FBR25FLE1BQU0sT0FBTyxlQUFlO0lBQzFCLFlBQThCLFNBQXNCO1FBQXRCLGNBQVMsR0FBVCxTQUFTLENBQWE7SUFDcEQsQ0FBQztJQUVNLGNBQWMsQ0FBRSxLQUFhLEVBQUUsSUFBYSxFQUFFLGtCQUFrRCxFQUFFLGdCQUE4QyxFQUFFLE9BQWdCO1FBQ3ZLLElBQUksQ0FBQyxhQUFhLENBQUMsU0FBUyxFQUFFLEtBQUssRUFBRSxJQUFJLElBQUksRUFBRSxFQUFFLGtCQUFrQixFQUFFLGdCQUFnQixFQUFFLE9B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OiBzdHJpbmcsIHRpdGxlOiBzdHJpbmcsIGJvZHk6IHN0cmluZywgaG9yaXpvbnRhbFBvc2l0aW9uPzogTWF0U25hY2tCYXJIb3Jpem9udGFsUG9zaXRpb24sIHZlcnRpY2FsUG9zaXRpb24/OiBNYXRTbmFja0JhclZlcnRpY2FsUG9zaXRpb24sIHRpbWVvdXQ/OiBudW1iZXIpOiB2b2lkIHtcclxuICAgIHRoaXMuX3NuYWNrQmFyLm9wZW5Gcm9tQ29tcG9uZW50KFNuYWNrQmFyQ29tcG9uZW50LCB7XHJcbiAgICAgIGRhdGE6IHtcclxuICAgICAgICBodG1sOiBgPGI+JHt0aXRsZX08L2I+IDxici8+ICR7Ym9keX1gXHJcbiAgICAgIH0sXHJcbiAgICAgIHBhbmVsQ2xhc3M6IFsnYXBpcGFzcy1tZXNzYWdlJywgYGFwaXBhc3MtbWVzc2FnZS0ke3R5cGUgfHwgJ2Vycm9yJ31gXSxcclxuICAgICAgaG9yaXpvbnRhbFBvc2l0aW9uOiBob3Jpem9udGFsUG9zaXRpb24gfHwgJ2VuZCcsXHJcbiAgICAgIHZlcnRpY2FsUG9zaXRpb246IHZlcnRpY2FsUG9zaXRpb24gfHwgJ3RvcCcsXHJcbiAgICAgIGR1cmF0aW9uOiB0aW1lb3V0IHx8IDMwMDAwXHJcbiAgICB9KVxyXG4gIH1cclxufVxyXG4iXX0=
|
package/esm2020/public-api.mjs
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export * from '@angular/material/snack-bar';
|
|
2
|
-
export * from './messages.service';
|
|
3
|
-
export * from './messages.module';
|
|
4
|
-
export * from './message-box/message-box.component';
|
|
5
|
-
export * from './snack-bar/snack-bar.component';
|
|
6
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL21lc3NhZ2VzL3NyYy9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsNkJBQTZCLENBQUE7QUFDM0MsY0FBYyxvQkFBb0IsQ0FBQTtBQUNsQyxjQUFjLG1CQUFtQixDQUFBO0FBQ2pDLGNBQWMscUNBQXFDLENBQUE7QUFDbkQsY0FBYyxpQ0FBaUMsQ0FBQSIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJ0Bhbmd1bGFyL21hdGVyaWFsL3NuYWNrLWJhcidcclxuZXhwb3J0ICogZnJvbSAnLi9tZXNzYWdlcy5zZXJ2aWNlJ1xyXG5leHBvcnQgKiBmcm9tICcuL21lc3NhZ2VzLm1vZHVsZSdcclxuZXhwb3J0ICogZnJvbSAnLi9tZXNzYWdlLWJveC9tZXNzYWdlLWJveC5jb21wb25lbnQnXHJcbmV4cG9ydCAqIGZyb20gJy4vc25hY2stYmFyL3NuYWNrLWJhci5jb21wb25lbnQnXHJcbiJdfQ==
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Component, Inject } from '@angular/core';
|
|
2
|
-
import { MatSnackBar, MAT_SNACK_BAR_DATA } from '@angular/material/snack-bar';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
import * as i1 from "@angular/material/snack-bar";
|
|
5
|
-
import * as i2 from "@angular/material/button";
|
|
6
|
-
export class SnackBarComponent {
|
|
7
|
-
constructor(data, snackBar) {
|
|
8
|
-
this.data = data;
|
|
9
|
-
this.snackBar = snackBar;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
SnackBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: SnackBarComponent, deps: [{ token: MAT_SNACK_BAR_DATA }, { token: i1.MatSnackBar }], target: i0.ɵɵFactoryTarget.Component });
|
|
13
|
-
SnackBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: SnackBarComponent, selector: "snack-bar", ngImport: i0, template: "<div [innerHTML]=\"data.html\"></div>\r\n<button mat-raised-button (click)=\"snackBar.dismiss()\">x</button>\r\n", styles: [""], dependencies: [{ kind: "component", type: i2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }] });
|
|
14
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: SnackBarComponent, decorators: [{
|
|
15
|
-
type: Component,
|
|
16
|
-
args: [{ selector: 'snack-bar', template: "<div [innerHTML]=\"data.html\"></div>\r\n<button mat-raised-button (click)=\"snackBar.dismiss()\">x</button>\r\n" }]
|
|
17
|
-
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
18
|
-
type: Inject,
|
|
19
|
-
args: [MAT_SNACK_BAR_DATA]
|
|
20
|
-
}] }, { type: i1.MatSnackBar }]; } });
|
|
21
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic25hY2stYmFyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL21lc3NhZ2VzL3NyYy9zbmFjay1iYXIvc25hY2stYmFyLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uL3Byb2plY3RzL21lc3NhZ2VzL3NyYy9zbmFjay1iYXIvc25hY2stYmFyLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxFQUFFLE1BQU0sZUFBZSxDQUFBO0FBQ2pELE9BQU8sRUFBRSxXQUFXLEVBQUUsa0JBQWtCLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQTs7OztBQU83RSxNQUFNLE9BQU8saUJBQWlCO0lBQzV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ack-bar';
|
|
2
|
-
import { MAT_SNACK_BAR_DATA, MatSnackBarModule } from '@angular/material/snack-bar';
|
|
3
|
-
export * from '@angular/material/snack-bar';
|
|
4
|
-
import * as i0 from '@angular/core';
|
|
5
|
-
import { Component, Inject, Injectable, EventEmitter, Input, Output, NgModule } from '@angular/core';
|
|
6
|
-
import * as i2 from '@angular/material/button';
|
|
7
|
-
import { MatButtonModule } from '@angular/material/button';
|
|
8
|
-
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
9
|
-
import * as i1$1 from '@angular/common';
|
|
10
|
-
import { CommonModule } from '@angular/common';
|
|
11
|
-
|
|
12
|
-
class SnackBarComponent {
|
|
13
|
-
constructor(data, snackBar) {
|
|
14
|
-
this.data = data;
|
|
15
|
-
this.snackBar = snackBar;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
SnackBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: SnackBarComponent, deps: [{ token: MAT_SNACK_BAR_DATA }, { token: i1.MatSnackBar }], target: i0.ɵɵFactoryTarget.Component });
|
|
19
|
-
SnackBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: SnackBarComponent, selector: "snack-bar", ngImport: i0, template: "<div [innerHTML]=\"data.html\"></div>\r\n<button mat-raised-button (click)=\"snackBar.dismiss()\">x</button>\r\n", styles: [""], dependencies: [{ kind: "component", type: i2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }] });
|
|
20
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: SnackBarComponent, decorators: [{
|
|
21
|
-
type: Component,
|
|
22
|
-
args: [{ selector: 'snack-bar', template: "<div [innerHTML]=\"data.html\"></div>\r\n<button mat-raised-button (click)=\"snackBar.dismiss()\">x</button>\r\n" }]
|
|
23
|
-
}], ctorParameters: function () {
|
|
24
|
-
return [{ type: undefined, decorators: [{
|
|
25
|
-
type: Inject,
|
|
26
|
-
args: [MAT_SNACK_BAR_DATA]
|
|
27
|
-
}] }, { type: i1.MatSnackBar }];
|
|
28
|
-
} });
|
|
29
|
-
|
|
30
|
-
class MessagesService {
|
|
31
|
-
constructor(_snackBar) {
|
|
32
|
-
this._snackBar = _snackBar;
|
|
33
|
-
}
|
|
34
|
-
successMessage(title, body, horizontalPosition, verticalPosition, timeout) {
|
|
35
|
-
this.customMessage('success', title, body || '', horizontalPosition, verticalPosition, timeout);
|
|
36
|
-
}
|
|
37
|
-
errorMessage(title, body, horizontalPosition, verticalPosition, timeout) {
|
|
38
|
-
this.customMessage('error', title, body, horizontalPosition, verticalPosition, timeout);
|
|
39
|
-
}
|
|
40
|
-
warnMessage(title, body, horizontalPosition, verticalPosition, timeout) {
|
|
41
|
-
this.customMessage('warn', title, body, horizontalPosition, verticalPosition, timeout);
|
|
42
|
-
}
|
|
43
|
-
message(type, title, body, horizontalPosition, verticalPosition, timeout) {
|
|
44
|
-
this.customMessage(type, title, body, horizontalPosition, verticalPosition, timeout);
|
|
45
|
-
}
|
|
46
|
-
getErrorMessage(statusCode, message) {
|
|
47
|
-
let codeMessage;
|
|
48
|
-
if (message instanceof Object) {
|
|
49
|
-
codeMessage = message.status || statusCode;
|
|
50
|
-
if (message.message) {
|
|
51
|
-
codeMessage += ' - ' + message.message;
|
|
52
|
-
}
|
|
53
|
-
return codeMessage;
|
|
54
|
-
}
|
|
55
|
-
return `${statusCode} - ${message}`;
|
|
56
|
-
}
|
|
57
|
-
customMessage(type, title, body, horizontalPosition, verticalPosition, timeout) {
|
|
58
|
-
this._snackBar.openFromComponent(SnackBarComponent, {
|
|
59
|
-
data: {
|
|
60
|
-
html: `<b>${title}</b> <br/> ${body}`
|
|
61
|
-
},
|
|
62
|
-
panelClass: ['apipass-message', `apipass-message-${type || 'error'}`],
|
|
63
|
-
horizontalPosition: horizontalPosition || 'end',
|
|
64
|
-
verticalPosition: verticalPosition || 'top',
|
|
65
|
-
duration: timeout || 30000
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
MessagesService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: MessagesService, deps: [{ token: i1.MatSnackBar }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
70
|
-
MessagesService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: MessagesService });
|
|
71
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: MessagesService, decorators: [{
|
|
72
|
-
type: Injectable
|
|
73
|
-
}], ctorParameters: function () { return [{ type: i1.MatSnackBar }]; } });
|
|
74
|
-
|
|
75
|
-
class MessageBoxComponent {
|
|
76
|
-
constructor() {
|
|
77
|
-
this.type = 'alert-danger';
|
|
78
|
-
this.title = '';
|
|
79
|
-
this.message = '';
|
|
80
|
-
this.compilerError = false;
|
|
81
|
-
this.errors = [];
|
|
82
|
-
this.onClose = new EventEmitter();
|
|
83
|
-
}
|
|
84
|
-
close() {
|
|
85
|
-
this.onClose.next();
|
|
86
|
-
}
|
|
87
|
-
isArray(error) {
|
|
88
|
-
return Array.isArray(error);
|
|
89
|
-
}
|
|
90
|
-
isErrorObject(error) {
|
|
91
|
-
return error instanceof Object || this.isArray(error);
|
|
92
|
-
}
|
|
93
|
-
getErrorAsString(error) {
|
|
94
|
-
return JSON.stringify(error, undefined, 2);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
MessageBoxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: MessageBoxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
98
|
-
MessageBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: MessageBoxComponent, selector: "message-box", inputs: { type: "type", title: "title", message: "message", compilerError: "compilerError", errors: "errors" }, outputs: { onClose: "onClose" }, ngImport: i0, template: "<div class=\"error-box row\" *ngIf=\"errors.length > 0\">\r\n <div class=\"col-12\">\r\n <div class=\"alert {{type}} alert-dismissible fade show\" role=\"alert\">\r\n <strong class=\"title\" *ngIf=\"title\">{{title}}</strong>\r\n <span class=\"detail-message\" *ngIf=\"message\">{{message}}</span>\r\n <div class=\"alert-text\" *ngFor=\"let error of errors\">\r\n <span class=\"causes\" *ngIf=\"compilerError && isArray(error)\">\r\n <span class=\"error-text\" *ngFor=\"let item of error\" [innerHTML]=\"item.message\"></span>\r\n </span>\r\n\r\n <span class=\"error-text\"\r\n *ngIf=\"(!compilerError || (compilerError && !isArray(error))) && !isErrorObject(error)\" [innerHTML]=\"error\"></span>\r\n <pre *ngIf=\"!compilerError && isErrorObject(error)\">\r\n {{getErrorAsString(error)}}\r\n </pre>\r\n </div>\r\n <button type=\"button\" class=\"close\" (click)=\"close()\" aria-label=\"Close\">\r\n <span aria-hidden=\"true\">×</span>\r\n </button>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".error-box{position:relative;width:100%;background:#f5caca;border:1px solid #8b4646;color:#8b4646;border-radius:5px}.error-box .alert{padding:10px 15px!important}.error-box .alert .close{background:none;border:none;position:absolute;top:2px;right:2px;font-size:20px;color:#8b4646;cursor:pointer}.error-box .alert .title{word-break:break-word;margin-right:5px}.error-box .causes{word-break:break-word}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
99
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: MessageBoxComponent, decorators: [{
|
|
100
|
-
type: Component,
|
|
101
|
-
args: [{ selector: 'message-box', template: "<div class=\"error-box row\" *ngIf=\"errors.length > 0\">\r\n <div class=\"col-12\">\r\n <div class=\"alert {{type}} alert-dismissible fade show\" role=\"alert\">\r\n <strong class=\"title\" *ngIf=\"title\">{{title}}</strong>\r\n <span class=\"detail-message\" *ngIf=\"message\">{{message}}</span>\r\n <div class=\"alert-text\" *ngFor=\"let error of errors\">\r\n <span class=\"causes\" *ngIf=\"compilerError && isArray(error)\">\r\n <span class=\"error-text\" *ngFor=\"let item of error\" [innerHTML]=\"item.message\"></span>\r\n </span>\r\n\r\n <span class=\"error-text\"\r\n *ngIf=\"(!compilerError || (compilerError && !isArray(error))) && !isErrorObject(error)\" [innerHTML]=\"error\"></span>\r\n <pre *ngIf=\"!compilerError && isErrorObject(error)\">\r\n {{getErrorAsString(error)}}\r\n </pre>\r\n </div>\r\n <button type=\"button\" class=\"close\" (click)=\"close()\" aria-label=\"Close\">\r\n <span aria-hidden=\"true\">×</span>\r\n </button>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".error-box{position:relative;width:100%;background:#f5caca;border:1px solid #8b4646;color:#8b4646;border-radius:5px}.error-box .alert{padding:10px 15px!important}.error-box .alert .close{background:none;border:none;position:absolute;top:2px;right:2px;font-size:20px;color:#8b4646;cursor:pointer}.error-box .alert .title{word-break:break-word;margin-right:5px}.error-box .causes{word-break:break-word}\n"] }]
|
|
102
|
-
}], propDecorators: { type: [{
|
|
103
|
-
type: Input
|
|
104
|
-
}], title: [{
|
|
105
|
-
type: Input
|
|
106
|
-
}], message: [{
|
|
107
|
-
type: Input
|
|
108
|
-
}], compilerError: [{
|
|
109
|
-
type: Input
|
|
110
|
-
}], errors: [{
|
|
111
|
-
type: Input
|
|
112
|
-
}], onClose: [{
|
|
113
|
-
type: Output
|
|
114
|
-
}] } });
|
|
115
|
-
|
|
116
|
-
class MessagesModule {
|
|
117
|
-
}
|
|
118
|
-
MessagesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: MessagesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
119
|
-
MessagesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.3", ngImport: i0, type: MessagesModule, declarations: [MessageBoxComponent,
|
|
120
|
-
SnackBarComponent], imports: [CommonModule,
|
|
121
|
-
FormsModule,
|
|
122
|
-
ReactiveFormsModule,
|
|
123
|
-
MatButtonModule,
|
|
124
|
-
MatSnackBarModule], exports: [MessageBoxComponent,
|
|
125
|
-
SnackBarComponent] });
|
|
126
|
-
MessagesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: MessagesModule, providers: [MessagesService], imports: [CommonModule,
|
|
127
|
-
FormsModule,
|
|
128
|
-
ReactiveFormsModule,
|
|
129
|
-
MatButtonModule,
|
|
130
|
-
MatSnackBarModule] });
|
|
131
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: MessagesModule, decorators: [{
|
|
132
|
-
type: NgModule,
|
|
133
|
-
args: [{
|
|
134
|
-
imports: [
|
|
135
|
-
CommonModule,
|
|
136
|
-
FormsModule,
|
|
137
|
-
ReactiveFormsModule,
|
|
138
|
-
MatButtonModule,
|
|
139
|
-
MatSnackBarModule
|
|
140
|
-
],
|
|
141
|
-
declarations: [
|
|
142
|
-
MessageBoxComponent,
|
|
143
|
-
SnackBarComponent
|
|
144
|
-
],
|
|
145
|
-
exports: [
|
|
146
|
-
MessageBoxComponent,
|
|
147
|
-
SnackBarComponent
|
|
148
|
-
],
|
|
149
|
-
providers: [MessagesService]
|
|
150
|
-
}]
|
|
151
|
-
}] });
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Generated bundle index. Do not edit.
|
|
155
|
-
*/
|
|
156
|
-
|
|
157
|
-
export { MessageBoxComponent, MessagesModule, MessagesService, SnackBarComponent };
|
|
158
|
-
//# sourceMappingURL=apipass-messages.mjs.map
|
|
159
|
-
//# sourceMappingURL=apipass-messages.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"apipass-messages.mjs","sources":["../../../projects/messages/src/snack-bar/snack-bar.component.ts","../../../projects/messages/src/snack-bar/snack-bar.component.html","../../../projects/messages/src/messages.service.ts","../../../projects/messages/src/message-box/message-box.component.ts","../../../projects/messages/src/message-box/message-box.component.html","../../../projects/messages/src/messages.module.ts","../../../projects/messages/src/apipass-messages.ts"],"sourcesContent":["import { Component, Inject } from '@angular/core'\r\nimport { MatSnackBar, MAT_SNACK_BAR_DATA } from '@angular/material/snack-bar'\r\n\r\n@Component({\r\n selector: 'snack-bar',\r\n templateUrl: 'snack-bar.component.html',\r\n styleUrls: ['snack-bar.component.scss']\r\n})\r\nexport class SnackBarComponent {\r\n constructor (@Inject(MAT_SNACK_BAR_DATA) public data: any,\r\n public snackBar: MatSnackBar) {\r\n }\r\n}\r\n","<div [innerHTML]=\"data.html\"></div>\r\n<button mat-raised-button (click)=\"snackBar.dismiss()\">x</button>\r\n","import { Injectable } from '@angular/core'\r\nimport { MatSnackBar, MatSnackBarHorizontalPosition, MatSnackBarVerticalPosition } from '@angular/material/snack-bar'\r\nimport { SnackBarComponent } from './snack-bar/snack-bar.component'\r\n\r\n@Injectable()\r\nexport class MessagesService {\r\n constructor (private readonly _snackBar: MatSnackBar) {\r\n }\r\n\r\n public successMessage (title: string, body?: string, horizontalPosition?: MatSnackBarHorizontalPosition, verticalPosition?: MatSnackBarVerticalPosition, timeout?: number): void {\r\n this.customMessage('success', title, body || '', horizontalPosition, verticalPosition, timeout)\r\n }\r\n\r\n public errorMessage (title: string, body: string, horizontalPosition?: MatSnackBarHorizontalPosition, verticalPosition?: MatSnackBarVerticalPosition, timeout?: number): void {\r\n this.customMessage('error', title, body, horizontalPosition, verticalPosition, timeout)\r\n }\r\n\r\n public warnMessage (title: string, body: string, horizontalPosition?: MatSnackBarHorizontalPosition, verticalPosition?: MatSnackBarVerticalPosition, timeout?: number): void {\r\n this.customMessage('warn', title, body, horizontalPosition, verticalPosition, timeout)\r\n }\r\n\r\n public message (type: string, title: string, body: string, horizontalPosition?: MatSnackBarHorizontalPosition, verticalPosition?: MatSnackBarVerticalPosition, timeout?: number): void {\r\n this.customMessage(type, title, body, horizontalPosition, verticalPosition, timeout)\r\n }\r\n\r\n public getErrorMessage (statusCode: number, message: any): string {\r\n let codeMessage\r\n if (message instanceof Object) {\r\n codeMessage = message.status || statusCode\r\n if (message.message) {\r\n codeMessage += ' - ' + message.message\r\n }\r\n return codeMessage\r\n }\r\n return `${statusCode} - ${message}`\r\n }\r\n\r\n public customMessage (type: string, title: string, body: string, horizontalPosition?: MatSnackBarHorizontalPosition, verticalPosition?: MatSnackBarVerticalPosition, timeout?: number): void {\r\n this._snackBar.openFromComponent(SnackBarComponent, {\r\n data: {\r\n html: `<b>${title}</b> <br/> ${body}`\r\n },\r\n panelClass: ['apipass-message', `apipass-message-${type || 'error'}`],\r\n horizontalPosition: horizontalPosition || 'end',\r\n verticalPosition: verticalPosition || 'top',\r\n duration: timeout || 30000\r\n })\r\n }\r\n}\r\n","import { Component, Input, EventEmitter, Output } from '@angular/core'\r\n\r\n@Component({\r\n selector: 'message-box',\r\n templateUrl: 'message-box.component.html',\r\n styleUrls: ['message-box.component.scss']\r\n})\r\nexport class MessageBoxComponent {\n @Input() public type = 'alert-danger'\r\n @Input() public title = ''\r\n @Input() public message = ''\r\n @Input() public compilerError = false\r\n @Input() public errors: [] = []\r\n\r\n @Output() public onClose = new EventEmitter<void>()\r\n\r\n public close (): void {\r\n this.onClose.next()\r\n }\r\n\r\n public isArray (error: any): boolean {\r\n return Array.isArray(error)\r\n }\r\n\r\n public isErrorObject (error: any): boolean {\r\n return error instanceof Object || this.isArray(error)\r\n }\r\n\r\n public getErrorAsString (error: any): string {\r\n return JSON.stringify(error, undefined, 2)\r\n }\n}\r\n","<div class=\"error-box row\" *ngIf=\"errors.length > 0\">\r\n <div class=\"col-12\">\r\n <div class=\"alert {{type}} alert-dismissible fade show\" role=\"alert\">\r\n <strong class=\"title\" *ngIf=\"title\">{{title}}</strong>\r\n <span class=\"detail-message\" *ngIf=\"message\">{{message}}</span>\r\n <div class=\"alert-text\" *ngFor=\"let error of errors\">\r\n <span class=\"causes\" *ngIf=\"compilerError && isArray(error)\">\r\n <span class=\"error-text\" *ngFor=\"let item of error\" [innerHTML]=\"item.message\"></span>\r\n </span>\r\n\r\n <span class=\"error-text\"\r\n *ngIf=\"(!compilerError || (compilerError && !isArray(error))) && !isErrorObject(error)\" [innerHTML]=\"error\"></span>\r\n <pre *ngIf=\"!compilerError && isErrorObject(error)\">\r\n {{getErrorAsString(error)}}\r\n </pre>\r\n </div>\r\n <button type=\"button\" class=\"close\" (click)=\"close()\" aria-label=\"Close\">\r\n <span aria-hidden=\"true\">×</span>\r\n </button>\r\n </div>\r\n </div>\r\n</div>\r\n","import { NgModule } from '@angular/core'\r\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms'\r\nimport { CommonModule } from '@angular/common'\r\nimport { MessageBoxComponent } from './message-box/message-box.component'\r\nimport { MessagesService } from './messages.service'\r\nimport { SnackBarComponent } from './snack-bar/snack-bar.component'\r\nimport { MatButtonModule } from '@angular/material/button'\r\nimport { MatSnackBarModule } from '@angular/material/snack-bar'\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n FormsModule,\r\n ReactiveFormsModule,\r\n MatButtonModule,\r\n MatSnackBarModule\r\n ],\r\n declarations: [\r\n MessageBoxComponent,\r\n SnackBarComponent\r\n ],\r\n exports: [\r\n MessageBoxComponent,\r\n SnackBarComponent\r\n ],\r\n providers: [MessagesService]\r\n})\r\nexport class MessagesModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;MAQa,iBAAiB,CAAA;IAC5B,WAAgD,CAAA,IAAS,EAChD,QAAqB,EAAA;AADkB,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AAd,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAd,cAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,iBATvB,mBAAmB;AACnB,QAAA,iBAAiB,aARjB,YAAY;QACZ,WAAW;QACX,mBAAmB;QACnB,eAAe;AACf,QAAA,iBAAiB,aAOjB,mBAAmB;QACnB,iBAAiB,CAAA,EAAA,CAAA,CAAA;AAIR,cAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,EAFd,SAAA,EAAA,CAAC,eAAe,CAAC,YAd1B,YAAY;QACZ,WAAW;QACX,mBAAmB;QACnB,eAAe;QACf,iBAAiB,CAAA,EAAA,CAAA,CAAA;2FAYR,cAAc,EAAA,UAAA,EAAA,CAAA;kBAlB1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,WAAW;wBACX,mBAAmB;wBACnB,eAAe;wBACf,iBAAiB;AAClB,qBAAA;AACD,oBAAA,YAAY,EAAE;wBACZ,mBAAmB;wBACnB,iBAAiB;AAClB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,mBAAmB;wBACnB,iBAAiB;AAClB,qBAAA;oBACD,SAAS,EAAE,CAAC,eAAe,CAAC;iBAC7B,CAAA;;;AC1BD;;AAEG;;;;"}
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import * as i1 from '@angular/material/snack-bar';
|
|
2
|
-
import { MAT_SNACK_BAR_DATA, MatSnackBarModule } from '@angular/material/snack-bar';
|
|
3
|
-
export * from '@angular/material/snack-bar';
|
|
4
|
-
import * as i0 from '@angular/core';
|
|
5
|
-
import { Component, Inject, Injectable, EventEmitter, Input, Output, NgModule } from '@angular/core';
|
|
6
|
-
import * as i2 from '@angular/material/button';
|
|
7
|
-
import { MatButtonModule } from '@angular/material/button';
|
|
8
|
-
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
9
|
-
import * as i1$1 from '@angular/common';
|
|
10
|
-
import { CommonModule } from '@angular/common';
|
|
11
|
-
|
|
12
|
-
class SnackBarComponent {
|
|
13
|
-
constructor(data, snackBar) {
|
|
14
|
-
this.data = data;
|
|
15
|
-
this.snackBar = snackBar;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
SnackBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: SnackBarComponent, deps: [{ token: MAT_SNACK_BAR_DATA }, { token: i1.MatSnackBar }], target: i0.ɵɵFactoryTarget.Component });
|
|
19
|
-
SnackBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: SnackBarComponent, selector: "snack-bar", ngImport: i0, template: "<div [innerHTML]=\"data.html\"></div>\r\n<button mat-raised-button (click)=\"snackBar.dismiss()\">x</button>\r\n", styles: [""], dependencies: [{ kind: "component", type: i2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }] });
|
|
20
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: SnackBarComponent, decorators: [{
|
|
21
|
-
type: Component,
|
|
22
|
-
args: [{ selector: 'snack-bar', template: "<div [innerHTML]=\"data.html\"></div>\r\n<button mat-raised-button (click)=\"snackBar.dismiss()\">x</button>\r\n" }]
|
|
23
|
-
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
24
|
-
type: Inject,
|
|
25
|
-
args: [MAT_SNACK_BAR_DATA]
|
|
26
|
-
}] }, { type: i1.MatSnackBar }]; } });
|
|
27
|
-
|
|
28
|
-
class MessagesService {
|
|
29
|
-
constructor(_snackBar) {
|
|
30
|
-
this._snackBar = _snackBar;
|
|
31
|
-
}
|
|
32
|
-
successMessage(title, body, horizontalPosition, verticalPosition, timeout) {
|
|
33
|
-
this.customMessage('success', title, body || '', horizontalPosition, verticalPosition, timeout);
|
|
34
|
-
}
|
|
35
|
-
errorMessage(title, body, horizontalPosition, verticalPosition, timeout) {
|
|
36
|
-
this.customMessage('error', title, body, horizontalPosition, verticalPosition, timeout);
|
|
37
|
-
}
|
|
38
|
-
warnMessage(title, body, horizontalPosition, verticalPosition, timeout) {
|
|
39
|
-
this.customMessage('warn', title, body, horizontalPosition, verticalPosition, timeout);
|
|
40
|
-
}
|
|
41
|
-
message(type, title, body, horizontalPosition, verticalPosition, timeout) {
|
|
42
|
-
this.customMessage(type, title, body, horizontalPosition, verticalPosition, timeout);
|
|
43
|
-
}
|
|
44
|
-
getErrorMessage(statusCode, message) {
|
|
45
|
-
let codeMessage;
|
|
46
|
-
if (message instanceof Object) {
|
|
47
|
-
codeMessage = message.status || statusCode;
|
|
48
|
-
if (message.message) {
|
|
49
|
-
codeMessage += ' - ' + message.message;
|
|
50
|
-
}
|
|
51
|
-
return codeMessage;
|
|
52
|
-
}
|
|
53
|
-
return `${statusCode} - ${message}`;
|
|
54
|
-
}
|
|
55
|
-
customMessage(type, title, body, horizontalPosition, verticalPosition, timeout) {
|
|
56
|
-
this._snackBar.openFromComponent(SnackBarComponent, {
|
|
57
|
-
data: {
|
|
58
|
-
html: `<b>${title}</b> <br/> ${body}`
|
|
59
|
-
},
|
|
60
|
-
panelClass: ['apipass-message', `apipass-message-${type || 'error'}`],
|
|
61
|
-
horizontalPosition: horizontalPosition || 'end',
|
|
62
|
-
verticalPosition: verticalPosition || 'top',
|
|
63
|
-
duration: timeout || 30000
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
MessagesService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: MessagesService, deps: [{ token: i1.MatSnackBar }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
68
|
-
MessagesService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: MessagesService });
|
|
69
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: MessagesService, decorators: [{
|
|
70
|
-
type: Injectable
|
|
71
|
-
}], ctorParameters: function () { return [{ type: i1.MatSnackBar }]; } });
|
|
72
|
-
|
|
73
|
-
class MessageBoxComponent {
|
|
74
|
-
constructor() {
|
|
75
|
-
this.type = 'alert-danger';
|
|
76
|
-
this.title = '';
|
|
77
|
-
this.message = '';
|
|
78
|
-
this.compilerError = false;
|
|
79
|
-
this.errors = [];
|
|
80
|
-
this.onClose = new EventEmitter();
|
|
81
|
-
}
|
|
82
|
-
close() {
|
|
83
|
-
this.onClose.next();
|
|
84
|
-
}
|
|
85
|
-
isArray(error) {
|
|
86
|
-
return Array.isArray(error);
|
|
87
|
-
}
|
|
88
|
-
isErrorObject(error) {
|
|
89
|
-
return error instanceof Object || this.isArray(error);
|
|
90
|
-
}
|
|
91
|
-
getErrorAsString(error) {
|
|
92
|
-
return JSON.stringify(error, undefined, 2);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
MessageBoxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: MessageBoxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
96
|
-
MessageBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: MessageBoxComponent, selector: "message-box", inputs: { type: "type", title: "title", message: "message", compilerError: "compilerError", errors: "errors" }, outputs: { onClose: "onClose" }, ngImport: i0, template: "<div class=\"error-box row\" *ngIf=\"errors.length > 0\">\r\n <div class=\"col-12\">\r\n <div class=\"alert {{type}} alert-dismissible fade show\" role=\"alert\">\r\n <strong class=\"title\" *ngIf=\"title\">{{title}}</strong>\r\n <span class=\"detail-message\" *ngIf=\"message\">{{message}}</span>\r\n <div class=\"alert-text\" *ngFor=\"let error of errors\">\r\n <span class=\"causes\" *ngIf=\"compilerError && isArray(error)\">\r\n <span class=\"error-text\" *ngFor=\"let item of error\" [innerHTML]=\"item.message\"></span>\r\n </span>\r\n\r\n <span class=\"error-text\"\r\n *ngIf=\"(!compilerError || (compilerError && !isArray(error))) && !isErrorObject(error)\" [innerHTML]=\"error\"></span>\r\n <pre *ngIf=\"!compilerError && isErrorObject(error)\">\r\n {{getErrorAsString(error)}}\r\n </pre>\r\n </div>\r\n <button type=\"button\" class=\"close\" (click)=\"close()\" aria-label=\"Close\">\r\n <span aria-hidden=\"true\">×</span>\r\n </button>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".error-box{position:relative;width:100%;background:#f5caca;border:1px solid #8b4646;color:#8b4646;border-radius:5px}.error-box .alert{padding:10px 15px!important}.error-box .alert .close{background:none;border:none;position:absolute;top:2px;right:2px;font-size:20px;color:#8b4646;cursor:pointer}.error-box .alert .title{word-break:break-word;margin-right:5px}.error-box .causes{word-break:break-word}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
97
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: MessageBoxComponent, decorators: [{
|
|
98
|
-
type: Component,
|
|
99
|
-
args: [{ selector: 'message-box', template: "<div class=\"error-box row\" *ngIf=\"errors.length > 0\">\r\n <div class=\"col-12\">\r\n <div class=\"alert {{type}} alert-dismissible fade show\" role=\"alert\">\r\n <strong class=\"title\" *ngIf=\"title\">{{title}}</strong>\r\n <span class=\"detail-message\" *ngIf=\"message\">{{message}}</span>\r\n <div class=\"alert-text\" *ngFor=\"let error of errors\">\r\n <span class=\"causes\" *ngIf=\"compilerError && isArray(error)\">\r\n <span class=\"error-text\" *ngFor=\"let item of error\" [innerHTML]=\"item.message\"></span>\r\n </span>\r\n\r\n <span class=\"error-text\"\r\n *ngIf=\"(!compilerError || (compilerError && !isArray(error))) && !isErrorObject(error)\" [innerHTML]=\"error\"></span>\r\n <pre *ngIf=\"!compilerError && isErrorObject(error)\">\r\n {{getErrorAsString(error)}}\r\n </pre>\r\n </div>\r\n <button type=\"button\" class=\"close\" (click)=\"close()\" aria-label=\"Close\">\r\n <span aria-hidden=\"true\">×</span>\r\n </button>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".error-box{position:relative;width:100%;background:#f5caca;border:1px solid #8b4646;color:#8b4646;border-radius:5px}.error-box .alert{padding:10px 15px!important}.error-box .alert .close{background:none;border:none;position:absolute;top:2px;right:2px;font-size:20px;color:#8b4646;cursor:pointer}.error-box .alert .title{word-break:break-word;margin-right:5px}.error-box .causes{word-break:break-word}\n"] }]
|
|
100
|
-
}], propDecorators: { type: [{
|
|
101
|
-
type: Input
|
|
102
|
-
}], title: [{
|
|
103
|
-
type: Input
|
|
104
|
-
}], message: [{
|
|
105
|
-
type: Input
|
|
106
|
-
}], compilerError: [{
|
|
107
|
-
type: Input
|
|
108
|
-
}], errors: [{
|
|
109
|
-
type: Input
|
|
110
|
-
}], onClose: [{
|
|
111
|
-
type: Output
|
|
112
|
-
}] } });
|
|
113
|
-
|
|
114
|
-
class MessagesModule {
|
|
115
|
-
}
|
|
116
|
-
MessagesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: MessagesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
117
|
-
MessagesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.3", ngImport: i0, type: MessagesModule, declarations: [MessageBoxComponent,
|
|
118
|
-
SnackBarComponent], imports: [CommonModule,
|
|
119
|
-
FormsModule,
|
|
120
|
-
ReactiveFormsModule,
|
|
121
|
-
MatButtonModule,
|
|
122
|
-
MatSnackBarModule], exports: [MessageBoxComponent,
|
|
123
|
-
SnackBarComponent] });
|
|
124
|
-
MessagesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: MessagesModule, providers: [MessagesService], imports: [CommonModule,
|
|
125
|
-
FormsModule,
|
|
126
|
-
ReactiveFormsModule,
|
|
127
|
-
MatButtonModule,
|
|
128
|
-
MatSnackBarModule] });
|
|
129
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: MessagesModule, decorators: [{
|
|
130
|
-
type: NgModule,
|
|
131
|
-
args: [{
|
|
132
|
-
imports: [
|
|
133
|
-
CommonModule,
|
|
134
|
-
FormsModule,
|
|
135
|
-
ReactiveFormsModule,
|
|
136
|
-
MatButtonModule,
|
|
137
|
-
MatSnackBarModule
|
|
138
|
-
],
|
|
139
|
-
declarations: [
|
|
140
|
-
MessageBoxComponent,
|
|
141
|
-
SnackBarComponent
|
|
142
|
-
],
|
|
143
|
-
exports: [
|
|
144
|
-
MessageBoxComponent,
|
|
145
|
-
SnackBarComponent
|
|
146
|
-
],
|
|
147
|
-
providers: [MessagesService]
|
|
148
|
-
}]
|
|
149
|
-
}] });
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Generated bundle index. Do not edit.
|
|
153
|
-
*/
|
|
154
|
-
|
|
155
|
-
export { MessageBoxComponent, MessagesModule, MessagesService, SnackBarComponent };
|
|
156
|
-
//# sourceMappingURL=apipass-messages.mjs.map
|
|
157
|
-
//# sourceMappingURL=apipass-messages.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"apipass-messages.mjs","sources":["../../../projects/messages/src/snack-bar/snack-bar.component.ts","../../../projects/messages/src/snack-bar/snack-bar.component.html","../../../projects/messages/src/messages.service.ts","../../../projects/messages/src/message-box/message-box.component.ts","../../../projects/messages/src/message-box/message-box.component.html","../../../projects/messages/src/messages.module.ts","../../../projects/messages/src/apipass-messages.ts"],"sourcesContent":["import { Component, Inject } from '@angular/core'\r\nimport { MatSnackBar, MAT_SNACK_BAR_DATA } from '@angular/material/snack-bar'\r\n\r\n@Component({\r\n selector: 'snack-bar',\r\n templateUrl: 'snack-bar.component.html',\r\n styleUrls: ['snack-bar.component.scss']\r\n})\r\nexport class SnackBarComponent {\r\n constructor (@Inject(MAT_SNACK_BAR_DATA) public data: any,\r\n public snackBar: MatSnackBar) {\r\n }\r\n}\r\n","<div [innerHTML]=\"data.html\"></div>\r\n<button mat-raised-button (click)=\"snackBar.dismiss()\">x</button>\r\n","import { Injectable } from '@angular/core'\r\nimport { MatSnackBar, MatSnackBarHorizontalPosition, MatSnackBarVerticalPosition } from '@angular/material/snack-bar'\r\nimport { SnackBarComponent } from './snack-bar/snack-bar.component'\r\n\r\n@Injectable()\r\nexport class MessagesService {\r\n constructor (private readonly _snackBar: MatSnackBar) {\r\n }\r\n\r\n public successMessage (title: string, body?: string, horizontalPosition?: MatSnackBarHorizontalPosition, verticalPosition?: MatSnackBarVerticalPosition, timeout?: number): void {\r\n this.customMessage('success', title, body || '', horizontalPosition, verticalPosition, timeout)\r\n }\r\n\r\n public errorMessage (title: string, body: string, horizontalPosition?: MatSnackBarHorizontalPosition, verticalPosition?: MatSnackBarVerticalPosition, timeout?: number): void {\r\n this.customMessage('error', title, body, horizontalPosition, verticalPosition, timeout)\r\n }\r\n\r\n public warnMessage (title: string, body: string, horizontalPosition?: MatSnackBarHorizontalPosition, verticalPosition?: MatSnackBarVerticalPosition, timeout?: number): void {\r\n this.customMessage('warn', title, body, horizontalPosition, verticalPosition, timeout)\r\n }\r\n\r\n public message (type: string, title: string, body: string, horizontalPosition?: MatSnackBarHorizontalPosition, verticalPosition?: MatSnackBarVerticalPosition, timeout?: number): void {\r\n this.customMessage(type, title, body, horizontalPosition, verticalPosition, timeout)\r\n }\r\n\r\n public getErrorMessage (statusCode: number, message: any): string {\r\n let codeMessage\r\n if (message instanceof Object) {\r\n codeMessage = message.status || statusCode\r\n if (message.message) {\r\n codeMessage += ' - ' + message.message\r\n }\r\n return codeMessage\r\n }\r\n return `${statusCode} - ${message}`\r\n }\r\n\r\n public customMessage (type: string, title: string, body: string, horizontalPosition?: MatSnackBarHorizontalPosition, verticalPosition?: MatSnackBarVerticalPosition, timeout?: number): void {\r\n this._snackBar.openFromComponent(SnackBarComponent, {\r\n data: {\r\n html: `<b>${title}</b> <br/> ${body}`\r\n },\r\n panelClass: ['apipass-message', `apipass-message-${type || 'error'}`],\r\n horizontalPosition: horizontalPosition || 'end',\r\n verticalPosition: verticalPosition || 'top',\r\n duration: timeout || 30000\r\n })\r\n }\r\n}\r\n","import { Component, Input, EventEmitter, Output } from '@angular/core'\r\n\r\n@Component({\r\n selector: 'message-box',\r\n templateUrl: 'message-box.component.html',\r\n styleUrls: ['message-box.component.scss']\r\n})\r\nexport class MessageBoxComponent {\n @Input() public type = 'alert-danger'\r\n @Input() public title = ''\r\n @Input() public message = ''\r\n @Input() public compilerError = false\r\n @Input() public errors: [] = []\r\n\r\n @Output() public onClose = new EventEmitter<void>()\r\n\r\n public close (): void {\r\n this.onClose.next()\r\n }\r\n\r\n public isArray (error: any): boolean {\r\n return Array.isArray(error)\r\n }\r\n\r\n public isErrorObject (error: any): boolean {\r\n return error instanceof Object || this.isArray(error)\r\n }\r\n\r\n public getErrorAsString (error: any): string {\r\n return JSON.stringify(error, undefined, 2)\r\n }\n}\r\n","<div class=\"error-box row\" *ngIf=\"errors.length > 0\">\r\n <div class=\"col-12\">\r\n <div class=\"alert {{type}} alert-dismissible fade show\" role=\"alert\">\r\n <strong class=\"title\" *ngIf=\"title\">{{title}}</strong>\r\n <span class=\"detail-message\" *ngIf=\"message\">{{message}}</span>\r\n <div class=\"alert-text\" *ngFor=\"let error of errors\">\r\n <span class=\"causes\" *ngIf=\"compilerError && isArray(error)\">\r\n <span class=\"error-text\" *ngFor=\"let item of error\" [innerHTML]=\"item.message\"></span>\r\n </span>\r\n\r\n <span class=\"error-text\"\r\n *ngIf=\"(!compilerError || (compilerError && !isArray(error))) && !isErrorObject(error)\" [innerHTML]=\"error\"></span>\r\n <pre *ngIf=\"!compilerError && isErrorObject(error)\">\r\n {{getErrorAsString(error)}}\r\n </pre>\r\n </div>\r\n <button type=\"button\" class=\"close\" (click)=\"close()\" aria-label=\"Close\">\r\n <span aria-hidden=\"true\">×</span>\r\n </button>\r\n </div>\r\n </div>\r\n</div>\r\n","import { NgModule } from '@angular/core'\r\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms'\r\nimport { CommonModule } from '@angular/common'\r\nimport { MessageBoxComponent } from './message-box/message-box.component'\r\nimport { MessagesService } from './messages.service'\r\nimport { SnackBarComponent } from './snack-bar/snack-bar.component'\r\nimport { MatButtonModule } from '@angular/material/button'\r\nimport { MatSnackBarModule } from '@angular/material/snack-bar'\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n FormsModule,\r\n ReactiveFormsModule,\r\n MatButtonModule,\r\n MatSnackBarModule\r\n ],\r\n declarations: [\r\n MessageBoxComponent,\r\n SnackBarComponent\r\n ],\r\n exports: [\r\n MessageBoxComponent,\r\n SnackBarComponent\r\n ],\r\n providers: [MessagesService]\r\n})\r\nexport class MessagesModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;MAQa,iBAAiB,CAAA;IAC5B,WAAgD,CAAA,IAAS,EAChD,QAAqB,EAAA;QADkB,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAK;QAChD,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAa;KAC7B;;AAHU,iBAAA,CAAA,IAAA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