@apipass/messages 0.2.16 → 1.0.0

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.
Files changed (35) hide show
  1. package/README.md +33 -33
  2. package/assets/css/buttons.scss +118 -118
  3. package/assets/css/colors.scss +34 -34
  4. package/assets/css/fonts.scss +24 -24
  5. package/assets/css/inputs.scss +197 -197
  6. package/assets/css/pt_sans.scss +143 -143
  7. package/assets/css/spacing.scss +28 -28
  8. package/assets/css/texts.scss +18 -18
  9. package/{esm2015/apipass-messages.js → esm2020/apipass-messages.mjs} +4 -4
  10. package/esm2020/message-box/message-box.component.mjs +44 -0
  11. package/esm2020/messages.module.mjs +42 -0
  12. package/esm2020/messages.service.mjs +50 -0
  13. package/esm2020/public-api.mjs +6 -0
  14. package/esm2020/snack-bar/snack-bar.component.mjs +21 -0
  15. package/fesm2015/apipass-messages.mjs +155 -0
  16. package/fesm2015/apipass-messages.mjs.map +1 -0
  17. package/fesm2020/apipass-messages.mjs +153 -0
  18. package/fesm2020/apipass-messages.mjs.map +1 -0
  19. package/{apipass-messages.d.ts → index.d.ts} +5 -5
  20. package/message-box/message-box.component.d.ts +16 -16
  21. package/messages.module.d.ts +11 -9
  22. package/messages.service.d.ts +14 -12
  23. package/package.json +29 -19
  24. package/public-api.d.ts +5 -4
  25. package/snack-bar/snack-bar.component.d.ts +9 -0
  26. package/bundles/apipass-messages.umd.js +0 -280
  27. package/bundles/apipass-messages.umd.js.map +0 -1
  28. package/bundles/apipass-messages.umd.min.js +0 -2
  29. package/bundles/apipass-messages.umd.min.js.map +0 -1
  30. package/esm2015/message-box/message-box.component.js +0 -145
  31. package/esm2015/messages.module.js +0 -39
  32. package/esm2015/messages.service.js +0 -44
  33. package/esm2015/public-api.js +0 -5
  34. package/fesm2015/apipass-messages.js +0 -226
  35. package/fesm2015/apipass-messages.js.map +0 -1
