@apipass/messages 1.0.7 → 1.0.8
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/{esm2020 → esm2022}/apipass-messages.mjs +4 -4
- package/esm2022/message-box/message-box.component.mjs +43 -0
- package/esm2022/messages.module.mjs +47 -0
- package/{esm2020 → esm2022}/messages.service.mjs +52 -50
- package/{esm2020 → esm2022}/public-api.mjs +5 -5
- package/esm2022/snack-bar/snack-bar.component.mjs +24 -0
- package/{fesm2020 → fesm2022}/apipass-messages.mjs +134 -134
- package/{fesm2020 → fesm2022}/apipass-messages.mjs.map +1 -1
- 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 +14 -14
- package/package.json +13 -19
- package/public-api.d.ts +5 -5
- package/snack-bar/snack-bar.component.d.ts +9 -9
- package/esm2020/message-box/message-box.component.mjs +0 -44
- package/esm2020/messages.module.mjs +0 -46
- 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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated bundle index. Do not edit.
|
|
3
|
-
*/
|
|
4
|
-
export * from './public-api';
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
export * from './public-api';
|
|
5
5
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBpcGFzcy1tZXNzYWdlcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL21lc3NhZ2VzL3NyYy9hcGlwYXNzLW1lc3NhZ2VzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxjQUFjLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vcHVibGljLWFwaSc7XG4iXX0=
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Component, Input, EventEmitter, Output } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import * as i1 from "@angular/common";
|
|
4
|
+
class MessageBoxComponent {
|
|
5
|
+
type = 'alert-danger';
|
|
6
|
+
title = '';
|
|
7
|
+
message = '';
|
|
8
|
+
compilerError = false;
|
|
9
|
+
errors = [];
|
|
10
|
+
onClose = new EventEmitter();
|
|
11
|
+
close() {
|
|
12
|
+
this.onClose.next();
|
|
13
|
+
}
|
|
14
|
+
isArray(error) {
|
|
15
|
+
return Array.isArray(error);
|
|
16
|
+
}
|
|
17
|
+
isErrorObject(error) {
|
|
18
|
+
return error instanceof Object || this.isArray(error);
|
|
19
|
+
}
|
|
20
|
+
getErrorAsString(error) {
|
|
21
|
+
return JSON.stringify(error, undefined, 2);
|
|
22
|
+
}
|
|
23
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: MessageBoxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
24
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.2", 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"] }] });
|
|
25
|
+
}
|
|
26
|
+
export { MessageBoxComponent };
|
|
27
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: MessageBoxComponent, decorators: [{
|
|
28
|
+
type: Component,
|
|
29
|
+
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"] }]
|
|
30
|
+
}], propDecorators: { type: [{
|
|
31
|
+
type: Input
|
|
32
|
+
}], title: [{
|
|
33
|
+
type: Input
|
|
34
|
+
}], message: [{
|
|
35
|
+
type: Input
|
|
36
|
+
}], compilerError: [{
|
|
37
|
+
type: Input
|
|
38
|
+
}], errors: [{
|
|
39
|
+
type: Input
|
|
40
|
+
}], onClose: [{
|
|
41
|
+
type: Output
|
|
42
|
+
}] } });
|
|
43
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVzc2FnZS1ib3guY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcHJvamVjdHMvbWVzc2FnZXMvc3JjL21lc3NhZ2UtYm94L21lc3NhZ2UtYm94LmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uL3Byb2plY3RzL21lc3NhZ2VzL3NyYy9tZXNzYWdlLWJveC9tZXNzYWdlLWJveC5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQ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lsZXJFcnJvciAmJiAhaXNBcnJheShlcnJvcikpKSAmJiAhaXNFcnJvck9iamVjdChlcnJvcilcIiBbaW5uZXJIVE1MXT1cImVycm9yXCI+PC9zcGFuPlxyXG4gICAgICAgIDxwcmUgKm5nSWY9XCIhY29tcGlsZXJFcnJvciAmJiBpc0Vycm9yT2JqZWN0KGVycm9yKVwiPlxyXG4gICAgICAgICAge3tnZXRFcnJvckFzU3RyaW5nKGVycm9yKX19XHJcbiAgICAgICAgPC9wcmU+XHJcbiAgICAgIDwvZGl2PlxyXG4gICAgICA8YnV0dG9uIHR5cGU9XCJidXR0b25cIiBjbGFzcz1cImNsb3NlXCIgKGNsaWNrKT1cImNsb3NlKClcIiBhcmlhLWxhYmVsPVwiQ2xvc2VcIj5cclxuICAgICAgICA8c3BhbiBhcmlhLWhpZGRlbj1cInRydWVcIj4mdGltZXM7PC9zcGFuPlxyXG4gICAgICA8L2J1dHRvbj5cclxuICAgIDwvZGl2PlxyXG4gIDwvZGl2PlxyXG48L2Rpdj5cclxuIl19
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
class MessagesModule {
|
|
11
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: MessagesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
12
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.2", ngImport: i0, type: MessagesModule, declarations: [MessageBoxComponent,
|
|
13
|
+
SnackBarComponent], imports: [CommonModule,
|
|
14
|
+
FormsModule,
|
|
15
|
+
ReactiveFormsModule,
|
|
16
|
+
MatButtonModule,
|
|
17
|
+
MatSnackBarModule], exports: [MessageBoxComponent,
|
|
18
|
+
SnackBarComponent] });
|
|
19
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: MessagesModule, providers: [MessagesService], imports: [CommonModule,
|
|
20
|
+
FormsModule,
|
|
21
|
+
ReactiveFormsModule,
|
|
22
|
+
MatButtonModule,
|
|
23
|
+
MatSnackBarModule] });
|
|
24
|
+
}
|
|
25
|
+
export { MessagesModule };
|
|
26
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: MessagesModule, decorators: [{
|
|
27
|
+
type: NgModule,
|
|
28
|
+
args: [{
|
|
29
|
+
imports: [
|
|
30
|
+
CommonModule,
|
|
31
|
+
FormsModule,
|
|
32
|
+
ReactiveFormsModule,
|
|
33
|
+
MatButtonModule,
|
|
34
|
+
MatSnackBarModule
|
|
35
|
+
],
|
|
36
|
+
declarations: [
|
|
37
|
+
MessageBoxComponent,
|
|
38
|
+
SnackBarComponent
|
|
39
|
+
],
|
|
40
|
+
exports: [
|
|
41
|
+
MessageBoxComponent,
|
|
42
|
+
SnackBarComponent
|
|
43
|
+
],
|
|
44
|
+
providers: [MessagesService]
|
|
45
|
+
}]
|
|
46
|
+
}] });
|
|
47
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVzc2FnZXMubW9kdWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vcHJvamVjdHMvbWVzc2FnZXMvc3JjL21lc3NhZ2VzLm1vZHVsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQU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XJDb21wb25lbnRcclxuICBdLFxyXG4gIGV4cG9ydHM6IFtcclxuICAgIE1lc3NhZ2VCb3hDb21wb25lbnQsXHJcbiAgICBTbmFja0JhckNvbXBvbmVudFxyXG4gIF0sXHJcbiAgcHJvdmlkZXJzOiBbTWVzc2FnZXNTZXJ2aWNlXVxyXG59KVxyXG5leHBvcnQgY2xhc3MgTWVzc2FnZXNNb2R1bGUge31cclxuIl19
|
|
@@ -1,50 +1,52 @@
|
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
|
+
class MessagesService {
|
|
7
|
+
_snackBar;
|
|
8
|
+
constructor(_snackBar) {
|
|
9
|
+
this._snackBar = _snackBar;
|
|
10
|
+
}
|
|
11
|
+
successMessage(title, body, horizontalPosition, verticalPosition, timeout) {
|
|
12
|
+
this.customMessage('success', title, body || '', horizontalPosition, verticalPosition, timeout);
|
|
13
|
+
}
|
|
14
|
+
errorMessage(title, body, horizontalPosition, verticalPosition, timeout) {
|
|
15
|
+
this.customMessage('error', title, body, horizontalPosition, verticalPosition, timeout);
|
|
16
|
+
}
|
|
17
|
+
warnMessage(title, body, horizontalPosition, verticalPosition, timeout) {
|
|
18
|
+
this.customMessage('warn', title, body, horizontalPosition, verticalPosition, timeout);
|
|
19
|
+
}
|
|
20
|
+
message(type, title, body, horizontalPosition, verticalPosition, timeout) {
|
|
21
|
+
this.customMessage(type, title, body, horizontalPosition, verticalPosition, timeout);
|
|
22
|
+
}
|
|
23
|
+
getErrorMessage(statusCode, message) {
|
|
24
|
+
let codeMessage;
|
|
25
|
+
if (message instanceof Object) {
|
|
26
|
+
codeMessage = message.status || statusCode;
|
|
27
|
+
if (message.message) {
|
|
28
|
+
codeMessage += ' - ' + message.message;
|
|
29
|
+
}
|
|
30
|
+
return codeMessage;
|
|
31
|
+
}
|
|
32
|
+
return `${statusCode} - ${message}`;
|
|
33
|
+
}
|
|
34
|
+
customMessage(type, title, body, horizontalPosition, verticalPosition, timeout) {
|
|
35
|
+
this._snackBar.openFromComponent(SnackBarComponent, {
|
|
36
|
+
data: {
|
|
37
|
+
html: `<b>${title}</b> <br/> ${body}`
|
|
38
|
+
},
|
|
39
|
+
panelClass: ['apipass-message', `apipass-message-${type || 'error'}`],
|
|
40
|
+
horizontalPosition: horizontalPosition || 'end',
|
|
41
|
+
verticalPosition: verticalPosition || 'top',
|
|
42
|
+
duration: timeout || 30000
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: MessagesService, deps: [{ token: i1.MatSnackBar }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
46
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: MessagesService });
|
|
47
|
+
}
|
|
48
|
+
export { MessagesService };
|
|
49
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: MessagesService, decorators: [{
|
|
50
|
+
type: Injectable
|
|
51
|
+
}], ctorParameters: function () { return [{ type: i1.MatSnackBar }]; } });
|
|
52
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVzc2FnZXMuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL21lc3NhZ2VzL3NyYy9tZXNzYWdlcy5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUE7QUFDMUMsT0FBTyxFQUFFLFdBQVcsRUFBOEQsTUFBTSw2QkFBNkIsQ0FBQTtBQUNySCxPQUFPLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQTs7O0FBRW5FLE1BQ2EsZUFBZTtJQUNJO0lBQTlCLFlBQThCLFNBQXNCO1FBQXRCLGNBQVMsR0FBVCxTQUFTLENBQWE7SUFDcEQsQ0FBQztJQUVNLGNBQWMsQ0FBRSxLQUFhLEVBQUUsSUFBYSxFQUFFLGtCQUFrRCxFQUFFLGdCQUE4QyxFQUFFLE9BQWdCO1FBQ3ZLLElBQUksQ0FBQyxhQUFhLENBQUMsU0FBUyxFQUFFLEtBQUssRUFBRSxJQUFJLElBQUksRUFBRSxFQUFFLGtCQUFrQixFQUFFLGdCQUFnQixFQUFFLE9BQU8sQ0FBQyxDQUFBO0lBQ2pHLENBQUM7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c3RyaW5nLCBib2R5OiBzdHJpbmcsIGhvcml6b250YWxQb3NpdGlvbj86IE1hdFNuYWNrQmFySG9yaXpvbnRhbFBvc2l0aW9uLCB2ZXJ0aWNhbFBvc2l0aW9uPzogTWF0U25hY2tCYXJWZXJ0aWNhbFBvc2l0aW9uLCB0aW1lb3V0PzogbnVtYmVyKTogdm9pZCB7XHJcbiAgICB0aGlzLl9zbmFja0Jhci5vcGVuRnJvbUNvbXBvbmVudChTbmFja0JhckNvbXBvbmVudCwge1xyXG4gICAgICBkYXRhOiB7XHJcbiAgICAgICAgaHRtbDogYDxiPiR7dGl0bGV9PC9iPiA8YnIvPiAke2JvZHl9YFxyXG4gICAgICB9LFxyXG4gICAgICBwYW5lbENsYXNzOiBbJ2FwaXBhc3MtbWVzc2FnZScsIGBhcGlwYXNzLW1lc3NhZ2UtJHt0eXBlIHx8ICdlcnJvcid9YF0sXHJcbiAgICAgIGhvcml6b250YWxQb3NpdGlvbjogaG9yaXpvbnRhbFBvc2l0aW9uIHx8ICdlbmQnLFxyXG4gICAgICB2ZXJ0aWNhbFBvc2l0aW9uOiB2ZXJ0aWNhbFBvc2l0aW9uIHx8ICd0b3AnLFxyXG4gICAgICBkdXJhdGlvbjogdGltZW91dCB8fCAzMDAwMFxyXG4gICAgfSlcclxuICB9XHJcbn1cclxuIl19
|
|
@@ -1,6 +1,6 @@
|
|
|
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';
|
|
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
6
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL21lc3NhZ2VzL3NyYy9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsNkJBQTZCLENBQUE7QUFDM0MsY0FBYyxvQkFBb0IsQ0FBQTtBQUNsQyxjQUFjLG1CQUFtQixDQUFBO0FBQ2pDLGNBQWMscUNBQXFDLENBQUE7QUFDbkQsY0FBYyxpQ0FBaUMsQ0FBQSIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJ0Bhbmd1bGFyL21hdGVyaWFsL3NuYWNrLWJhcidcclxuZXhwb3J0ICogZnJvbSAnLi9tZXNzYWdlcy5zZXJ2aWNlJ1xyXG5leHBvcnQgKiBmcm9tICcuL21lc3NhZ2VzLm1vZHVsZSdcclxuZXhwb3J0ICogZnJvbSAnLi9tZXNzYWdlLWJveC9tZXNzYWdlLWJveC5jb21wb25lbnQnXHJcbmV4cG9ydCAqIGZyb20gJy4vc25hY2stYmFyL3NuYWNrLWJhci5jb21wb25lbnQnXHJcbiJdfQ==
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
class SnackBarComponent {
|
|
7
|
+
data;
|
|
8
|
+
snackBar;
|
|
9
|
+
constructor(data, snackBar) {
|
|
10
|
+
this.data = data;
|
|
11
|
+
this.snackBar = snackBar;
|
|
12
|
+
}
|
|
13
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: SnackBarComponent, deps: [{ token: MAT_SNACK_BAR_DATA }, { token: i1.MatSnackBar }], target: i0.ɵɵFactoryTarget.Component });
|
|
14
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.2", 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"] }] });
|
|
15
|
+
}
|
|
16
|
+
export { SnackBarComponent };
|
|
17
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: SnackBarComponent, decorators: [{
|
|
18
|
+
type: Component,
|
|
19
|
+
args: [{ selector: 'snack-bar', template: "<div [innerHTML]=\"data.html\"></div>\r\n<button mat-raised-button (click)=\"snackBar.dismiss()\">x</button>\r\n" }]
|
|
20
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
21
|
+
type: Inject,
|
|
22
|
+
args: [MAT_SNACK_BAR_DATA]
|
|
23
|
+
}] }, { type: i1.MatSnackBar }]; } });
|
|
24
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic25hY2stYmFyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL21lc3NhZ2VzL3NyYy9zbmFjay1iYXIvc25hY2stYmFyLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uL3Byb2plY3RzL21lc3NhZ2VzL3NyYy9zbmFjay1iYXIvc25hY2stYmFyLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxFQUFFLE1BQU0sZUFBZSxDQUFBO0FBQ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0LXJhaXNlZC1idXR0b24gKGNsaWNrKT1cInNuYWNrQmFyLmRpc21pc3MoKVwiPng8L2J1dHRvbj5cclxuIl19
|
|
@@ -9,149 +9,149 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
|
9
9
|
import * as i1$1 from '@angular/common';
|
|
10
10
|
import { CommonModule } from '@angular/common';
|
|
11
11
|
|
|
12
|
-
class SnackBarComponent {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
i0.ɵɵ
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
12
|
+
class SnackBarComponent {
|
|
13
|
+
data;
|
|
14
|
+
snackBar;
|
|
15
|
+
constructor(data, snackBar) {
|
|
16
|
+
this.data = data;
|
|
17
|
+
this.snackBar = snackBar;
|
|
18
|
+
}
|
|
19
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: SnackBarComponent, deps: [{ token: MAT_SNACK_BAR_DATA }, { token: i1.MatSnackBar }], target: i0.ɵɵFactoryTarget.Component });
|
|
20
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.2", 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"] }] });
|
|
21
|
+
}
|
|
22
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: SnackBarComponent, decorators: [{
|
|
23
|
+
type: Component,
|
|
24
|
+
args: [{ selector: 'snack-bar', template: "<div [innerHTML]=\"data.html\"></div>\r\n<button mat-raised-button (click)=\"snackBar.dismiss()\">x</button>\r\n" }]
|
|
25
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
26
|
+
type: Inject,
|
|
27
|
+
args: [MAT_SNACK_BAR_DATA]
|
|
26
28
|
}] }, { type: i1.MatSnackBar }]; } });
|
|
27
29
|
|
|
28
|
-
class MessagesService {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
30
|
+
class MessagesService {
|
|
31
|
+
_snackBar;
|
|
32
|
+
constructor(_snackBar) {
|
|
33
|
+
this._snackBar = _snackBar;
|
|
34
|
+
}
|
|
35
|
+
successMessage(title, body, horizontalPosition, verticalPosition, timeout) {
|
|
36
|
+
this.customMessage('success', title, body || '', horizontalPosition, verticalPosition, timeout);
|
|
37
|
+
}
|
|
38
|
+
errorMessage(title, body, horizontalPosition, verticalPosition, timeout) {
|
|
39
|
+
this.customMessage('error', title, body, horizontalPosition, verticalPosition, timeout);
|
|
40
|
+
}
|
|
41
|
+
warnMessage(title, body, horizontalPosition, verticalPosition, timeout) {
|
|
42
|
+
this.customMessage('warn', title, body, horizontalPosition, verticalPosition, timeout);
|
|
43
|
+
}
|
|
44
|
+
message(type, title, body, horizontalPosition, verticalPosition, timeout) {
|
|
45
|
+
this.customMessage(type, title, body, horizontalPosition, verticalPosition, timeout);
|
|
46
|
+
}
|
|
47
|
+
getErrorMessage(statusCode, message) {
|
|
48
|
+
let codeMessage;
|
|
49
|
+
if (message instanceof Object) {
|
|
50
|
+
codeMessage = message.status || statusCode;
|
|
51
|
+
if (message.message) {
|
|
52
|
+
codeMessage += ' - ' + message.message;
|
|
53
|
+
}
|
|
54
|
+
return codeMessage;
|
|
55
|
+
}
|
|
56
|
+
return `${statusCode} - ${message}`;
|
|
57
|
+
}
|
|
58
|
+
customMessage(type, title, body, horizontalPosition, verticalPosition, timeout) {
|
|
59
|
+
this._snackBar.openFromComponent(SnackBarComponent, {
|
|
60
|
+
data: {
|
|
61
|
+
html: `<b>${title}</b> <br/> ${body}`
|
|
62
|
+
},
|
|
63
|
+
panelClass: ['apipass-message', `apipass-message-${type || 'error'}`],
|
|
64
|
+
horizontalPosition: horizontalPosition || 'end',
|
|
65
|
+
verticalPosition: verticalPosition || 'top',
|
|
66
|
+
duration: timeout || 30000
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: MessagesService, deps: [{ token: i1.MatSnackBar }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
70
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: MessagesService });
|
|
71
|
+
}
|
|
72
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: MessagesService, decorators: [{
|
|
73
|
+
type: Injectable
|
|
71
74
|
}], ctorParameters: function () { return [{ type: i1.MatSnackBar }]; } });
|
|
72
75
|
|
|
73
|
-
class MessageBoxComponent {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
type: Input
|
|
102
|
-
}],
|
|
103
|
-
type: Input
|
|
104
|
-
}],
|
|
105
|
-
type: Input
|
|
106
|
-
}],
|
|
107
|
-
type: Input
|
|
108
|
-
}],
|
|
109
|
-
type:
|
|
110
|
-
}], onClose: [{
|
|
111
|
-
type: Output
|
|
76
|
+
class MessageBoxComponent {
|
|
77
|
+
type = 'alert-danger';
|
|
78
|
+
title = '';
|
|
79
|
+
message = '';
|
|
80
|
+
compilerError = false;
|
|
81
|
+
errors = [];
|
|
82
|
+
onClose = new EventEmitter();
|
|
83
|
+
close() {
|
|
84
|
+
this.onClose.next();
|
|
85
|
+
}
|
|
86
|
+
isArray(error) {
|
|
87
|
+
return Array.isArray(error);
|
|
88
|
+
}
|
|
89
|
+
isErrorObject(error) {
|
|
90
|
+
return error instanceof Object || this.isArray(error);
|
|
91
|
+
}
|
|
92
|
+
getErrorAsString(error) {
|
|
93
|
+
return JSON.stringify(error, undefined, 2);
|
|
94
|
+
}
|
|
95
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: MessageBoxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
96
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.2", 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
|
+
}
|
|
98
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: MessageBoxComponent, decorators: [{
|
|
99
|
+
type: Component,
|
|
100
|
+
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"] }]
|
|
101
|
+
}], propDecorators: { type: [{
|
|
102
|
+
type: Input
|
|
103
|
+
}], title: [{
|
|
104
|
+
type: Input
|
|
105
|
+
}], message: [{
|
|
106
|
+
type: Input
|
|
107
|
+
}], compilerError: [{
|
|
108
|
+
type: Input
|
|
109
|
+
}], errors: [{
|
|
110
|
+
type: Input
|
|
111
|
+
}], onClose: [{
|
|
112
|
+
type: Output
|
|
112
113
|
}] } });
|
|
113
114
|
|
|
114
|
-
class MessagesModule {
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
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
|
-
}]
|
|
115
|
+
class MessagesModule {
|
|
116
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: MessagesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
117
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.2", ngImport: i0, type: MessagesModule, declarations: [MessageBoxComponent,
|
|
118
|
+
SnackBarComponent], imports: [CommonModule,
|
|
119
|
+
FormsModule,
|
|
120
|
+
ReactiveFormsModule,
|
|
121
|
+
MatButtonModule,
|
|
122
|
+
MatSnackBarModule], exports: [MessageBoxComponent,
|
|
123
|
+
SnackBarComponent] });
|
|
124
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: MessagesModule, providers: [MessagesService], imports: [CommonModule,
|
|
125
|
+
FormsModule,
|
|
126
|
+
ReactiveFormsModule,
|
|
127
|
+
MatButtonModule,
|
|
128
|
+
MatSnackBarModule] });
|
|
129
|
+
}
|
|
130
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: MessagesModule, decorators: [{
|
|
131
|
+
type: NgModule,
|
|
132
|
+
args: [{
|
|
133
|
+
imports: [
|
|
134
|
+
CommonModule,
|
|
135
|
+
FormsModule,
|
|
136
|
+
ReactiveFormsModule,
|
|
137
|
+
MatButtonModule,
|
|
138
|
+
MatSnackBarModule
|
|
139
|
+
],
|
|
140
|
+
declarations: [
|
|
141
|
+
MessageBoxComponent,
|
|
142
|
+
SnackBarComponent
|
|
143
|
+
],
|
|
144
|
+
exports: [
|
|
145
|
+
MessageBoxComponent,
|
|
146
|
+
SnackBarComponent
|
|
147
|
+
],
|
|
148
|
+
providers: [MessagesService]
|
|
149
|
+
}]
|
|
149
150
|
}] });
|
|
150
151
|
|
|
151
|
-
/**
|
|
152
|
-
* Generated bundle index. Do not edit.
|
|
152
|
+
/**
|
|
153
|
+
* Generated bundle index. Do not edit.
|
|
153
154
|
*/
|
|
154
155
|
|
|
155
156
|
export { MessageBoxComponent, MessagesModule, MessagesService, SnackBarComponent };
|
|
156
157
|
//# sourceMappingURL=apipass-messages.mjs.map
|
|
157
|
-
//# sourceMappingURL=apipass-messages.mjs.map
|
|
@@ -1 +1 @@
|
|
|
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,GAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,kBACP,kBAAkB,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,WAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAD5B,iBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,iBAAiB,iDCR9B,kHAEA,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,QAAA,EAAA,6GAAA,EAAA,MAAA,EAAA,CAAA,UAAA,EAAA,eAAA,EAAA,OAAA,CAAA,EAAA,QAAA,EAAA,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AAY;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;AAC7B,iBAAA,CAAA;;;AC1BD;;AAEG;;;;"}
|
|
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":";;;;;;;;;;;AAGA,MAKa,iBAAiB,CAAA;AACoB,IAAA,IAAA,CAAA;AACvC,IAAA,QAAA,CAAA;IADT,WAAgD,CAAA,IAAS,EAChD,QAAqB,EAAA;QADkB,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAK;QAChD,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAa;KAC7B;AAHU,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,kBACP,kBAAkB,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,WAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAD5B,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,iBAAiB,iDCR9B,kHAEA,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,QAAA,EAAA,6GAAA,EAAA,MAAA,EAAA,CAAA,UAAA,EAAA,eAAA,EAAA,OAAA,CAAA,EAAA,QAAA,EAAA,CAAA,WAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FDMa,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAL7B,SAAS;+BACE,WAAW,EAAA,QAAA,EAAA,kHAAA,EAAA,CAAA;;0BAKP,MAAM;2BAAC,kBAAkB,CAAA;;;AELzC,MACa,eAAe,CAAA;AACI,IAAA,SA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CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated bundle index. Do not edit.
|
|
3
|
-
*/
|
|
4
|
-
/// <amd-module name="@apipass/messages" />
|
|
5
|
-
export * from './public-api';
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
/// <amd-module name="@apipass/messages" />
|
|
5
|
+
export * from './public-api';
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { EventEmitter } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class MessageBoxComponent {
|
|
4
|
-
type: string;
|
|
5
|
-
title: string;
|
|
6
|
-
message: string;
|
|
7
|
-
compilerError: boolean;
|
|
8
|
-
errors: [];
|
|
9
|
-
onClose: EventEmitter<void>;
|
|
10
|
-
close(): void;
|
|
11
|
-
isArray(error: any): boolean;
|
|
12
|
-
isErrorObject(error: any): boolean;
|
|
13
|
-
getErrorAsString(error: any): string;
|
|
14
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MessageBoxComponent, never>;
|
|
15
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MessageBoxComponent, "message-box", never, { "type": "type"; "title": "title"; "message": "message"; "compilerError": "compilerError"; "errors": "errors"; }, { "onClose": "onClose"; }, never, never, false, never>;
|
|
16
|
-
}
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class MessageBoxComponent {
|
|
4
|
+
type: string;
|
|
5
|
+
title: string;
|
|
6
|
+
message: string;
|
|
7
|
+
compilerError: boolean;
|
|
8
|
+
errors: [];
|
|
9
|
+
onClose: EventEmitter<void>;
|
|
10
|
+
close(): void;
|
|
11
|
+
isArray(error: any): boolean;
|
|
12
|
+
isErrorObject(error: any): boolean;
|
|
13
|
+
getErrorAsString(error: any): string;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MessageBoxComponent, never>;
|
|
15
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MessageBoxComponent, "message-box", never, { "type": { "alias": "type"; "required": false; }; "title": { "alias": "title"; "required": false; }; "message": { "alias": "message"; "required": false; }; "compilerError": { "alias": "compilerError"; "required": false; }; "errors": { "alias": "errors"; "required": false; }; }, { "onClose": "onClose"; }, never, never, false, never>;
|
|
16
|
+
}
|
package/messages.module.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
import * as i1 from "./message-box/message-box.component";
|
|
3
|
-
import * as i2 from "./snack-bar/snack-bar.component";
|
|
4
|
-
import * as i3 from "@angular/common";
|
|
5
|
-
import * as i4 from "@angular/forms";
|
|
6
|
-
import * as i5 from "@angular/material/button";
|
|
7
|
-
import * as i6 from "@angular/material/snack-bar";
|
|
8
|
-
export declare class MessagesModule {
|
|
9
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MessagesModule, never>;
|
|
10
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<MessagesModule, [typeof i1.MessageBoxComponent, typeof i2.SnackBarComponent], [typeof i3.CommonModule, typeof i4.FormsModule, typeof i4.ReactiveFormsModule, typeof i5.MatButtonModule, typeof i6.MatSnackBarModule], [typeof i1.MessageBoxComponent, typeof i2.SnackBarComponent]>;
|
|
11
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<MessagesModule>;
|
|
12
|
-
}
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./message-box/message-box.component";
|
|
3
|
+
import * as i2 from "./snack-bar/snack-bar.component";
|
|
4
|
+
import * as i3 from "@angular/common";
|
|
5
|
+
import * as i4 from "@angular/forms";
|
|
6
|
+
import * as i5 from "@angular/material/button";
|
|
7
|
+
import * as i6 from "@angular/material/snack-bar";
|
|
8
|
+
export declare class MessagesModule {
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MessagesModule, never>;
|
|
10
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<MessagesModule, [typeof i1.MessageBoxComponent, typeof i2.SnackBarComponent], [typeof i3.CommonModule, typeof i4.FormsModule, typeof i4.ReactiveFormsModule, typeof i5.MatButtonModule, typeof i6.MatSnackBarModule], [typeof i1.MessageBoxComponent, typeof i2.SnackBarComponent]>;
|
|
11
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<MessagesModule>;
|
|
12
|
+
}
|
package/messages.service.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { MatSnackBar, MatSnackBarHorizontalPosition, MatSnackBarVerticalPosition } from '@angular/material/snack-bar';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class MessagesService {
|
|
4
|
-
private readonly _snackBar;
|
|
5
|
-
constructor(_snackBar: MatSnackBar);
|
|
6
|
-
successMessage(title: string, body?: string, horizontalPosition?: MatSnackBarHorizontalPosition, verticalPosition?: MatSnackBarVerticalPosition, timeout?: number): void;
|
|
7
|
-
errorMessage(title: string, body: string, horizontalPosition?: MatSnackBarHorizontalPosition, verticalPosition?: MatSnackBarVerticalPosition, timeout?: number): void;
|
|
8
|
-
warnMessage(title: string, body: string, horizontalPosition?: MatSnackBarHorizontalPosition, verticalPosition?: MatSnackBarVerticalPosition, timeout?: number): void;
|
|
9
|
-
message(type: string, title: string, body: string, horizontalPosition?: MatSnackBarHorizontalPosition, verticalPosition?: MatSnackBarVerticalPosition, timeout?: number): void;
|
|
10
|
-
getErrorMessage(statusCode: number, message: any): string;
|
|
11
|
-
customMessage(type: string, title: string, body: string, horizontalPosition?: MatSnackBarHorizontalPosition, verticalPosition?: MatSnackBarVerticalPosition, timeout?: number): void;
|
|
12
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MessagesService, never>;
|
|
13
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<MessagesService>;
|
|
14
|
-
}
|
|
1
|
+
import { MatSnackBar, MatSnackBarHorizontalPosition, MatSnackBarVerticalPosition } from '@angular/material/snack-bar';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class MessagesService {
|
|
4
|
+
private readonly _snackBar;
|
|
5
|
+
constructor(_snackBar: MatSnackBar);
|
|
6
|
+
successMessage(title: string, body?: string, horizontalPosition?: MatSnackBarHorizontalPosition, verticalPosition?: MatSnackBarVerticalPosition, timeout?: number): void;
|
|
7
|
+
errorMessage(title: string, body: string, horizontalPosition?: MatSnackBarHorizontalPosition, verticalPosition?: MatSnackBarVerticalPosition, timeout?: number): void;
|
|
8
|
+
warnMessage(title: string, body: string, horizontalPosition?: MatSnackBarHorizontalPosition, verticalPosition?: MatSnackBarVerticalPosition, timeout?: number): void;
|
|
9
|
+
message(type: string, title: string, body: string, horizontalPosition?: MatSnackBarHorizontalPosition, verticalPosition?: MatSnackBarVerticalPosition, timeout?: number): void;
|
|
10
|
+
getErrorMessage(statusCode: number, message: any): string;
|
|
11
|
+
customMessage(type: string, title: string, body: string, horizontalPosition?: MatSnackBarHorizontalPosition, verticalPosition?: MatSnackBarVerticalPosition, timeout?: number): void;
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MessagesService, never>;
|
|
13
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MessagesService>;
|
|
14
|
+
}
|
package/package.json
CHANGED
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apipass/messages",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@angular/animations": "
|
|
6
|
-
"@angular/cdk": "
|
|
7
|
-
"@angular/common": "
|
|
8
|
-
"@angular/core": "
|
|
9
|
-
"@angular/forms": "
|
|
10
|
-
"@angular/material": "
|
|
5
|
+
"@angular/animations": "16.0.2",
|
|
6
|
+
"@angular/cdk": "16.0.1",
|
|
7
|
+
"@angular/common": "16.0.2",
|
|
8
|
+
"@angular/core": "16.0.2",
|
|
9
|
+
"@angular/forms": "16.0.2",
|
|
10
|
+
"@angular/material": "16.0.1"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@ngx-translate/core": "
|
|
14
|
-
"tslib": "2.
|
|
13
|
+
"@ngx-translate/core": "15.0.0",
|
|
14
|
+
"tslib": "2.5.2"
|
|
15
15
|
},
|
|
16
|
-
"module": "
|
|
17
|
-
"es2020": "fesm2020/apipass-messages.mjs",
|
|
18
|
-
"esm2020": "esm2020/apipass-messages.mjs",
|
|
19
|
-
"fesm2020": "fesm2020/apipass-messages.mjs",
|
|
20
|
-
"fesm2015": "fesm2015/apipass-messages.mjs",
|
|
16
|
+
"module": "fesm2022/apipass-messages.mjs",
|
|
21
17
|
"typings": "index.d.ts",
|
|
22
18
|
"exports": {
|
|
23
19
|
"./package.json": {
|
|
@@ -25,11 +21,9 @@
|
|
|
25
21
|
},
|
|
26
22
|
".": {
|
|
27
23
|
"types": "./index.d.ts",
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"node": "./fesm2015/apipass-messages.mjs",
|
|
32
|
-
"default": "./fesm2020/apipass-messages.mjs"
|
|
24
|
+
"esm2022": "./esm2022/apipass-messages.mjs",
|
|
25
|
+
"esm": "./esm2022/apipass-messages.mjs",
|
|
26
|
+
"default": "./fesm2022/apipass-messages.mjs"
|
|
33
27
|
}
|
|
34
28
|
},
|
|
35
29
|
"sideEffects": false
|
package/public-api.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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';
|
|
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';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class SnackBarComponent {
|
|
4
|
-
data: any;
|
|
5
|
-
snackBar: MatSnackBar;
|
|
6
|
-
constructor(data: any, snackBar: MatSnackBar);
|
|
7
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<SnackBarComponent, never>;
|
|
8
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SnackBarComponent, "snack-bar", never, {}, {}, never, never, false, never>;
|
|
9
|
-
}
|
|
1
|
+
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class SnackBarComponent {
|
|
4
|
+
data: any;
|
|
5
|
+
snackBar: MatSnackBar;
|
|
6
|
+
constructor(data: any, snackBar: MatSnackBar);
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnackBarComponent, never>;
|
|
8
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SnackBarComponent, "snack-bar", never, {}, {}, never, never, false, never>;
|
|
9
|
+
}
|
|
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVzc2FnZS1ib3guY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcHJvamVjdHMvbWVzc2FnZXMvc3JjL21lc3NhZ2UtYm94L21lc3NhZ2UtYm94LmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uL3Byb2plY3RzL21lc3NhZ2VzL3NyYy9tZXNzYWdlLWJveC9tZXNzYWdlLWJveC5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSxFQUFFLE1BQU0sZUFBZSxDQUFBOzs7QUFPdEUsTUFBTSxPQUFPLG1CQUFtQjtJQUxoQztRQU1rQixTQUFJLEdBQUcsY0FBYyxDQUFBO1FBQ3JCLFVBQUssR0FBRyxFQUFFLENBQUE7UUFDVixZQUFPLEdBQUcsRUFBRSxDQUFBO1FBQ1osa0JBQWEsR0FBRyxLQUFLLENBQUE7UUFDckIsV0FBTSxHQUFPLEVBQUUsQ0FBQTtRQUVkLFlBQU8sR0FBRyxJQUFJLFlBQVksRUFBUSxDQUFBO0tBaUJwRDtJQWZRLEtBQUs7UUFDVixJQUFJLENBQUMsT0FBTyxDQUFDLElBQUksRUFBRSxDQUFBO0lBQ3JCLENBQUM7SUFFTSxPQUFPLENBQUUsS0FBVTtRQUN4QixPQUFPLEtBQUssQ0FBQyxPQUFPLENBQUMsS0FBSyxDQUFDLENBQUE7SUFDN0IsQ0FBQztJQUVNLGFBQWEs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clxuIl19
|
|
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVzc2FnZXMubW9kdWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vcHJvamVjdHMvbWVzc2FnZXMvc3JjL21lc3NhZ2VzLm1vZHVsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0sZUFBZSxDQUFBO0FBQ3hDLE9BQU8sRUFBRSxXQUFXLEVBQUUsbUJBQW1CLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQTtBQUNqRSxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0saUJBQWlCLENBQUE7QUFDOUMsT0FBTyxFQUFFLG1CQUFtQixFQUFFLE1BQU0scUNBQXFDLENBQUE7QUFDekUsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLG9CQUFvQixDQUFBO0FBQ3BELE9BQU8sRUFBRSxpQkFBaUIsRUFBRSxNQUFNLGlDQUFpQyxDQUFBO0FBQ25FLE9BQU8sRUFBRSxlQUFlLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQTtBQUMxRCxPQUFPLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQTs7QUFvQi9ELE1BQU0sT0FBTyxjQUFjOzsyR0FBZCxjQUFjOzRHQUFkLGNBQWMsaUJBVHZCL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0gZnJvbSAnLi9zbmFjay1iYXIvc25hY2stYmFyLmNvbXBvbmVudCdcclxuaW1wb3J0IHsgTWF0QnV0dG9uTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvbWF0ZXJpYWwvYnV0dG9uJ1xyXG5pbXBvcnQgeyBNYXRTbmFja0Jhck1vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL21hdGVyaWFsL3NuYWNrLWJhcidcclxuXHJcbkBOZ01vZHVsZSh7XHJcbiAgaW1wb3J0czogW1xyXG4gICAgQ29tbW9uTW9kdWxlLFxyXG4gICAgRm9ybXNNb2R1bGUsXHJcbiAgICBSZWFjdGl2ZUZvcm1zTW9kdWxlLFxyXG4gICAgTWF0QnV0dG9uTW9kdWxlLFxyXG4gICAgTWF0U25hY2tCYXJNb2R1bGVcclxuICBdLFxyXG4gIGRlY2xhcmF0aW9uczogW1xyXG4gICAgTWVzc2FnZUJveENvbXBvbmVudCxcclxuICAgIFNuYWNrQmFyQ29tcG9uZW50XHJcbiAgXSxcclxuICBleHBvcnRzOiBbXHJcbiAgICBNZXNzYWdlQm94Q29tcG9uZW50LFxyXG4gICAgU25hY2tCYXJDb21wb25lbnRcclxuICBdLFxyXG4gIHByb3ZpZGVyczogW01lc3NhZ2VzU2VydmljZV1cclxufSlcclxuZXhwb3J0IGNsYXNzIE1lc3NhZ2VzTW9kdWxlIHt9XHJcbiJdfQ==
|
|
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic25hY2stYmFyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL21lc3NhZ2VzL3NyYy9zbmFjay1iYXIvc25hY2stYmFyLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uL3Byb2plY3RzL21lc3NhZ2VzL3NyYy9zbmFjay1iYXIvc25hY2stYmFyLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXS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aXYgW2lubmVySFRNTF09XCJkYXRhLmh0bWxcIj48L2Rpdj5cclxuPGJ1dHRvbiBtYXQtcmFpc2VkLWJ1dHRvbiAoY2xpY2spPVwic25hY2tCYXIuZGlzbWlzcygpXCI+eDwvYnV0dG9uPlxyXG4iXX0=
|
|
@@ -1,159 +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 () {
|
|
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,QAAA,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAK;AAChD,QAAA,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAa;KAC7B;;AAHU,iBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,kBACP,kBAAkB,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,WAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAD5B,iBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,iBAAiB,iDCR9B,kHAEA,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,QAAA,EAAA,6GAAA,EAAA,MAAA,EAAA,CAAA,UAAA,EAAA,eAAA,EAAA,OAAA,CAAA,EAAA,QAAA,EAAA,CAAA,WAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;2FDMa,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAL7B,SAAS;+BACE,WAAW,EAAA,QAAA,EAAA,kHAAA,EAAA,CAAA;;;8BAKP,MAAM;+BAAC,kBAAkB,CAAA;;;;MEJ5B,eAAe,CAAA;AAC1B,IAAA,WA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