@igo2/core 1.9.3 → 1.11.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.
- package/__ivy_ngcc__/locale/en.core.json +6 -0
- package/__ivy_ngcc__/locale/en.geo.json +31 -9
- package/__ivy_ngcc__/locale/en.integration.json +6 -4
- package/__ivy_ngcc__/locale/en.json +41 -11
- package/__ivy_ngcc__/locale/fr.core.json +6 -0
- package/__ivy_ngcc__/locale/fr.geo.json +29 -7
- package/__ivy_ngcc__/locale/fr.integration.json +5 -3
- package/__ivy_ngcc__/locale/fr.json +38 -8
- package/bundles/igo2-core.umd.js +138 -141
- package/bundles/igo2-core.umd.js.map +1 -1
- package/esm2015/lib/config/version.js +3 -3
- package/esm2015/lib/message/index.js +1 -2
- package/esm2015/lib/message/message.module.js +38 -9
- package/esm2015/lib/message/shared/index.js +1 -1
- package/esm2015/lib/message/shared/message.enum.js +3 -2
- package/esm2015/lib/message/shared/message.interface.js +1 -1
- package/esm2015/lib/message/shared/message.service.js +55 -72
- package/esm2015/lib/network/network.service.js +11 -3
- package/esm2015/lib/route/route.service.js +19 -4
- package/fesm2015/igo2-core.js +125 -129
- package/fesm2015/igo2-core.js.map +1 -1
- package/lib/message/index.d.ts +0 -1
- package/lib/message/message.module.d.ts +3 -4
- package/lib/message/shared/index.d.ts +1 -1
- package/lib/message/shared/message.enum.d.ts +2 -1
- package/lib/message/shared/message.interface.d.ts +4 -4
- package/lib/message/shared/message.service.d.ts +14 -11
- package/lib/network/network.service.d.ts +1 -0
- package/lib/route/route.service.d.ts +4 -3
- package/locale/en.core.json +6 -0
- package/locale/en.geo.json +31 -9
- package/locale/en.integration.json +6 -4
- package/locale/en.json +41 -11
- package/locale/fr.core.json +6 -0
- package/locale/fr.geo.json +29 -7
- package/locale/fr.integration.json +5 -3
- package/locale/fr.json +38 -8
- package/package.json +4 -4
- package/style/core.theming.scss +3 -1
- package/style/index.theming.scss +228 -36
- package/esm2015/lib/message/message-center/index.js +0 -2
- package/esm2015/lib/message/message-center/message-center.component.js +0 -43
- package/lib/message/message-center/index.d.ts +0 -1
- package/lib/message/message-center/message-center.component.d.ts +0 -19
package/fesm2015/igo2-core.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, NgModule, InjectionToken, APP_INITIALIZER,
|
|
3
|
-
import * as i2 from '@angular/common';
|
|
2
|
+
import { Injectable, NgModule, InjectionToken, APP_INITIALIZER, Injector, Inject, Optional, SkipSelf, EventEmitter } from '@angular/core';
|
|
4
3
|
import { CommonModule } from '@angular/common';
|
|
5
4
|
import { HTTP_INTERCEPTORS, HttpClient, HttpErrorResponse, HttpClientModule, HttpResponse } from '@angular/common/http';
|
|
6
5
|
import { finalize, catchError, map, tap, debounceTime, startWith } from 'rxjs/operators';
|
|
@@ -8,10 +7,10 @@ import { BehaviorSubject, throwError, of, combineLatest, fromEvent } from 'rxjs'
|
|
|
8
7
|
import { uuid, ObjectUtils } from '@igo2/utils';
|
|
9
8
|
import * as i1 from '@ngx-translate/core';
|
|
10
9
|
import { TranslateLoader, TranslateModule, MissingTranslationHandler } from '@ngx-translate/core';
|
|
11
|
-
import * as i1$1 from '
|
|
12
|
-
import {
|
|
10
|
+
import * as i1$1 from 'ngx-toastr';
|
|
11
|
+
import { ToastrModule, ToastrService } from 'ngx-toastr';
|
|
13
12
|
import * as i1$2 from '@angular/material/icon';
|
|
14
|
-
import * as i2
|
|
13
|
+
import * as i2 from '@angular/platform-browser';
|
|
15
14
|
import { HammerGestureConfig, HAMMER_GESTURE_CONFIG, HammerModule } from '@angular/platform-browser';
|
|
16
15
|
import * as i1$3 from '@angular/router';
|
|
17
16
|
import * as i1$4 from '@angular/cdk/layout';
|
|
@@ -99,8 +98,8 @@ IgoActivityModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [[]] })
|
|
|
99
98
|
}], null, null); })();
|
|
100
99
|
|
|
101
100
|
const version = {
|
|
102
|
-
lib: '1.
|
|
103
|
-
releaseDate:
|
|
101
|
+
lib: '1.11.0',
|
|
102
|
+
releaseDate: 1648648424505
|
|
104
103
|
};
|
|
105
104
|
|
|
106
105
|
class ConfigService {
|
|
@@ -281,45 +280,6 @@ IgoLanguageModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [[
|
|
|
281
280
|
}], null, null); })();
|
|
282
281
|
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(IgoLanguageModule, { imports: [i1.TranslateModule], exports: [TranslateModule] }); })();
|
|
283
282
|
|
|
284
|
-
const _c0 = function (a0) { return { closeIcon: a0 }; };
|
|
285
|
-
class MessageCenterComponent {
|
|
286
|
-
constructor() {
|
|
287
|
-
this._options = {};
|
|
288
|
-
}
|
|
289
|
-
get options() {
|
|
290
|
-
return Object.assign({}, MessageCenterComponent.defaultOptions, this._options);
|
|
291
|
-
}
|
|
292
|
-
set options(value) {
|
|
293
|
-
this._options = value;
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
MessageCenterComponent.defaultOptions = {
|
|
297
|
-
timeOut: 5000,
|
|
298
|
-
hasCloseIcon: false,
|
|
299
|
-
showProgressBar: true,
|
|
300
|
-
pauseOnHover: true,
|
|
301
|
-
clickToClose: true,
|
|
302
|
-
maxLength: 100,
|
|
303
|
-
maxStack: 3,
|
|
304
|
-
preventDuplicates: true
|
|
305
|
-
};
|
|
306
|
-
MessageCenterComponent.ɵfac = function MessageCenterComponent_Factory(t) { return new (t || MessageCenterComponent)(); };
|
|
307
|
-
MessageCenterComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MessageCenterComponent, selectors: [["igo-message-center"]], inputs: { options: "options" }, decls: 1, vars: 4, consts: [[1, "mat-typography", 3, "ngClass", "options"]], template: function MessageCenterComponent_Template(rf, ctx) { if (rf & 1) {
|
|
308
|
-
i0.ɵɵelement(0, "simple-notifications", 0);
|
|
309
|
-
} if (rf & 2) {
|
|
310
|
-
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(2, _c0, ctx.options.hasCloseIcon))("options", ctx.options);
|
|
311
|
-
} }, directives: [i1$1.SimpleNotificationsComponent, i2.NgClass], styles: ["[_nghost-%COMP%] div.simple-notification-wrapper{bottom:0;right:calc(50% - 150px)}@media only screen and (orientation:portrait) and (max-width: 599px),only screen and (orientation:landscape) and (max-width: 959px){[_nghost-%COMP%] div.simple-notification-wrapper{right:0;left:0;width:100%}}[_nghost-%COMP%] .closeIcon .sn-title:after{content:\"close\";font-family:\"Material Icons\";font-feature-settings:\"liga\" 1;font-size:24px;font-weight:normal;right:5px;top:5px;position:absolute}[_nghost-%COMP%] .simple-notification .icon{top:0;left:0;width:45px;height:45px;height:100%;padding:7px}[_nghost-%COMP%] .simple-notification .icon mat-icon{display:flex;align-items:center;height:100%;font-size:32px}[_nghost-%COMP%] div.simple-notification{min-height:50px;margin-bottom:5px;padding-left:45px;padding-right:25px}[_nghost-%COMP%] div.simple-notification.noIcon{padding-left:25px}@media only screen and (orientation:portrait) and (max-width: 599px),only screen and (orientation:landscape) and (max-width: 959px){[_nghost-%COMP%] div.simple-notification{margin-bottom:0}}[_nghost-%COMP%] div.simple-notification .sn-title{line-height:23px;font-size:15px;font-weight:bold}[_nghost-%COMP%] div.simple-notification .sn-content{line-height:18px;font-size:15px}"] });
|
|
312
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MessageCenterComponent, [{
|
|
313
|
-
type: Component,
|
|
314
|
-
args: [{
|
|
315
|
-
selector: 'igo-message-center',
|
|
316
|
-
templateUrl: './message-center.component.html',
|
|
317
|
-
styleUrls: ['./message-center.component.scss']
|
|
318
|
-
}]
|
|
319
|
-
}], function () { return []; }, { options: [{
|
|
320
|
-
type: Input
|
|
321
|
-
}] }); })();
|
|
322
|
-
|
|
323
283
|
class IgoMessageModule {
|
|
324
284
|
static forRoot() {
|
|
325
285
|
return {
|
|
@@ -330,16 +290,46 @@ class IgoMessageModule {
|
|
|
330
290
|
}
|
|
331
291
|
IgoMessageModule.ɵfac = function IgoMessageModule_Factory(t) { return new (t || IgoMessageModule)(); };
|
|
332
292
|
IgoMessageModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: IgoMessageModule });
|
|
333
|
-
IgoMessageModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [[CommonModule,
|
|
293
|
+
IgoMessageModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [[CommonModule,
|
|
294
|
+
ToastrModule.forRoot({
|
|
295
|
+
positionClass: 'toast-bottom-right',
|
|
296
|
+
timeOut: 10000,
|
|
297
|
+
extendedTimeOut: 10000,
|
|
298
|
+
messageClass: 'toast-message mat-typography',
|
|
299
|
+
closeButton: true,
|
|
300
|
+
progressBar: true,
|
|
301
|
+
enableHtml: true,
|
|
302
|
+
tapToDismiss: true,
|
|
303
|
+
maxOpened: 4,
|
|
304
|
+
preventDuplicates: true,
|
|
305
|
+
resetTimeoutOnDuplicate: true,
|
|
306
|
+
countDuplicates: false,
|
|
307
|
+
includeTitleDuplicates: true
|
|
308
|
+
})]] });
|
|
334
309
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoMessageModule, [{
|
|
335
310
|
type: NgModule,
|
|
336
311
|
args: [{
|
|
337
|
-
imports: [CommonModule,
|
|
338
|
-
|
|
339
|
-
|
|
312
|
+
imports: [CommonModule,
|
|
313
|
+
ToastrModule.forRoot({
|
|
314
|
+
positionClass: 'toast-bottom-right',
|
|
315
|
+
timeOut: 10000,
|
|
316
|
+
extendedTimeOut: 10000,
|
|
317
|
+
messageClass: 'toast-message mat-typography',
|
|
318
|
+
closeButton: true,
|
|
319
|
+
progressBar: true,
|
|
320
|
+
enableHtml: true,
|
|
321
|
+
tapToDismiss: true,
|
|
322
|
+
maxOpened: 4,
|
|
323
|
+
preventDuplicates: true,
|
|
324
|
+
resetTimeoutOnDuplicate: true,
|
|
325
|
+
countDuplicates: false,
|
|
326
|
+
includeTitleDuplicates: true
|
|
327
|
+
})],
|
|
328
|
+
declarations: [],
|
|
329
|
+
exports: []
|
|
340
330
|
}]
|
|
341
331
|
}], null, null); })();
|
|
342
|
-
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(IgoMessageModule, {
|
|
332
|
+
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(IgoMessageModule, { imports: [CommonModule, i1$1.ToastrModule] }); })();
|
|
343
333
|
|
|
344
334
|
class LanguageService {
|
|
345
335
|
constructor(translate) {
|
|
@@ -369,18 +359,23 @@ LanguageService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: Language
|
|
|
369
359
|
var MessageType;
|
|
370
360
|
(function (MessageType) {
|
|
371
361
|
MessageType["ERROR"] = "error";
|
|
372
|
-
MessageType["ALERT"] = "
|
|
362
|
+
MessageType["ALERT"] = "warning";
|
|
363
|
+
MessageType["WARNING"] = "warning";
|
|
373
364
|
MessageType["INFO"] = "info";
|
|
374
365
|
MessageType["SUCCESS"] = "success";
|
|
375
366
|
})(MessageType || (MessageType = {}));
|
|
376
367
|
|
|
377
368
|
class MessageService {
|
|
378
|
-
constructor(
|
|
379
|
-
this.
|
|
369
|
+
constructor(injector, configService, languageService) {
|
|
370
|
+
this.injector = injector;
|
|
380
371
|
this.configService = configService;
|
|
372
|
+
this.languageService = languageService;
|
|
381
373
|
this.messages$ = new BehaviorSubject([]);
|
|
382
374
|
this.options = this.configService.getConfig('message') || {};
|
|
383
375
|
}
|
|
376
|
+
get toastr() {
|
|
377
|
+
return this.injector.get(ToastrService);
|
|
378
|
+
}
|
|
384
379
|
showError(httpError) {
|
|
385
380
|
httpError.error.caught = true;
|
|
386
381
|
return this.error(httpError.error.message, httpError.error.title);
|
|
@@ -399,83 +394,60 @@ class MessageService {
|
|
|
399
394
|
}
|
|
400
395
|
if (currentDate > message.options.from && currentDate < message.options.to) {
|
|
401
396
|
message = this.handleTemplate(message);
|
|
402
|
-
let notification;
|
|
403
397
|
if (message.text) {
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
398
|
+
let messageShown;
|
|
399
|
+
switch (message.type) {
|
|
400
|
+
case MessageType.SUCCESS:
|
|
401
|
+
messageShown = this.success(message.text, message.title, message.options);
|
|
402
|
+
break;
|
|
403
|
+
case MessageType.ERROR:
|
|
404
|
+
messageShown = this.error(message.text, message.title, message.options);
|
|
405
|
+
break;
|
|
406
|
+
case MessageType.INFO:
|
|
407
|
+
messageShown = this.info(message.text, message.title, message.options);
|
|
408
|
+
break;
|
|
409
|
+
case MessageType.ALERT:
|
|
410
|
+
case MessageType.WARNING:
|
|
411
|
+
messageShown = this.alert(message.text, message.title, message.options);
|
|
412
|
+
break;
|
|
413
|
+
default:
|
|
414
|
+
messageShown = this.info(message.text, message.title, message.options);
|
|
415
|
+
break;
|
|
411
416
|
}
|
|
412
|
-
|
|
417
|
+
message.options.id = messageShown.toastId;
|
|
413
418
|
}
|
|
414
|
-
else {
|
|
415
|
-
return;
|
|
416
|
-
}
|
|
417
|
-
if (message.icon !== undefined) {
|
|
418
|
-
this.addIcon(notification, message.icon);
|
|
419
|
-
}
|
|
420
|
-
message.options.id = notification.id;
|
|
421
|
-
return notification;
|
|
422
419
|
}
|
|
423
|
-
return;
|
|
424
|
-
}
|
|
425
|
-
success(text, title, options = {}) {
|
|
426
|
-
return this.message({
|
|
427
|
-
text,
|
|
428
|
-
title,
|
|
429
|
-
icon: options.icon || 'check',
|
|
430
|
-
options,
|
|
431
|
-
type: MessageType.SUCCESS
|
|
432
|
-
});
|
|
433
420
|
}
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
icon: options.icon || 'error_outline',
|
|
439
|
-
options,
|
|
440
|
-
type: MessageType.ERROR
|
|
441
|
-
});
|
|
421
|
+
success(text, title = 'igo.core.message.success', options = {}) {
|
|
422
|
+
const message = this.languageService.translate.instant(text);
|
|
423
|
+
const translatedTitle = this.languageService.translate.instant(title);
|
|
424
|
+
return this.toastr.success(message, translatedTitle, options);
|
|
442
425
|
}
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
icon: options.icon || 'info_outline',
|
|
448
|
-
options,
|
|
449
|
-
type: MessageType.INFO
|
|
450
|
-
});
|
|
426
|
+
error(text, title = 'igo.core.message.error', options = {}) {
|
|
427
|
+
const message = this.languageService.translate.instant(text);
|
|
428
|
+
const translatedTitle = this.languageService.translate.instant(title);
|
|
429
|
+
return this.toastr.error(message, translatedTitle, options);
|
|
451
430
|
}
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
431
|
+
info(text, title = 'igo.core.message.info', options = {}) {
|
|
432
|
+
const message = this.languageService.translate.instant(text);
|
|
433
|
+
const translatedTitle = this.languageService.translate.instant(title);
|
|
434
|
+
return this.toastr.info(message, translatedTitle, options);
|
|
435
|
+
}
|
|
436
|
+
alert(text, title = 'igo.core.message.alert', options = {}) {
|
|
437
|
+
const message = this.languageService.translate.instant(text);
|
|
438
|
+
const translatedTitle = this.languageService.translate.instant(title);
|
|
439
|
+
return this.toastr.warning(message, translatedTitle, options);
|
|
460
440
|
}
|
|
461
441
|
remove(id) {
|
|
462
|
-
this.
|
|
442
|
+
this.toastr.remove(id);
|
|
463
443
|
}
|
|
464
444
|
removeAllAreNotError() {
|
|
465
445
|
for (const mess of this.messages$.value) {
|
|
466
|
-
if (mess.type !==
|
|
446
|
+
if (mess.type !== MessageType.ERROR) {
|
|
467
447
|
this.remove(mess.options.id);
|
|
468
448
|
}
|
|
469
449
|
}
|
|
470
450
|
}
|
|
471
|
-
addIcon(notification, icon) {
|
|
472
|
-
// There is no way to add an icon to a notification when reating
|
|
473
|
-
// it so we simply set it on the notification directly.
|
|
474
|
-
// See https://github.com/flauc/angular2-notifications/issues/165
|
|
475
|
-
notification.icon = `
|
|
476
|
-
<mat-icon class="material-icons mat-icon mat-list-avatar" svgIcon="${icon}">
|
|
477
|
-
</mat-icon>`;
|
|
478
|
-
}
|
|
479
451
|
handleTemplate(message) {
|
|
480
452
|
if (!this.options.template || message.html) {
|
|
481
453
|
return message;
|
|
@@ -483,22 +455,23 @@ class MessageService {
|
|
|
483
455
|
let html = this.options.template;
|
|
484
456
|
html = html.replace('${text}', message.text);
|
|
485
457
|
html = html.replace('${title}', message.title);
|
|
486
|
-
html =
|
|
487
|
-
message.
|
|
488
|
-
message.text = undefined;
|
|
458
|
+
message.html = undefined;
|
|
459
|
+
message.text = html;
|
|
489
460
|
message.title = undefined;
|
|
490
|
-
message.icon = undefined;
|
|
491
461
|
return message;
|
|
492
462
|
}
|
|
493
463
|
}
|
|
494
|
-
MessageService.ɵfac = function MessageService_Factory(t) { return new (t || MessageService)(i0.ɵɵinject(
|
|
464
|
+
MessageService.ɵfac = function MessageService_Factory(t) { return new (t || MessageService)(i0.ɵɵinject(Injector), i0.ɵɵinject(ConfigService), i0.ɵɵinject(LanguageService)); };
|
|
495
465
|
MessageService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: MessageService, factory: MessageService.ɵfac, providedIn: 'root' });
|
|
496
466
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MessageService, [{
|
|
497
467
|
type: Injectable,
|
|
498
468
|
args: [{
|
|
499
469
|
providedIn: 'root'
|
|
500
470
|
}]
|
|
501
|
-
}], function () { return [{ type:
|
|
471
|
+
}], function () { return [{ type: i0.Injector, decorators: [{
|
|
472
|
+
type: Inject,
|
|
473
|
+
args: [Injector]
|
|
474
|
+
}] }, { type: ConfigService }, { type: LanguageService }]; }, null); })();
|
|
502
475
|
|
|
503
476
|
class ErrorInterceptor {
|
|
504
477
|
constructor(messageService, injector) {
|
|
@@ -601,7 +574,7 @@ class IgoCoreModule {
|
|
|
601
574
|
};
|
|
602
575
|
}
|
|
603
576
|
}
|
|
604
|
-
IgoCoreModule.ɵfac = function IgoCoreModule_Factory(t) { return new (t || IgoCoreModule)(i0.ɵɵinject(i1$2.MatIconRegistry), i0.ɵɵinject(i2
|
|
577
|
+
IgoCoreModule.ɵfac = function IgoCoreModule_Factory(t) { return new (t || IgoCoreModule)(i0.ɵɵinject(i1$2.MatIconRegistry), i0.ɵɵinject(i2.DomSanitizer)); };
|
|
605
578
|
IgoCoreModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: IgoCoreModule });
|
|
606
579
|
IgoCoreModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [[
|
|
607
580
|
CommonModule,
|
|
@@ -637,7 +610,7 @@ IgoCoreModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [[
|
|
|
637
610
|
IgoMessageModule
|
|
638
611
|
]
|
|
639
612
|
}]
|
|
640
|
-
}], function () { return [{ type: i1$2.MatIconRegistry }, { type: i2
|
|
613
|
+
}], function () { return [{ type: i1$2.MatIconRegistry }, { type: i2.DomSanitizer }]; }, null); })();
|
|
641
614
|
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(IgoCoreModule, { imports: [CommonModule,
|
|
642
615
|
HttpClientModule, IgoActivityModule, IgoConfigModule, IgoErrorModule, IgoLanguageModule, IgoMessageModule], exports: [IgoActivityModule,
|
|
643
616
|
IgoConfigModule,
|
|
@@ -743,7 +716,8 @@ function provideRouteServiceOptions(options) {
|
|
|
743
716
|
};
|
|
744
717
|
}
|
|
745
718
|
class RouteService {
|
|
746
|
-
constructor(route, options) {
|
|
719
|
+
constructor(router, route, options) {
|
|
720
|
+
this.router = router;
|
|
747
721
|
this.route = route;
|
|
748
722
|
const defaultOptions = {
|
|
749
723
|
centerKey: 'center',
|
|
@@ -771,17 +745,31 @@ class RouteService {
|
|
|
771
745
|
this.options = Object.assign({}, defaultOptions, options);
|
|
772
746
|
}
|
|
773
747
|
get queryParams() {
|
|
748
|
+
let url = decodeURIComponent(location.search);
|
|
749
|
+
if (url.includes('¢er=')) {
|
|
750
|
+
url = url.replace('¢er', '¢er');
|
|
751
|
+
const queryParams = url
|
|
752
|
+
.slice(1)
|
|
753
|
+
.split('&')
|
|
754
|
+
.map(p => p.split('='))
|
|
755
|
+
.reduce((obj, pair) => {
|
|
756
|
+
const [key, value] = pair.map(decodeURIComponent);
|
|
757
|
+
obj[key] = value;
|
|
758
|
+
return obj;
|
|
759
|
+
}, {});
|
|
760
|
+
this.router.navigate([], { queryParams });
|
|
761
|
+
}
|
|
774
762
|
return this.route.queryParams;
|
|
775
763
|
}
|
|
776
764
|
}
|
|
777
|
-
RouteService.ɵfac = function RouteService_Factory(t) { return new (t || RouteService)(i0.ɵɵinject(i1$3.ActivatedRoute), i0.ɵɵinject(ROUTE_SERVICE_OPTIONS, 8)); };
|
|
765
|
+
RouteService.ɵfac = function RouteService_Factory(t) { return new (t || RouteService)(i0.ɵɵinject(i1$3.Router), i0.ɵɵinject(i1$3.ActivatedRoute), i0.ɵɵinject(ROUTE_SERVICE_OPTIONS, 8)); };
|
|
778
766
|
RouteService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: RouteService, factory: RouteService.ɵfac, providedIn: 'root' });
|
|
779
767
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(RouteService, [{
|
|
780
768
|
type: Injectable,
|
|
781
769
|
args: [{
|
|
782
770
|
providedIn: 'root'
|
|
783
771
|
}]
|
|
784
|
-
}], function () { return [{ type: i1$3.ActivatedRoute }, { type: undefined, decorators: [{
|
|
772
|
+
}], function () { return [{ type: i1$3.Router }, { type: i1$3.ActivatedRoute }, { type: undefined, decorators: [{
|
|
785
773
|
type: Inject,
|
|
786
774
|
args: [ROUTE_SERVICE_OPTIONS]
|
|
787
775
|
}, {
|
|
@@ -1040,18 +1028,26 @@ class NetworkService {
|
|
|
1040
1028
|
}
|
|
1041
1029
|
checkNetworkState() {
|
|
1042
1030
|
this.onlineSubscription = fromEvent(window, 'online').subscribe(() => {
|
|
1031
|
+
if (this.previousMessageId) {
|
|
1032
|
+
this.messageService.remove(this.previousMessageId);
|
|
1033
|
+
}
|
|
1043
1034
|
const translate = this.injector.get(LanguageService).translate;
|
|
1044
1035
|
const message = translate.instant('igo.core.network.online.message');
|
|
1045
1036
|
const title = translate.instant('igo.core.network.online.title');
|
|
1046
|
-
this.messageService.info(message, title);
|
|
1037
|
+
const messageObj = this.messageService.info(message, title);
|
|
1038
|
+
this.previousMessageId = messageObj.toastId;
|
|
1047
1039
|
this.state.connection = true;
|
|
1048
1040
|
this.emitEvent();
|
|
1049
1041
|
});
|
|
1050
1042
|
this.offlineSubscription = fromEvent(window, 'offline').subscribe(() => {
|
|
1043
|
+
if (this.previousMessageId) {
|
|
1044
|
+
this.messageService.remove(this.previousMessageId);
|
|
1045
|
+
}
|
|
1051
1046
|
const translate = this.injector.get(LanguageService).translate;
|
|
1052
1047
|
const message = translate.instant('igo.core.network.offline.message');
|
|
1053
1048
|
const title = translate.instant('igo.core.network.offline.title');
|
|
1054
|
-
this.messageService.info(message, title);
|
|
1049
|
+
const messageObj = this.messageService.info(message, title);
|
|
1050
|
+
this.previousMessageId = messageObj.toastId;
|
|
1055
1051
|
this.state.connection = false;
|
|
1056
1052
|
this.emitEvent();
|
|
1057
1053
|
});
|
|
@@ -1089,5 +1085,5 @@ NetworkService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: NetworkSe
|
|
|
1089
1085
|
* Generated bundle index. Do not edit.
|
|
1090
1086
|
*/
|
|
1091
1087
|
|
|
1092
|
-
export { ActivityInterceptor, ActivityService, AnalyticsService, CONFIG_OPTIONS, ConfigService, ErrorInterceptor, IgoActivityModule, IgoConfigModule, IgoCoreModule, IgoErrorModule, IgoGestureConfig, IgoGestureModule, IgoLanguageModule, IgoLoggingModule, IgoMessageModule, IgoMissingTranslationHandler, LanguageLoader, LanguageService, LoggingInterceptor, Media, MediaOrientation, MediaService,
|
|
1088
|
+
export { ActivityInterceptor, ActivityService, AnalyticsService, CONFIG_OPTIONS, ConfigService, ErrorInterceptor, IgoActivityModule, IgoConfigModule, IgoCoreModule, IgoErrorModule, IgoGestureConfig, IgoGestureModule, IgoLanguageModule, IgoLoggingModule, IgoMessageModule, IgoMissingTranslationHandler, LanguageLoader, LanguageService, LoggingInterceptor, Media, MediaOrientation, MediaService, MessageService, MessageType, NetworkService, ROUTE_SERVICE_OPTIONS, RouteService, StorageScope, StorageService, StorageServiceEventEnum, configFactory, defaultLanguageLoader, provideConfigLoader, provideConfigOptions, provideDefaultLanguageLoader, provideLanguageLoader, provideRouteServiceOptions, version };
|
|
1093
1089
|
//# sourceMappingURL=igo2-core.js.map
|