@@ -1,280 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('angular2-toaster'), require('@angular/core'), require('@angular/forms'), require('@angular/common')) :
3
- typeof define === 'function' && define.amd ? define('@apipass/messages', ['exports', 'angular2-toaster', '@angular/core', '@angular/forms', '@angular/common'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.apipass = global.apipass || {}, global.apipass.messages = {}), global.i1, global.ng.core, global.ng.forms, global.ng.common));
5
- }(this, (function (exports, i1, i0, forms, i1$1) { 'use strict';
6
-
7
- var MessagesService = /** @class */ (function () {
8
- function MessagesService(toasterService) {
9
- this.toasterService = toasterService;
10
- }
11
- MessagesService.prototype.successMessage = function (title, body, positionClass) {
12
- this.customMessage('success', title, body || '', positionClass);
13
- };
14
- MessagesService.prototype.message = function (title, body, positionClass) {
15
- this.customMessage('error', title, body, positionClass);
16
- };
17
- MessagesService.prototype.getErrorMessage = function (statusCode, message) {
18
- var codeMessage;
19
- if (message instanceof Object) {
20
- codeMessage = message.status || statusCode;
21
- if (message.message) {
22
- codeMessage += ' - ' + message.message;
23
- }
24
- return codeMessage;
25
- }
26
- return statusCode + " - " + message;
27
- };
28
- MessagesService.prototype.customMessage = function (type, title, body, positionClass) {
29
- var message = {
30
- type: type,
31
- title: title,
32
- timeout: 30000,
33
- body: body,
34
- bodyOutputType: i1.BodyOutputType.TrustedHtml
35
- };
36
- var toastContainer = document.getElementById('toast-container');
37
- toastContainer.className = positionClass || 'toast-top-right';
38
- this.toasterService.pop(message);
39
- };
40
- return MessagesService;
41
- }());
42
- MessagesService.ɵfac = function MessagesService_Factory(t) { return new (t || MessagesService)(i0.ɵɵinject(i1.ToasterService)); };
43
- MessagesService.ɵprov = i0.ɵɵdefineInjectable({ token: MessagesService, factory: MessagesService.ɵfac });
44
- /*@__PURE__*/ (function () {
45
- i0.ɵsetClassMetadata(MessagesService, [{
46
- type: i0.Injectable
47
- }], function () { return [{ type: i1.ToasterService }]; }, null);
48
- })();
49
-
50
- function MessageBoxComponent_div_0_strong_3_Template(rf, ctx) {
51
- if (rf & 1) {
52
- i0.ɵɵelementStart(0, "strong", 9);
53
- i0.ɵɵtext(1);
54
- i0.ɵɵelementEnd();
55
- }
56
- if (rf & 2) {
57
- var ctx_r1 = i0.ɵɵnextContext(2);
58
- i0.ɵɵadvance(1);
59
- i0.ɵɵtextInterpolate(ctx_r1.title);
60
- }
61
- }
62
- function MessageBoxComponent_div_0_span_4_Template(rf, ctx) {
63
- if (rf & 1) {
64
- i0.ɵɵelementStart(0, "span", 10);
65
- i0.ɵɵtext(1);
66
- i0.ɵɵelementEnd();
67
- }
68
- if (rf & 2) {
69
- var ctx_r2 = i0.ɵɵnextContext(2);
70
- i0.ɵɵadvance(1);
71
- i0.ɵɵtextInterpolate(ctx_r2.message);
72
- }
73
- }
74
- function MessageBoxComponent_div_0_div_5_span_1_span_1_Template(rf, ctx) {
75
- if (rf & 1) {
76
- i0.ɵɵelement(0, "span", 17);
77
- }
78
- if (rf & 2) {
79
- var item_r9 = ctx.$implicit;
80
- i0.ɵɵproperty("innerHTML", item_r9.message, i0.ɵɵsanitizeHtml);
81
- }
82
- }
83
- function MessageBoxComponent_div_0_div_5_span_1_Template(rf, ctx) {
84
- if (rf & 1) {
85
- i0.ɵɵelementStart(0, "span", 15);
86
- i0.ɵɵtemplate(1, MessageBoxComponent_div_0_div_5_span_1_span_1_Template, 1, 1, "span", 16);
87
- i0.ɵɵelementEnd();
88
- }
89
- if (rf & 2) {
90
- var error_r4 = i0.ɵɵnextContext().$implicit;
91
- i0.ɵɵadvance(1);
92
- i0.ɵɵproperty("ngForOf", error_r4);
93
- }
94
- }
95
- function MessageBoxComponent_div_0_div_5_span_2_Template(rf, ctx) {
96
- if (rf & 1) {
97
- i0.ɵɵelement(0, "span", 17);
98
- }
99
- if (rf & 2) {
100
- var error_r4 = i0.ɵɵnextContext().$implicit;
101
- i0.ɵɵproperty("innerHTML", error_r4, i0.ɵɵsanitizeHtml);
102
- }
103
- }
104
- function MessageBoxComponent_div_0_div_5_pre_3_Template(rf, ctx) {
105
- if (rf & 1) {
106
- i0.ɵɵelementStart(0, "pre");
107
- i0.ɵɵtext(1);
108
- i0.ɵɵelementEnd();
109
- }
110
- if (rf & 2) {
111
- var error_r4 = i0.ɵɵnextContext().$implicit;
112
- var ctx_r7 = i0.ɵɵnextContext(2);
113
- i0.ɵɵadvance(1);
114
- i0.ɵɵtextInterpolate1(" ", ctx_r7.getErrorAsString(error_r4), "\n ");
115
- }
116
- }
117
- function MessageBoxComponent_div_0_div_5_Template(rf, ctx) {
118
- if (rf & 1) {
119
- i0.ɵɵelementStart(0, "div", 11);
120
- i0.ɵɵtemplate(1, MessageBoxComponent_div_0_div_5_span_1_Template, 2, 1, "span", 12);
121
- i0.ɵɵtemplate(2, MessageBoxComponent_div_0_div_5_span_2_Template, 1, 1, "span", 13);
122
- i0.ɵɵtemplate(3, MessageBoxComponent_div_0_div_5_pre_3_Template, 2, 1, "pre", 14);
123
- i0.ɵɵelementEnd();
124
- }
125
- if (rf & 2) {
126
- var error_r4 = ctx.$implicit;
127
- var ctx_r3 = i0.ɵɵnextContext(2);
128
- i0.ɵɵadvance(1);
129
- i0.ɵɵproperty("ngIf", ctx_r3.compilerError && ctx_r3.isArray(error_r4));
130
- i0.ɵɵadvance(1);
131
- i0.ɵɵproperty("ngIf", (!ctx_r3.compilerError || ctx_r3.compilerError && !ctx_r3.isArray(error_r4)) && !ctx_r3.isErrorObject(error_r4));
132
- i0.ɵɵadvance(1);
133
- i0.ɵɵproperty("ngIf", !ctx_r3.compilerError && ctx_r3.isErrorObject(error_r4));
134
- }
135
- }
136
- function MessageBoxComponent_div_0_Template(rf, ctx) {
137
- if (rf & 1) {
138
- var _r14_1 = i0.ɵɵgetCurrentView();
139
- i0.ɵɵelementStart(0, "div", 1);
140
- i0.ɵɵelementStart(1, "div", 2);
141
- i0.ɵɵelementStart(2, "div", 3);
142
- i0.ɵɵtemplate(3, MessageBoxComponent_div_0_strong_3_Template, 2, 1, "strong", 4);
143
- i0.ɵɵtemplate(4, MessageBoxComponent_div_0_span_4_Template, 2, 1, "span", 5);
144
- i0.ɵɵtemplate(5, MessageBoxComponent_div_0_div_5_Template, 4, 3, "div", 6);
145
- i0.ɵɵelementStart(6, "button", 7);
146
- i0.ɵɵlistener("click", function MessageBoxComponent_div_0_Template_button_click_6_listener() { i0.ɵɵrestoreView(_r14_1); var ctx_r13 = i0.ɵɵnextContext(); return ctx_r13.close(); });
147
- i0.ɵɵelementStart(7, "span", 8);
148
- i0.ɵɵtext(8, "\u00D7");
149
- i0.ɵɵelementEnd();
150
- i0.ɵɵelementEnd();
151
- i0.ɵɵelementEnd();
152
- i0.ɵɵelementEnd();
153
- i0.ɵɵelementEnd();
154
- }
155
- if (rf & 2) {
156
- var ctx_r0 = i0.ɵɵnextContext();
157
- i0.ɵɵadvance(2);
158
- i0.ɵɵclassMapInterpolate1("alert ", ctx_r0.type, " alert-dismissible fade show");
159
- i0.ɵɵadvance(1);
160
- i0.ɵɵproperty("ngIf", ctx_r0.title);
161
- i0.ɵɵadvance(1);
162
- i0.ɵɵproperty("ngIf", ctx_r0.message);
163
- i0.ɵɵadvance(1);
164
- i0.ɵɵproperty("ngForOf", ctx_r0.errors);
165
- }
166
- }
167
- var MessageBoxComponent = /** @class */ (function () {
168
- function MessageBoxComponent() {
169
- this.type = 'alert-danger';
170
- this.title = '';
171
- this.message = '';
172
- this.compilerError = false;
173
- this.errors = [];
174
- this.onClose = new i0.EventEmitter();
175
- }
176
- MessageBoxComponent.prototype.close = function () {
177
- this.onClose.next();
178
- };
179
- MessageBoxComponent.prototype.isArray = function (error) {
180
- return Array.isArray(error);
181
- };
182
- MessageBoxComponent.prototype.isErrorObject = function (error) {
183
- return error instanceof Object || this.isArray(error);
184
- };
185
- MessageBoxComponent.prototype.getErrorAsString = function (error) {
186
- return JSON.stringify(error, undefined, 2);
187
- };
188
- return MessageBoxComponent;
189
- }());
190
- MessageBoxComponent.ɵfac = function MessageBoxComponent_Factory(t) { return new (t || MessageBoxComponent)(); };
191
- MessageBoxComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MessageBoxComponent, selectors: [["message-box"]], inputs: { type: "type", title: "title", message: "message", compilerError: "compilerError", errors: "errors" }, outputs: { onClose: "onClose" }, decls: 1, vars: 1, consts: [["class", "error-box row", 4, "ngIf"], [1, "error-box", "row"], [1, "col-12"], ["role", "alert"], ["class", "title", 4, "ngIf"], ["class", "detail-message", 4, "ngIf"], ["class", "alert-text", 4, "ngFor", "ngForOf"], ["type", "button", "aria-label", "Close", 1, "close", 3, "click"], ["aria-hidden", "true"], [1, "title"], [1, "detail-message"], [1, "alert-text"], ["class", "causes", 4, "ngIf"], ["class", "error-text", 3, "innerHTML", 4, "ngIf"], [4, "ngIf"], [1, "causes"], ["class", "error-text", 3, "innerHTML", 4, "ngFor", "ngForOf"], [1, "error-text", 3, "innerHTML"]], template: function MessageBoxComponent_Template(rf, ctx) {
192
- if (rf & 1) {
193
- i0.ɵɵtemplate(0, MessageBoxComponent_div_0_Template, 9, 6, "div", 0);
194
- }
195
- if (rf & 2) {
196
- i0.ɵɵproperty("ngIf", ctx.errors.length > 0);
197
- }
198
- }, directives: [i1$1.NgIf, i1$1.NgForOf], styles: [".error-box[_ngcontent-%COMP%]{background:#f5caca;border:1px solid #8b4646;border-radius:5px;color:#8b4646;position:relative;width:100%}.error-box[_ngcontent-%COMP%] .alert[_ngcontent-%COMP%]{padding:10px 15px!important}.error-box[_ngcontent-%COMP%] .alert[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{background:none;border:none;color:#8b4646;cursor:pointer;font-size:20px;position:absolute;right:2px;top:2px}.error-box[_ngcontent-%COMP%] .alert[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{margin-right:5px;word-break:break-word}.error-box[_ngcontent-%COMP%] .causes[_ngcontent-%COMP%]{word-break:break-word}"] });
199
- /*@__PURE__*/ (function () {
200
- i0.ɵsetClassMetadata(MessageBoxComponent, [{
201
- type: i0.Component,
202
- args: [{
203
- selector: 'message-box',
204
- templateUrl: 'message-box.component.html',
205
- styleUrls: ['message-box.component.scss']
206
- }]
207
- }], null, { type: [{
208
- type: i0.Input
209
- }], title: [{
210
- type: i0.Input
211
- }], message: [{
212
- type: i0.Input
213
- }], compilerError: [{
214
- type: i0.Input
215
- }], errors: [{
216
- type: i0.Input
217
- }], onClose: [{
218
- type: i0.Output
219
- }] });
220
- })();
221
-
222
- var MessagesModule = /** @class */ (function () {
223
- function MessagesModule() {
224
- }
225
- return MessagesModule;
226
- }());
227
- MessagesModule.ɵmod = i0.ɵɵdefineNgModule({ type: MessagesModule });
228
- MessagesModule.ɵinj = i0.ɵɵdefineInjector({ factory: function MessagesModule_Factory(t) { return new (t || MessagesModule)(); }, providers: [MessagesService], imports: [[
229
- i1$1.CommonModule,
230
- forms.FormsModule,
231
- forms.ReactiveFormsModule,
232
- i1.ToasterModule
233
- ]] });
234
- (function () {
235
- (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(MessagesModule, { declarations: [MessageBoxComponent], imports: [i1$1.CommonModule,
236
- forms.FormsModule,
237
- forms.ReactiveFormsModule,
238
- i1.ToasterModule], exports: [MessageBoxComponent] });
239
- })();
240
- /*@__PURE__*/ (function () {
241
- i0.ɵsetClassMetadata(MessagesModule, [{
242
- type: i0.NgModule,
243
- args: [{
244
- imports: [
245
- i1$1.CommonModule,
246
- forms.FormsModule,
247
- forms.ReactiveFormsModule,
248
- i1.ToasterModule
249
- ],
250
- declarations: [
251
- MessageBoxComponent
252
- ],
253
- exports: [
254
- MessageBoxComponent
255
- ],
256
- providers: [MessagesService]
257
- }]
258
- }], null, null);
259
- })();
260
-
261
- /**
262
- * Generated bundle index. Do not edit.
263
- */
264
-
265
- Object.keys(i1).forEach(function (k) {
266
- if (k !== 'default') Object.defineProperty(exports, k, {
267
- enumerable: true,
268
- get: function () {
269
- return i1[k];
270
- }
271
- });
272
- });
273
- exports.MessageBoxComponent = MessageBoxComponent;
274
- exports.MessagesModule = MessagesModule;
275
- exports.MessagesService = MessagesService;
276
-
277
- Object.defineProperty(exports, '__esModule', { value: true });
278
-
279
- })));
280
- //# sourceMappingURL=apipass-messages.umd.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"apipass-messages.umd.js","sources":["../../../projects/messages/src/messages.service.ts","../../../projects/messages/src/message-box/message-box.component.html","../../../projects/messages/src/message-box/message-box.component.ts","../../../projects/messages/src/messages.module.ts","../../../projects/messages/src/apipass-messages.ts"],"sourcesContent":["import {Injectable} from '@angular/core';\nimport {BodyOutputType, Toast, ToasterService} from 'angular2-toaster';\n\n@Injectable()\nexport class MessagesService {\n\n private toasterService: ToasterService;\n\n constructor(toasterService: ToasterService) {\n this.toasterService = toasterService;\n }\n\n public successMessage(title: string, body?: string, positionClass?: string): void {\n this.customMessage('success', title, body || '', positionClass);\n }\n\n public message(title: string, body: string, positionClass?: string): void {\n this.customMessage('error', title, body, positionClass);\n }\n\n public getErrorMessage(statusCode: number, message: any): string {\n let codeMessage;\n if (message instanceof Object) {\n codeMessage = message.status || statusCode;\n if (message.message) {\n codeMessage += ' - ' + message.message;\n }\n return codeMessage;\n }\n return `${statusCode} - ${message}`;\n }\n\n public customMessage(type: string, title: string, body: string, positionClass?: any): void {\n const message: Toast = {\n type,\n title,\n timeout: 30000,\n body,\n bodyOutputType: BodyOutputType.TrustedHtml\n };\n const toastContainer: any = document.getElementById('toast-container');\n toastContainer.className = positionClass || 'toast-top-right';\n this.toasterService.pop(message);\n }\n}\n","<div class=\"error-box row\" *ngIf=\"errors.length > 0\">\n <div class=\"col-12\">\n <div class=\"alert {{type}} alert-dismissible fade show\" role=\"alert\">\n <strong class=\"title\" *ngIf=\"title\">{{title}}</strong>\n <span class=\"detail-message\" *ngIf=\"message\">{{message}}</span>\n <div class=\"alert-text\" *ngFor=\"let error of errors\">\n <span class=\"causes\" *ngIf=\"compilerError && isArray(error)\">\n <span class=\"error-text\" *ngFor=\"let item of error\" [innerHTML]=\"item.message\"></span>\n </span>\n\n <span class=\"error-text\"\n *ngIf=\"(!compilerError || (compilerError && !isArray(error))) && !isErrorObject(error)\" [innerHTML]=\"error\"></span>\n <pre *ngIf=\"!compilerError && isErrorObject(error)\">\n {{getErrorAsString(error)}}\n </pre>\n </div>\n <button type=\"button\" class=\"close\" (click)=\"close()\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n </div>\n </div>\n</div>\n","import { Component, Input, EventEmitter, Output } from '@angular/core';\n\n@Component({\n selector: 'message-box',\n templateUrl: 'message-box.component.html',\n styleUrls: ['message-box.component.scss']\n})\nexport class MessageBoxComponent {\n\n @Input() public type = 'alert-danger';\n @Input() public title = '';\n @Input() public message = '';\n @Input() public compilerError = false;\n @Input() public errors: [] = [];\n\n @Output() public onClose = new EventEmitter<void>();\n\n public close(): void {\n this.onClose.next();\n }\n\n public isArray(error: any): boolean {\n return Array.isArray(error);\n }\n\n public isErrorObject(error: any): boolean {\n return error instanceof Object || this.isArray(error);\n }\n\n public getErrorAsString(error: any): string {\n return JSON.stringify(error, undefined, 2);\n }\n\n}\n","import {NgModule} from '@angular/core';\nimport {FormsModule, ReactiveFormsModule} from '@angular/forms';\nimport {CommonModule} from '@angular/common';\nimport {MessageBoxComponent} from './message-box/message-box.component';\nimport {MessagesService} from './messages.service';\nimport {ToasterModule} from 'angular2-toaster';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n ToasterModule\n ],\n declarations: [\n MessageBoxComponent\n ],\n exports: [\n MessageBoxComponent\n ],\n providers: [MessagesService]\n})\nexport class MessagesModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["BodyOutputType","Injectable","i0.ɵɵelementStart","i0.ɵɵtext","i0.ɵɵelementEnd","i0.ɵɵadvance","i0.ɵɵtextInterpolate","i0.ɵɵelement","i0.ɵɵproperty","i0.ɵɵtemplate","i0.ɵɵtextInterpolate1","i0.ɵɵlistener","i0.ɵɵclassMapInterpolate1","EventEmitter","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;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,2 +0,0 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("angular2-toaster"),require("@angular/core"),require("@angular/forms"),require("@angular/common")):"function"==typeof define&&define.amd?define("@apipass/messages",["exports","angular2-toaster","@angular/core","@angular/forms","@angular/common"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).apipass=e.apipass||{},e.apipass.messages={}),e.i1,e.ng.core,e.ng.forms,e.ng.common)}(this,(function(e,t,r,n,o){"use strict";var s=function(){function e(e){this.toasterService=e}return e.prototype.successMessage=function(e,t,r){this.customMessage("success",e,t||"",r)},e.prototype.message=function(e,t,r){this.customMessage("error",e,t,r)},e.prototype.getErrorMessage=function(e,t){var r;return t instanceof Object?(r=t.status||e,t.message&&(r+=" - "+t.message),r):e+" - "+t},e.prototype.customMessage=function(e,r,n,o){var s={type:e,title:r,timeout:3e4,body:n,bodyOutputType:t.BodyOutputType.TrustedHtml};document.getElementById("toast-container").className=o||"toast-top-right",this.toasterService.pop(s)},e}();function a(e,t){if(1&e&&(r.ɵɵelementStart(0,"strong",9),r.ɵɵtext(1),r.ɵɵelementEnd()),2&e){var n=r.ɵɵnextContext(2);r.ɵɵadvance(1),r.ɵɵtextInterpolate(n.title)}}function i(e,t){if(1&e&&(r.ɵɵelementStart(0,"span",10),r.ɵɵtext(1),r.ɵɵelementEnd()),2&e){var n=r.ɵɵnextContext(2);r.ɵɵadvance(1),r.ɵɵtextInterpolate(n.message)}}function c(e,t){if(1&e&&r.ɵɵelement(0,"span",17),2&e){var n=t.$implicit;r.ɵɵproperty("innerHTML",n.message,r.ɵɵsanitizeHtml)}}function l(e,t){if(1&e&&(r.ɵɵelementStart(0,"span",15),r.ɵɵtemplate(1,c,1,1,"span",16),r.ɵɵelementEnd()),2&e){var n=r.ɵɵnextContext().$implicit;r.ɵɵadvance(1),r.ɵɵproperty("ngForOf",n)}}function p(e,t){if(1&e&&r.ɵɵelement(0,"span",17),2&e){var n=r.ɵɵnextContext().$implicit;r.ɵɵproperty("innerHTML",n,r.ɵɵsanitizeHtml)}}function u(e,t){if(1&e&&(r.ɵɵelementStart(0,"pre"),r.ɵɵtext(1),r.ɵɵelementEnd()),2&e){var n=r.ɵɵnextContext().$implicit,o=r.ɵɵnextContext(2);r.ɵɵadvance(1),r.ɵɵtextInterpolate1(" ",o.getErrorAsString(n),"\n ")}}function m(e,t){if(1&e&&(r.ɵɵelementStart(0,"div",11),r.ɵɵtemplate(1,l,2,1,"span",12),r.ɵɵtemplate(2,p,1,1,"span",13),r.ɵɵtemplate(3,u,2,1,"pre",14),r.ɵɵelementEnd()),2&e){var n=t.$implicit,o=r.ɵɵnextContext(2);r.ɵɵadvance(1),r.ɵɵproperty("ngIf",o.compilerError&&o.isArray(n)),r.ɵɵadvance(1),r.ɵɵproperty("ngIf",(!o.compilerError||o.compilerError&&!o.isArray(n))&&!o.isErrorObject(n)),r.ɵɵadvance(1),r.ɵɵproperty("ngIf",!o.compilerError&&o.isErrorObject(n))}}function d(e,t){if(1&e){var n=r.ɵɵgetCurrentView();r.ɵɵelementStart(0,"div",1),r.ɵɵelementStart(1,"div",2),r.ɵɵelementStart(2,"div",3),r.ɵɵtemplate(3,a,2,1,"strong",4),r.ɵɵtemplate(4,i,2,1,"span",5),r.ɵɵtemplate(5,m,4,3,"div",6),r.ɵɵelementStart(6,"button",7),r.ɵɵlistener("click",(function(){return r.ɵɵrestoreView(n),r.ɵɵnextContext().close()})),r.ɵɵelementStart(7,"span",8),r.ɵɵtext(8,"×"),r.ɵɵelementEnd(),r.ɵɵelementEnd(),r.ɵɵelementEnd(),r.ɵɵelementEnd(),r.ɵɵelementEnd()}if(2&e){var o=r.ɵɵnextContext();r.ɵɵadvance(2),r.ɵɵclassMapInterpolate1("alert ",o.type," alert-dismissible fade show"),r.ɵɵadvance(1),r.ɵɵproperty("ngIf",o.title),r.ɵɵadvance(1),r.ɵɵproperty("ngIf",o.message),r.ɵɵadvance(1),r.ɵɵproperty("ngForOf",o.errors)}}s.ɵfac=function(e){return new(e||s)(r.ɵɵinject(t.ToasterService))},s.ɵprov=r.ɵɵdefineInjectable({token:s,factory:s.ɵfac});var f=function(){function e(){this.type="alert-danger",this.title="",this.message="",this.compilerError=!1,this.errors=[],this.onClose=new r.EventEmitter}return e.prototype.close=function(){this.onClose.next()},e.prototype.isArray=function(e){return Array.isArray(e)},e.prototype.isErrorObject=function(e){return e instanceof Object||this.isArray(e)},e.prototype.getErrorAsString=function(e){return JSON.stringify(e,void 0,2)},e}();f.ɵfac=function(e){return new(e||f)},f.ɵcmp=r.ɵɵdefineComponent({type:f,selectors:[["message-box"]],inputs:{type:"type",title:"title",message:"message",compilerError:"compilerError",errors:"errors"},outputs:{onClose:"onClose"},decls:1,vars:1,consts:[["class","error-box row",4,"ngIf"],[1,"error-box","row"],[1,"col-12"],["role","alert"],["class","title",4,"ngIf"],["class","detail-message",4,"ngIf"],["class","alert-text",4,"ngFor","ngForOf"],["type","button","aria-label","Close",1,"close",3,"click"],["aria-hidden","true"],[1,"title"],[1,"detail-message"],[1,"alert-text"],["class","causes",4,"ngIf"],["class","error-text",3,"innerHTML",4,"ngIf"],[4,"ngIf"],[1,"causes"],["class","error-text",3,"innerHTML",4,"ngFor","ngForOf"],[1,"error-text",3,"innerHTML"]],template:function(e,t){1&e&&r.ɵɵtemplate(0,d,9,6,"div",0),2&e&&r.ɵɵproperty("ngIf",t.errors.length>0)},directives:[o.NgIf,o.NgForOf],styles:[".error-box[_ngcontent-%COMP%]{background:#f5caca;border:1px solid #8b4646;border-radius:5px;color:#8b4646;position:relative;width:100%}.error-box[_ngcontent-%COMP%] .alert[_ngcontent-%COMP%]{padding:10px 15px!important}.error-box[_ngcontent-%COMP%] .alert[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{background:none;border:none;color:#8b4646;cursor:pointer;font-size:20px;position:absolute;right:2px;top:2px}.error-box[_ngcontent-%COMP%] .alert[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{margin-right:5px;word-break:break-word}.error-box[_ngcontent-%COMP%] .causes[_ngcontent-%COMP%]{word-break:break-word}"]});var g=function(){};g.ɵmod=r.ɵɵdefineNgModule({type:g}),g.ɵinj=r.ɵɵdefineInjector({factory:function(e){return new(e||g)},providers:[s],imports:[[o.CommonModule,n.FormsModule,n.ReactiveFormsModule,t.ToasterModule]]}),("undefined"==typeof ngJitMode||ngJitMode)&&r.ɵɵsetNgModuleScope(g,{declarations:[f],imports:[o.CommonModule,n.FormsModule,n.ReactiveFormsModule,t.ToasterModule],exports:[f]}),Object.keys(t).forEach((function(r){"default"!==r&&Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[r]}})})),e.MessageBoxComponent=f,e.MessagesModule=g,e.MessagesService=s,Object.defineProperty(e,"__esModule",{value:!0})}));
2
- //# sourceMappingURL=apipass-messages.umd.min.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../projects/messages/src/messages.service.ts","../../../projects/messages/src/message-box/message-box.component.html","../../../projects/messages/src/message-box/message-box.component.ts","../../../projects/messages/src/messages.module.ts"],"names":["MessagesService","toasterService","this","prototype","successMessage","title","body","positionClass","customMessage","message","getErrorMessage","statusCode","codeMessage","Object","status","type","timeout","bodyOutputType","BodyOutputType","TrustedHtml","document","getElementById","className","pop","i0.ɵɵelementStart","i0.ɵɵtext","i0.ɵɵelementEnd","i0.ɵɵadvance","i0.ɵɵtextInterpolate","i0.ɵɵelement","i0.ɵɵproperty","i0.ɵɵtemplate","i0.ɵɵtextInterpolate1","i0.ɵɵlistener","i0.ɵɵclassMapInterpolate1","i0","ɵɵinject","i1","ToasterService","factory","ɵfac","MessageBoxComponent","compilerError","errors","onClose","EventEmitter","close","next","isArray","error","Array","isErrorObject","getErrorAsString","JSON","stringify","undefined","selectors","inputs","outputs","decls","vars","consts","template","rf","ctx","MessagesModule","providers","imports","CommonModule","FormsModule","ReactiveFormsModule","ToasterModule","declarations","exports"],"mappings":"qhBAQE,SAAAA,EAAYC,GACV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QAAA,aAAA,EAAA,YAAA,EAAA,QAAA,CAAA,EAAA,QAAA,CAAA,EAAA,UAAA,CAAA,QAAA,aAAA,EAAA,YAAA,EAAA,QAAA,WAAA,CAAA,EAAA,aAAA,EAAA,cAAAC,SAAA,SAAAC,EAAAC,QDPhCjC,EAAAA,WAAAA,EAAAA,EAAAA,EAAAA,EAAAA,MAAAA,QAA2BD,EAAAA,WAAAA,OAAAA,EAAAA,OAAAA,OAAAA,mqBEsB3B,6CAAamC,iEAAAA,IAAcC,UAFd,CAAClE,GAAgBmE,QAAA,CAZnB,CACPC,EAAAA,aACAC,EAAAA,YACAC,EAAAA,oBACAC,EAAAA,mFAUSN,EAAc,CAAAO,aAAA,CAPvB/B,GAAmB0B,QAAA,CANnBC,EAAAA,aACAC,EAAAA,YACAC,EAAAA,oBACAC,EAAAA,eAAaE,QAAA,CAMbhC","sourcesContent":["import {Injectable} from '@angular/core';\nimport {BodyOutputType, Toast, ToasterService} from 'angular2-toaster';\n\n@Injectable()\nexport class MessagesService {\n\n private toasterService: ToasterService;\n\n constructor(toasterService: ToasterService) {\n this.toasterService = toasterService;\n }\n\n public successMessage(title: string, body?: string, positionClass?: string): void {\n this.customMessage('success', title, body || '', positionClass);\n }\n\n public message(title: string, body: string, positionClass?: string): void {\n this.customMessage('error', title, body, positionClass);\n }\n\n public getErrorMessage(statusCode: number, message: any): string {\n let codeMessage;\n if (message instanceof Object) {\n codeMessage = message.status || statusCode;\n if (message.message) {\n codeMessage += ' - ' + message.message;\n }\n return codeMessage;\n }\n return `${statusCode} - ${message}`;\n }\n\n public customMessage(type: string, title: string, body: string, positionClass?: any): void {\n const message: Toast = {\n type,\n title,\n timeout: 30000,\n body,\n bodyOutputType: BodyOutputType.TrustedHtml\n };\n const toastContainer: any = document.getElementById('toast-container');\n toastContainer.className = positionClass || 'toast-top-right';\n this.toasterService.pop(message);\n }\n}\n","<div class=\"error-box row\" *ngIf=\"errors.length > 0\">\n <div class=\"col-12\">\n <div class=\"alert {{type}} alert-dismissible fade show\" role=\"alert\">\n <strong class=\"title\" *ngIf=\"title\">{{title}}</strong>\n <span class=\"detail-message\" *ngIf=\"message\">{{message}}</span>\n <div class=\"alert-text\" *ngFor=\"let error of errors\">\n <span class=\"causes\" *ngIf=\"compilerError && isArray(error)\">\n <span class=\"error-text\" *ngFor=\"let item of error\" [innerHTML]=\"item.message\"></span>\n </span>\n\n <span class=\"error-text\"\n *ngIf=\"(!compilerError || (compilerError && !isArray(error))) && !isErrorObject(error)\" [innerHTML]=\"error\"></span>\n <pre *ngIf=\"!compilerError && isErrorObject(error)\">\n {{getErrorAsString(error)}}\n </pre>\n </div>\n <button type=\"button\" class=\"close\" (click)=\"close()\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n </div>\n </div>\n</div>\n","import { Component, Input, EventEmitter, Output } from '@angular/core';\n\n@Component({\n selector: 'message-box',\n templateUrl: 'message-box.component.html',\n styleUrls: ['message-box.component.scss']\n})\nexport class MessageBoxComponent {\n\n @Input() public type = 'alert-danger';\n @Input() public title = '';\n @Input() public message = '';\n @Input() public compilerError = false;\n @Input() public errors: [] = [];\n\n @Output() public onClose = new EventEmitter<void>();\n\n public close(): void {\n this.onClose.next();\n }\n\n public isArray(error: any): boolean {\n return Array.isArray(error);\n }\n\n public isErrorObject(error: any): boolean {\n return error instanceof Object || this.isArray(error);\n }\n\n public getErrorAsString(error: any): string {\n return JSON.stringify(error, undefined, 2);\n }\n\n}\n","import {NgModule} from '@angular/core';\nimport {FormsModule, ReactiveFormsModule} from '@angular/forms';\nimport {CommonModule} from '@angular/common';\nimport {MessageBoxComponent} from './message-box/message-box.component';\nimport {MessagesService} from './messages.service';\nimport {ToasterModule} from 'angular2-toaster';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n ToasterModule\n ],\n declarations: [\n MessageBoxComponent\n ],\n exports: [\n MessageBoxComponent\n ],\n providers: [MessagesService]\n})\nexport class MessagesModule {}\n"]}
@@ -1,145 +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
- function MessageBoxComponent_div_0_strong_3_Template(rf, ctx) { if (rf & 1) {
5
- i0.ɵɵelementStart(0, "strong", 9);
6
- i0.ɵɵtext(1);
7
- i0.ɵɵelementEnd();
8
- } if (rf & 2) {
9
- const ctx_r1 = i0.ɵɵnextContext(2);
10
- i0.ɵɵadvance(1);
11
- i0.ɵɵtextInterpolate(ctx_r1.title);
12
- } }
13
- function MessageBoxComponent_div_0_span_4_Template(rf, ctx) { if (rf & 1) {
14
- i0.ɵɵelementStart(0, "span", 10);
15
- i0.ɵɵtext(1);
16
- i0.ɵɵelementEnd();
17
- } if (rf & 2) {
18
- const ctx_r2 = i0.ɵɵnextContext(2);
19
- i0.ɵɵadvance(1);
20
- i0.ɵɵtextInterpolate(ctx_r2.message);
21
- } }
22
- function MessageBoxComponent_div_0_div_5_span_1_span_1_Template(rf, ctx) { if (rf & 1) {
23
- i0.ɵɵelement(0, "span", 17);
24
- } if (rf & 2) {
25
- const item_r9 = ctx.$implicit;
26
- i0.ɵɵproperty("innerHTML", item_r9.message, i0.ɵɵsanitizeHtml);
27
- } }
28
- function MessageBoxComponent_div_0_div_5_span_1_Template(rf, ctx) { if (rf & 1) {
29
- i0.ɵɵelementStart(0, "span", 15);
30
- i0.ɵɵtemplate(1, MessageBoxComponent_div_0_div_5_span_1_span_1_Template, 1, 1, "span", 16);
31
- i0.ɵɵelementEnd();
32
- } if (rf & 2) {
33
- const error_r4 = i0.ɵɵnextContext().$implicit;
34
- i0.ɵɵadvance(1);
35
- i0.ɵɵproperty("ngForOf", error_r4);
36
- } }
37
- function MessageBoxComponent_div_0_div_5_span_2_Template(rf, ctx) { if (rf & 1) {
38
- i0.ɵɵelement(0, "span", 17);
39
- } if (rf & 2) {
40
- const error_r4 = i0.ɵɵnextContext().$implicit;
41
- i0.ɵɵproperty("innerHTML", error_r4, i0.ɵɵsanitizeHtml);
42
- } }
43
- function MessageBoxComponent_div_0_div_5_pre_3_Template(rf, ctx) { if (rf & 1) {
44
- i0.ɵɵelementStart(0, "pre");
45
- i0.ɵɵtext(1);
46
- i0.ɵɵelementEnd();
47
- } if (rf & 2) {
48
- const error_r4 = i0.ɵɵnextContext().$implicit;
49
- const ctx_r7 = i0.ɵɵnextContext(2);
50
- i0.ɵɵadvance(1);
51
- i0.ɵɵtextInterpolate1(" ", ctx_r7.getErrorAsString(error_r4), "\n ");
52
- } }
53
- function MessageBoxComponent_div_0_div_5_Template(rf, ctx) { if (rf & 1) {
54
- i0.ɵɵelementStart(0, "div", 11);
55
- i0.ɵɵtemplate(1, MessageBoxComponent_div_0_div_5_span_1_Template, 2, 1, "span", 12);
56
- i0.ɵɵtemplate(2, MessageBoxComponent_div_0_div_5_span_2_Template, 1, 1, "span", 13);
57
- i0.ɵɵtemplate(3, MessageBoxComponent_div_0_div_5_pre_3_Template, 2, 1, "pre", 14);
58
- i0.ɵɵelementEnd();
59
- } if (rf & 2) {
60
- const error_r4 = ctx.$implicit;
61
- const ctx_r3 = i0.ɵɵnextContext(2);
62
- i0.ɵɵadvance(1);
63
- i0.ɵɵproperty("ngIf", ctx_r3.compilerError && ctx_r3.isArray(error_r4));
64
- i0.ɵɵadvance(1);
65
- i0.ɵɵproperty("ngIf", (!ctx_r3.compilerError || ctx_r3.compilerError && !ctx_r3.isArray(error_r4)) && !ctx_r3.isErrorObject(error_r4));
66
- i0.ɵɵadvance(1);
67
- i0.ɵɵproperty("ngIf", !ctx_r3.compilerError && ctx_r3.isErrorObject(error_r4));
68
- } }
69
- function MessageBoxComponent_div_0_Template(rf, ctx) { if (rf & 1) {
70
- const _r14 = i0.ɵɵgetCurrentView();
71
- i0.ɵɵelementStart(0, "div", 1);
72
- i0.ɵɵelementStart(1, "div", 2);
73
- i0.ɵɵelementStart(2, "div", 3);
74
- i0.ɵɵtemplate(3, MessageBoxComponent_div_0_strong_3_Template, 2, 1, "strong", 4);
75
- i0.ɵɵtemplate(4, MessageBoxComponent_div_0_span_4_Template, 2, 1, "span", 5);
76
- i0.ɵɵtemplate(5, MessageBoxComponent_div_0_div_5_Template, 4, 3, "div", 6);
77
- i0.ɵɵelementStart(6, "button", 7);
78
- i0.ɵɵlistener("click", function MessageBoxComponent_div_0_Template_button_click_6_listener() { i0.ɵɵrestoreView(_r14); const ctx_r13 = i0.ɵɵnextContext(); return ctx_r13.close(); });
79
- i0.ɵɵelementStart(7, "span", 8);
80
- i0.ɵɵtext(8, "\u00D7");
81
- i0.ɵɵelementEnd();
82
- i0.ɵɵelementEnd();
83
- i0.ɵɵelementEnd();
84
- i0.ɵɵelementEnd();
85
- i0.ɵɵelementEnd();
86
- } if (rf & 2) {
87
- const ctx_r0 = i0.ɵɵnextContext();
88
- i0.ɵɵadvance(2);
89
- i0.ɵɵclassMapInterpolate1("alert ", ctx_r0.type, " alert-dismissible fade show");
90
- i0.ɵɵadvance(1);
91
- i0.ɵɵproperty("ngIf", ctx_r0.title);
92
- i0.ɵɵadvance(1);
93
- i0.ɵɵproperty("ngIf", ctx_r0.message);
94
- i0.ɵɵadvance(1);
95
- i0.ɵɵproperty("ngForOf", ctx_r0.errors);
96
- } }
97
- export class MessageBoxComponent {
98
- constructor() {
99
- this.type = 'alert-danger';
100
- this.title = '';
101
- this.message = '';
102
- this.compilerError = false;
103
- this.errors = [];
104
- this.onClose = new EventEmitter();
105
- }
106
- close() {
107
- this.onClose.next();
108
- }
109
- isArray(error) {
110
- return Array.isArray(error);
111
- }
112
- isErrorObject(error) {
113
- return error instanceof Object || this.isArray(error);
114
- }
115
- getErrorAsString(error) {
116
- return JSON.stringify(error, undefined, 2);
117
- }
118
- }
119
- MessageBoxComponent.ɵfac = function MessageBoxComponent_Factory(t) { return new (t || MessageBoxComponent)(); };
120
- MessageBoxComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MessageBoxComponent, selectors: [["message-box"]], inputs: { type: "type", title: "title", message: "message", compilerError: "compilerError", errors: "errors" }, outputs: { onClose: "onClose" }, decls: 1, vars: 1, consts: [["class", "error-box row", 4, "ngIf"], [1, "error-box", "row"], [1, "col-12"], ["role", "alert"], ["class", "title", 4, "ngIf"], ["class", "detail-message", 4, "ngIf"], ["class", "alert-text", 4, "ngFor", "ngForOf"], ["type", "button", "aria-label", "Close", 1, "close", 3, "click"], ["aria-hidden", "true"], [1, "title"], [1, "detail-message"], [1, "alert-text"], ["class", "causes", 4, "ngIf"], ["class", "error-text", 3, "innerHTML", 4, "ngIf"], [4, "ngIf"], [1, "causes"], ["class", "error-text", 3, "innerHTML", 4, "ngFor", "ngForOf"], [1, "error-text", 3, "innerHTML"]], template: function MessageBoxComponent_Template(rf, ctx) { if (rf & 1) {
121
- i0.ɵɵtemplate(0, MessageBoxComponent_div_0_Template, 9, 6, "div", 0);
122
- } if (rf & 2) {
123
- i0.ɵɵproperty("ngIf", ctx.errors.length > 0);
124
- } }, directives: [i1.NgIf, i1.NgForOf], styles: [".error-box[_ngcontent-%COMP%]{background:#f5caca;border:1px solid #8b4646;border-radius:5px;color:#8b4646;position:relative;width:100%}.error-box[_ngcontent-%COMP%] .alert[_ngcontent-%COMP%]{padding:10px 15px!important}.error-box[_ngcontent-%COMP%] .alert[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{background:none;border:none;color:#8b4646;cursor:pointer;font-size:20px;position:absolute;right:2px;top:2px}.error-box[_ngcontent-%COMP%] .alert[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{margin-right:5px;word-break:break-word}.error-box[_ngcontent-%COMP%] .causes[_ngcontent-%COMP%]{word-break:break-word}"] });
125
- /*@__PURE__*/ (function () { i0.ɵsetClassMetadata(MessageBoxComponent, [{
126
- type: Component,
127
- args: [{
128
- selector: 'message-box',
129
- templateUrl: 'message-box.component.html',
130
- styleUrls: ['message-box.component.scss']
131
- }]
132
- }], null, { type: [{
133
- type: Input
134
- }], title: [{
135
- type: Input
136
- }], message: [{
137
- type: Input
138
- }], compilerError: [{
139
- type: Input
140
- }], errors: [{
141
- type: Input
142
- }], onClose: [{
143
- type: Output
144
- }] }); })();
145
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVzc2FnZS1ib3guY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcHJvamVjdHMvbWVzc2FnZXMvc3JjL21lc3NhZ2UtYm94L21lc3NhZ2UtYm94LmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uL3Byb2plY3RzL21lc3NhZ2VzL3NyYy9tZXNzYWdlLWJveC9tZXNzYWdlLWJveC5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSxFQUFFLE1BQU0sZUFBZSxDQUFDOzs7O0lDR2pFLGlDQUFvQztJQUFBLFlBQVM7SUFBQSxpQkFBUzs7O0lBQWxCLGVBQVM7SUFBVCxrQ0FBUzs7O0lBQzdDLGdDQUE2QztJQUFBLFlBQVc7SUFBQSxpQkFBTzs7O0lBQWxCLGVBQVc7SUFBWCxvQ0FBVzs7O0lBR3BELDJCQUFzRjs7O0lBQWxDLDhEQUEwQjs7O0lBRGhGLGdDQUNFO0lBQUEsMEZBQStFO0lBQ2pGLGlCQUFPOzs7SUFEb0IsZUFBMEI7SUFBMUIsa0NBQTBCOzs7SUFHckQsMkJBQ3lIOzs7SUFBM0IsdURBQW1COzs7SUFDakgsMkJBQ0U7SUFBQSxZQUNGO0lBQUEsaUJBQU07Ozs7SUFESixlQUNGO0lBREUsb0ZBQ0Y7OztJQVRGLCtCQUNFO0lBQUEsbUZBQ0U7SUFHRixtRkFDa0g7SUFDbEgsaUZBQ0U7SUFFSixpQkFBTTs7OztJQVRpQixlQUF1QztJQUF2Qyx1RUFBdUM7SUFLdEQsZUFBdUY7SU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gZXJyb3JzXCI+XG4gICAgICAgIDxzcGFuIGNsYXNzPVwiY2F1c2VzXCIgKm5nSWY9XCJjb21waWxlckVycm9yICYmIGlzQXJyYXkoZXJyb3IpXCI+XG4gICAgICAgICAgPHNwYW4gY2xhc3M9XCJlcnJvci10ZXh0XCIgKm5nRm9yPVwibGV0IGl0ZW0gb2YgZXJyb3JcIiBbaW5uZXJIVE1MXT1cIml0ZW0ubWVzc2FnZVwiPjwvc3Bhbj5cbiAgICAgICAgPC9zcGFuPlxuXG4gICAgICAgIDxzcGFuIGNsYXNzPVwiZXJyb3ItdGV4dFwiXG4gICAgICAgICAgICAgICpuZ0lmPVwiKCFjb21waWxlckVycm9yIHx8IChjb21waWxlckVycm9yICYmICFpc0FycmF5KGVycm9yKSkpICYmICFpc0Vycm9yT2JqZWN0KGVycm9yKVwiIFtpbm5lckhUTUxdPVwiZXJyb3JcIj48L3NwYW4+XG4gICAgICAgIDxwcmUgKm5nSWY9XCIhY29tcGlsZXJFcnJvciAmJiBpc0Vycm9yT2JqZWN0KGVycm9yKVwiPlxuICAgICAgICAgIHt7Z2V0RXJyb3JBc1N0cmluZyhlcnJvcil9fVxuICAgICAgICA8L3ByZT5cbiAgICAgIDwvZGl2PlxuICAgICAgPGJ1dHRvbiB0eXBlPVwiYnV0dG9uXCIgY2xhc3M9XCJjbG9zZVwiIChjbGljayk9XCJjbG9zZSgpXCIgYXJpYS1sYWJlbD1cIkNsb3NlXCI+XG4gICAgICAgIDxzcGFuIGFyaWEtaGlkZGVuPVwidHJ1ZVwiPiZ0aW1lczs8L3NwYW4+XG4gICAgICA8L2J1dHRvbj5cbiAgICA8L2Rpdj5cbiAgPC9kaXY+XG48L2Rpdj5cbiJdfQ==
@@ -1,39 +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 { ToasterModule } from 'angular2-toaster';
7
- import * as i0 from "@angular/core";
8
- export class MessagesModule {
9
- }
10
- MessagesModule.ɵmod = i0.ɵɵdefineNgModule({ type: MessagesModule });
11
- MessagesModule.ɵinj = i0.ɵɵdefineInjector({ factory: function MessagesModule_Factory(t) { return new (t || MessagesModule)(); }, providers: [MessagesService], imports: [[
12
- CommonModule,
13
- FormsModule,
14
- ReactiveFormsModule,
15
- ToasterModule
16
- ]] });
17
- (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(MessagesModule, { declarations: [MessageBoxComponent], imports: [CommonModule,
18
- FormsModule,
19
- ReactiveFormsModule,
20
- ToasterModule], exports: [MessageBoxComponent] }); })();
21
- /*@__PURE__*/ (function () { i0.ɵsetClassMetadata(MessagesModule, [{
22
- type: NgModule,
23
- args: [{
24
- imports: [
25
- CommonModule,
26
- FormsModule,
27
- ReactiveFormsModule,
28
- ToasterModule
29
- ],
30
- declarations: [
31
- MessageBoxComponent
32
- ],
33
- exports: [
34
- MessageBoxComponent
35
- ],
36
- providers: [MessagesService]
37
- }]
38
- }], null, null); })();
39
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVzc2FnZXMubW9kdWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vcHJvamVjdHMvbWVzc2FnZXMvc3JjL21lc3NhZ2VzLm1vZHVsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUMsUUFBUSxFQUFDLE1BQU0sZUFBZSxDQUFDO0FBQ3ZDLE9BQU8sRUFBQyxXQUFXLEVBQUUsbUJBQW1CLEVBQUMsTUFBTSxnQkFBZ0IsQ0FBQztBQUNoRSxPQUFPLEVBQUMsWUFBWSxFQUFDLE1BQU0saUJBQWlCLENBQUM7QUFDN0MsT0FBTyxFQUFDLG1CQUFtQixFQUFDLE1BQU0scUNBQXFDLEN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WVzc2FnZXMuc2VydmljZSc7XG5pbXBvcnQge1RvYXN0ZXJNb2R1bGV9IGZyb20gJ2FuZ3VsYXIyLXRvYXN0ZXInO1xuXG5ATmdNb2R1bGUoe1xuICBpbXBvcnRzOiBbXG4gICAgQ29tbW9uTW9kdWxlLFxuICAgIEZvcm1zTW9kdWxlLFxuICAgIFJlYWN0aXZlRm9ybXNNb2R1bGUsXG4gICAgVG9hc3Rlck1vZHVsZVxuICBdLFxuICBkZWNsYXJhdGlvbnM6IFtcbiAgICBNZXNzYWdlQm94Q29tcG9uZW50XG4gIF0sXG4gIGV4cG9ydHM6IFtcbiAgICBNZXNzYWdlQm94Q29tcG9uZW50XG4gIF0sXG4gIHByb3ZpZGVyczogW01lc3NhZ2VzU2VydmljZV1cbn0pXG5leHBvcnQgY2xhc3MgTWVzc2FnZXNNb2R1bGUge31cbiJdfQ==
@@ -1,44 +0,0 @@
1
- import { Injectable } from '@angular/core';
2
- import { BodyOutputType, ToasterService } from 'angular2-toaster';
3
- import * as i0 from "@angular/core";
4
- import * as i1 from "angular2-toaster";
5
- export class MessagesService {
6
- constructor(toasterService) {
7
- this.toasterService = toasterService;
8
- }
9
- successMessage(title, body, positionClass) {
10
- this.customMessage('success', title, body || '', positionClass);
11
- }
12
- message(title, body, positionClass) {
13
- this.customMessage('error', title, body, positionClass);
14
- }
15
- getErrorMessage(statusCode, message) {
16
- let codeMessage;
17
- if (message instanceof Object) {
18
- codeMessage = message.status || statusCode;
19
- if (message.message) {
20
- codeMessage += ' - ' + message.message;
21
- }
22
- return codeMessage;
23
- }
24
- return `${statusCode} - ${message}`;
25
- }
26
- customMessage(type, title, body, positionClass) {
27
- const message = {
28
- type,
29
- title,
30
- timeout: 30000,
31
- body,
32
- bodyOutputType: BodyOutputType.TrustedHtml
33
- };
34
- const toastContainer = document.getElementById('toast-container');
35
- toastContainer.className = positionClass || 'toast-top-right';
36
- this.toasterService.pop(message);
37
- }
38
- }
39
- MessagesService.ɵfac = function MessagesService_Factory(t) { return new (t || MessagesService)(i0.ɵɵinject(i1.ToasterService)); };
40
- MessagesService.ɵprov = i0.ɵɵdefineInjectable({ token: MessagesService, factory: MessagesService.ɵfac });
41
- /*@__PURE__*/ (function () { i0.ɵsetClassMetadata(MessagesService, [{
42
- type: Injectable
43
- }], function () { return [{ type: i1.ToasterService }]; }, null); })();
44
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVzc2FnZXMuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL21lc3NhZ2VzL3NyYy9tZXNzYWdlcy5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBQyxVQUFVLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFDekMsT0FBTyxFQUFDLGNBQWMsRUFBUyxjQUFjLEVBQUMsTUFBTSxrQkFBa0IsQ0FBQzs7O0FBR3ZFLE1BQU0sT0FBTyxlQUFlO0lBSTFCLFlBQVksY0FBOEI7UUFDeEMsSUFBSSxDQUFDLGNBQWMsR0FBRyxjQUFjLENBQUM7SUFDdkMsQ0FBQztJQUVNLGNBQWMsQ0FBQyxLQUFhLEVBQUUsSUFBYSxFQUFFLGFBQXNCO1FBQ3hFLElBQUksQ0FBQyxhQUFhLENBQUMsU0FBUyxFQUFFLEtBQUssRUFBRSxJQUFJLElBQUksRUFBRSxFQUFFLGFBQWEsQ0FBQyxDQUFDO0lBQ2xFLENBQUM7SUFFTSxPQUFPLENBQUMsS0FBYSxFQUFFLElBQVksRUFBRSxhQUFzQjtRQUNoRSxJQUFJLENBQUMsYUFBYSxDQUFDLE9BQU8sRUFBRSxLQUFLLEVBQUUsSUFBSSxFQUFFLGFBQWEsQ0FBQyxDQUFDO0lBQzFELENBQUM7SUFFTSxlQUFlLENBQUMsVUFBa0IsRUFBRSxPQUFZO1FBQ3JELElBQUksV0FBV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zdGF0dXNDb2RlfSAtICR7bWVzc2FnZX1gO1xuICB9XG5cbiAgcHVibGljIGN1c3RvbU1lc3NhZ2UodHlwZTogc3RyaW5nLCB0aXRsZTogc3RyaW5nLCBib2R5OiBzdHJpbmcsIHBvc2l0aW9uQ2xhc3M/OiBhbnkpOiB2b2lkIHtcbiAgICBjb25zdCBtZXNzYWdlOiBUb2FzdCA9IHtcbiAgICAgIHR5cGUsXG4gICAgICB0aXRsZSxcbiAgICAgIHRpbWVvdXQ6IDMwMDAwLFxuICAgICAgYm9keSxcbiAgICAgIGJvZHlPdXRwdXRUeXBlOiBCb2R5T3V0cHV0VHlwZS5UcnVzdGVkSHRtbFxuICAgIH07XG4gICAgY29uc3QgdG9hc3RDb250YWluZXI6IGFueSA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCd0b2FzdC1jb250YWluZXInKTtcbiAgICB0b2FzdENvbnRhaW5lci5jbGFzc05hbWUgPSBwb3NpdGlvbkNsYXNzIHx8ICd0b2FzdC10b3AtcmlnaHQnO1xuICAgIHRoaXMudG9hc3RlclNlcnZpY2UucG9wKG1lc3NhZ2UpO1xuICB9XG59XG4iXX0=
@@ -1,5 +0,0 @@
1
- export * from 'angular2-toaster';
2
- export * from './messages.service';
3
- export * from './messages.module';
4
- export * from './message-box/message-box.component';
5
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL21lc3NhZ2VzL3NyYy9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsa0JBQWtCLENBQUM7QUFDakMsY0FBYyxvQkFBb0IsQ0FBQztBQUNuQyxjQUFjLG1CQUFtQixDQUFDO0FBQ2xDLGNBQWMscUNBQXFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICdhbmd1bGFyMi10b2FzdGVyJztcbmV4cG9ydCAqIGZyb20gJy4vbWVzc2FnZXMuc2VydmljZSc7XG5leHBvcnQgKiBmcm9tICcuL21lc3NhZ2VzLm1vZHVsZSc7XG5leHBvcnQgKiBmcm9tICcuL21lc3NhZ2UtYm94L21lc3NhZ2UtYm94LmNvbXBvbmVudCc7XG4iXX0=