@igo2/core 16.0.0-rc.1 → 16.0.0-rc.2
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/esm2022/lib/activity/activity.interceptor.mjs +1 -1
- package/esm2022/lib/activity/activity.module.mjs +2 -2
- package/esm2022/lib/activity/activity.service.mjs +2 -2
- package/esm2022/lib/analytics/shared/analytics.service.mjs +1 -1
- package/esm2022/lib/compression/compression.service.mjs +1 -1
- package/esm2022/lib/config/config-deprecated.mjs +9 -1
- package/esm2022/lib/config/config.interface.mjs +1 -1
- package/esm2022/lib/config/config.module.mjs +2 -2
- package/esm2022/lib/config/config.provider.mjs +1 -1
- package/esm2022/lib/config/config.service.mjs +23 -11
- package/esm2022/lib/config/version.mjs +3 -3
- package/esm2022/lib/core.module.mjs +4 -4
- package/esm2022/lib/environment/environment.interface.mjs +2 -0
- package/esm2022/lib/environment/index.mjs +2 -0
- package/esm2022/lib/gesture/gesture.module.mjs +2 -2
- package/esm2022/lib/language/language.module.mjs +2 -2
- package/esm2022/lib/language/shared/language.loader.mjs +2 -2
- package/esm2022/lib/language/shared/language.provider.mjs +1 -1
- package/esm2022/lib/language/shared/language.service.mjs +1 -1
- package/esm2022/lib/media/media.service.mjs +2 -2
- package/esm2022/lib/message/message.module.mjs +2 -2
- package/esm2022/lib/message/shared/index.mjs +1 -1
- package/esm2022/lib/message/shared/message.interface.mjs +1 -1
- package/esm2022/lib/message/shared/message.service.mjs +14 -8
- package/esm2022/lib/network/network.service.mjs +2 -2
- package/esm2022/lib/regex/regex.service.mjs +1 -1
- package/esm2022/lib/request/error.interceptor.mjs +28 -23
- package/esm2022/lib/request/error.module.mjs +2 -2
- package/esm2022/lib/request/logging.interceptor.mjs +4 -4
- package/esm2022/lib/request/logging.module.mjs +2 -2
- package/esm2022/lib/route/route.service.mjs +2 -2
- package/esm2022/lib/storage/storage.mjs +2 -2
- package/esm2022/lib/storage/storage.service.mjs +1 -1
- package/esm2022/public_api.mjs +2 -1
- package/fesm2022/igo2-core.mjs +83 -53
- package/fesm2022/igo2-core.mjs.map +1 -1
- package/lib/config/config-deprecated.d.ts +1 -1
- package/lib/config/config.interface.d.ts +6 -4
- package/lib/config/config.provider.d.ts +13 -5
- package/lib/config/config.service.d.ts +11 -5
- package/lib/config/version.d.ts +4 -2
- package/lib/core.module.d.ts +1 -1
- package/lib/environment/environment.interface.d.ts +16 -0
- package/lib/environment/index.d.ts +1 -0
- package/lib/message/shared/index.d.ts +0 -1
- package/lib/message/shared/message.interface.d.ts +1 -1
- package/lib/message/shared/message.service.d.ts +3 -3
- package/lib/network/network.service.d.ts +1 -1
- package/lib/request/error.interceptor.d.ts +4 -4
- package/lib/request/logging.interceptor.d.ts +1 -1
- package/lib/storage/storage.d.ts +2 -2
- package/lib/storage/storage.service.d.ts +1 -1
- package/locale/en.json +1 -1
- package/locale/fr.json +1 -1
- package/package.json +2 -2
- package/public_api.d.ts +1 -0
- package/style/all-style.css +0 -1
- package/theming/prebuilt-themes/blue-theme.css +43 -45
- package/theming/prebuilt-themes/bluedark-theme.css +43 -45
- package/theming/prebuilt-themes/bluedq-theme.css +43 -45
- package/theming/prebuilt-themes/bluegrey-theme.css +43 -45
- package/theming/prebuilt-themes/dark-theme.css +43 -45
- package/theming/prebuilt-themes/deeppurple-theme.css +43 -45
- package/theming/prebuilt-themes/indigo-theme.css +43 -45
- package/theming/prebuilt-themes/orange-theme.css +43 -45
- package/theming/prebuilt-themes/qcca/components/scrollbar.scss +6 -6
- package/theming/prebuilt-themes/qcca-theme.css +43 -45
- package/theming/prebuilt-themes/teal-theme.css +43 -45
- package/theming/typography.scss +28 -28
package/fesm2022/igo2-core.mjs
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, NgModule, InjectionToken, APP_INITIALIZER, Injector, Inject, Optional, SkipSelf, EventEmitter } from '@angular/core';
|
|
3
1
|
import { CommonModule } from '@angular/common';
|
|
4
2
|
import * as i1 from '@angular/common/http';
|
|
5
3
|
import { HTTP_INTERCEPTORS, HttpClient, HttpBackend, HttpErrorResponse, HttpClientModule, HttpResponse } from '@angular/common/http';
|
|
4
|
+
import * as i0 from '@angular/core';
|
|
5
|
+
import { Injectable, NgModule, InjectionToken, APP_INITIALIZER, Injector, Inject, Optional, SkipSelf, EventEmitter } from '@angular/core';
|
|
6
|
+
import * as i1$3 from '@angular/material/icon';
|
|
6
7
|
import * as i2 from '@angular/platform-browser';
|
|
7
8
|
import { HammerGestureConfig, HAMMER_GESTURE_CONFIG, HammerModule } from '@angular/platform-browser';
|
|
8
|
-
import * as
|
|
9
|
+
import * as i8 from 'ngx-indexed-db';
|
|
10
|
+
import { NgxIndexedDBModule } from 'ngx-indexed-db';
|
|
9
11
|
import { finalize, catchError, debounceTime, first, tap, startWith } from 'rxjs/operators';
|
|
10
|
-
import { BehaviorSubject, throwError, forkJoin, map, combineLatest, Observable, fromEvent } from 'rxjs';
|
|
11
12
|
import { uuid, ObjectUtils } from '@igo2/utils';
|
|
13
|
+
import { BehaviorSubject, throwError, forkJoin, map, combineLatest, Observable, fromEvent } from 'rxjs';
|
|
12
14
|
import * as i1$1 from '@ngx-translate/core';
|
|
13
15
|
import { TranslateLoader, TranslateModule, MissingTranslationHandler } from '@ngx-translate/core';
|
|
14
16
|
import * as i1$2 from 'ngx-toastr';
|
|
15
17
|
import { ToastrModule, ToastrService } from 'ngx-toastr';
|
|
16
|
-
import * as i8 from 'ngx-indexed-db';
|
|
17
|
-
import { NgxIndexedDBModule } from 'ngx-indexed-db';
|
|
18
18
|
import * as i1$4 from '@angular/router';
|
|
19
19
|
import * as i1$5 from '@angular/cdk/layout';
|
|
20
20
|
import { Breakpoints } from '@angular/cdk/layout';
|
|
@@ -100,11 +100,6 @@ class IgoActivityModule {
|
|
|
100
100
|
}]
|
|
101
101
|
}], null, null); })();
|
|
102
102
|
|
|
103
|
-
const version = {
|
|
104
|
-
lib: '16.0.0-rc.1',
|
|
105
|
-
releaseDate: 1695395320530
|
|
106
|
-
};
|
|
107
|
-
|
|
108
103
|
const CONFIG_DEPRECATED = {
|
|
109
104
|
showMenuButton: {
|
|
110
105
|
alternativeKey: 'menu.button.visible',
|
|
@@ -113,6 +108,14 @@ const CONFIG_DEPRECATED = {
|
|
|
113
108
|
menuButtonReverseColor: {
|
|
114
109
|
alternativeKey: 'menu.button.useThemeColor',
|
|
115
110
|
mayBeRemoveIn: new Date('2024-06-06')
|
|
111
|
+
},
|
|
112
|
+
importWithStyle: {
|
|
113
|
+
alternativeKey: 'importExport.importWithStyle',
|
|
114
|
+
mayBeRemoveIn: new Date('2024-06-06')
|
|
115
|
+
},
|
|
116
|
+
hasGeolocateButton: {
|
|
117
|
+
alternativeKey: 'geolocate.button.visible',
|
|
118
|
+
mayBeRemoveIn: new Date('2024-06-06')
|
|
116
119
|
}
|
|
117
120
|
};
|
|
118
121
|
const ALTERNATE_CONFIG_FROM_DEPRECATION = new Map(Object.entries(CONFIG_DEPRECATED)
|
|
@@ -124,26 +127,43 @@ const ALTERNATE_CONFIG_FROM_DEPRECATION = new Map(Object.entries(CONFIG_DEPRECAT
|
|
|
124
127
|
}
|
|
125
128
|
]));
|
|
126
129
|
|
|
130
|
+
const version = {
|
|
131
|
+
lib: '16.0.0-rc.2',
|
|
132
|
+
releaseDate: 1697030263684
|
|
133
|
+
};
|
|
134
|
+
|
|
127
135
|
class ConfigService {
|
|
128
|
-
config
|
|
136
|
+
config;
|
|
129
137
|
httpClient;
|
|
130
138
|
configDeprecated = new Map(Object.entries(CONFIG_DEPRECATED));
|
|
131
139
|
constructor(handler) {
|
|
132
140
|
this.httpClient = new HttpClient(handler);
|
|
133
141
|
}
|
|
142
|
+
/**
|
|
143
|
+
* Use to get the all config file (merge from environnement.ts and config.json)
|
|
144
|
+
*/
|
|
145
|
+
getConfigs() {
|
|
146
|
+
Array.from(this.configDeprecated.keys()).map((deprecatedKey) => {
|
|
147
|
+
const deprecatedValue = ObjectUtils.resolve(this.config, deprecatedKey);
|
|
148
|
+
if (deprecatedValue !== undefined) {
|
|
149
|
+
this.handleDeprecatedConfig(deprecatedKey);
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
return this.config;
|
|
153
|
+
}
|
|
134
154
|
/**
|
|
135
155
|
* Use to get the data found in config file
|
|
136
156
|
*/
|
|
137
|
-
getConfig(key) {
|
|
138
|
-
|
|
157
|
+
getConfig(key, defaultValue) {
|
|
158
|
+
let value = ObjectUtils.resolve(this.config, key);
|
|
139
159
|
const isDeprecated = this.configDeprecated.get(key);
|
|
140
|
-
if (isDeprecated) {
|
|
160
|
+
if (isDeprecated && value !== undefined) {
|
|
141
161
|
this.handleDeprecatedConfig(key);
|
|
142
162
|
}
|
|
143
163
|
else if (value === undefined) {
|
|
144
|
-
|
|
164
|
+
value = this.handleDeprecationPossibility(key);
|
|
145
165
|
}
|
|
146
|
-
return value;
|
|
166
|
+
return value ?? defaultValue;
|
|
147
167
|
}
|
|
148
168
|
handleDeprecatedConfig(key) {
|
|
149
169
|
const options = this.configDeprecated.get(key);
|
|
@@ -167,7 +187,7 @@ class ConfigService {
|
|
|
167
187
|
* This method loads "[path]" to get all config's variables
|
|
168
188
|
*/
|
|
169
189
|
load(options) {
|
|
170
|
-
const baseConfig = options.default
|
|
190
|
+
const baseConfig = options.default;
|
|
171
191
|
if (!options.path) {
|
|
172
192
|
this.config = baseConfig;
|
|
173
193
|
return true;
|
|
@@ -385,16 +405,6 @@ class IgoMessageModule {
|
|
|
385
405
|
}], null, null); })();
|
|
386
406
|
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(IgoMessageModule, { imports: [CommonModule, i1$2.ToastrModule] }); })();
|
|
387
407
|
|
|
388
|
-
var MessageType;
|
|
389
|
-
(function (MessageType) {
|
|
390
|
-
MessageType["ERROR"] = "error";
|
|
391
|
-
MessageType["ALERT"] = "warning";
|
|
392
|
-
MessageType["WARNING"] = "warning";
|
|
393
|
-
MessageType["INFO"] = "info";
|
|
394
|
-
MessageType["SUCCESS"] = "success";
|
|
395
|
-
MessageType["SHOW"] = "show";
|
|
396
|
-
})(MessageType || (MessageType = {}));
|
|
397
|
-
|
|
398
408
|
class LanguageService {
|
|
399
409
|
translate;
|
|
400
410
|
language;
|
|
@@ -428,6 +438,16 @@ class LanguageService {
|
|
|
428
438
|
}]
|
|
429
439
|
}], function () { return [{ type: i1$1.TranslateService }]; }, null); })();
|
|
430
440
|
|
|
441
|
+
var MessageType;
|
|
442
|
+
(function (MessageType) {
|
|
443
|
+
MessageType["ERROR"] = "error";
|
|
444
|
+
MessageType["ALERT"] = "warning";
|
|
445
|
+
MessageType["WARNING"] = "warning";
|
|
446
|
+
MessageType["INFO"] = "info";
|
|
447
|
+
MessageType["SUCCESS"] = "success";
|
|
448
|
+
MessageType["SHOW"] = "show";
|
|
449
|
+
})(MessageType || (MessageType = {}));
|
|
450
|
+
|
|
431
451
|
class MessageService {
|
|
432
452
|
injector;
|
|
433
453
|
configService;
|
|
@@ -560,17 +580,23 @@ class MessageService {
|
|
|
560
580
|
const translatedTitlenterpolateParams = { ...titleInterpolateParams };
|
|
561
581
|
if (textInterpolateParams) {
|
|
562
582
|
Object.keys(textInterpolateParams).map((k) => {
|
|
563
|
-
|
|
583
|
+
const value = textInterpolateParams[k];
|
|
584
|
+
if (value) {
|
|
564
585
|
translatedTextInterpolateParams[k] =
|
|
565
|
-
|
|
586
|
+
typeof value === 'string'
|
|
587
|
+
? this.languageService.translate.instant(value)
|
|
588
|
+
: value;
|
|
566
589
|
}
|
|
567
590
|
});
|
|
568
591
|
}
|
|
569
592
|
if (titleInterpolateParams) {
|
|
570
593
|
Object.keys(titleInterpolateParams).map((k) => {
|
|
571
594
|
if (k) {
|
|
595
|
+
const value = titleInterpolateParams[k];
|
|
572
596
|
translatedTitlenterpolateParams[k] =
|
|
573
|
-
|
|
597
|
+
typeof value === "string"
|
|
598
|
+
? this.languageService.translate.instant(value)
|
|
599
|
+
: value;
|
|
574
600
|
}
|
|
575
601
|
});
|
|
576
602
|
}
|
|
@@ -637,9 +663,9 @@ class MessageService {
|
|
|
637
663
|
}] }, { type: ConfigService }, { type: LanguageService }]; }, null); })();
|
|
638
664
|
|
|
639
665
|
class ErrorInterceptor {
|
|
640
|
-
|
|
641
|
-
constructor(
|
|
642
|
-
this.
|
|
666
|
+
messageService;
|
|
667
|
+
constructor(messageService) {
|
|
668
|
+
this.messageService = messageService;
|
|
643
669
|
}
|
|
644
670
|
intercept(originalReq, next) {
|
|
645
671
|
const interceptError = originalReq.headers.get('interceptError');
|
|
@@ -651,8 +677,16 @@ class ErrorInterceptor {
|
|
|
651
677
|
}
|
|
652
678
|
const errorContainer = { httpError: undefined };
|
|
653
679
|
return next.handle(req).pipe(catchError((error) => this.handleError(error, errorContainer)), finalize(() => {
|
|
654
|
-
|
|
655
|
-
|
|
680
|
+
const httpError = errorContainer.httpError;
|
|
681
|
+
if (!httpError) {
|
|
682
|
+
return;
|
|
683
|
+
}
|
|
684
|
+
if (httpError.error.toDisplay) {
|
|
685
|
+
this.handleCaughtError(httpError);
|
|
686
|
+
}
|
|
687
|
+
else if (!httpError.error.caught) {
|
|
688
|
+
this.handleUncaughtError(httpError);
|
|
689
|
+
}
|
|
656
690
|
}));
|
|
657
691
|
}
|
|
658
692
|
handleError(httpError, errorContainer) {
|
|
@@ -671,23 +705,19 @@ class ErrorInterceptor {
|
|
|
671
705
|
errorContainer.httpError = httpError;
|
|
672
706
|
return throwError(httpError);
|
|
673
707
|
}
|
|
674
|
-
handleCaughtError(
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
messageService.error(httpError.error.message, httpError.error.title);
|
|
680
|
-
}
|
|
708
|
+
handleCaughtError(httpError) {
|
|
709
|
+
httpError.error.caught = true;
|
|
710
|
+
this.messageService.error(httpError.error.message, httpError.error.title, {
|
|
711
|
+
progressBar: false
|
|
712
|
+
});
|
|
681
713
|
}
|
|
682
|
-
handleUncaughtError(
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
messageService.error('igo.core.errors.uncaught.message', 'igo.core.errors.uncaught.title');
|
|
688
|
-
}
|
|
714
|
+
handleUncaughtError(httpError) {
|
|
715
|
+
httpError.error.caught = true;
|
|
716
|
+
this.messageService.error('igo.core.errors.uncaught.message', 'igo.core.errors.uncaught.title', {
|
|
717
|
+
progressBar: false
|
|
718
|
+
});
|
|
689
719
|
}
|
|
690
|
-
static ɵfac = function ErrorInterceptor_Factory(t) { return new (t || ErrorInterceptor)(i0.ɵɵinject(
|
|
720
|
+
static ɵfac = function ErrorInterceptor_Factory(t) { return new (t || ErrorInterceptor)(i0.ɵɵinject(MessageService)); };
|
|
691
721
|
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ErrorInterceptor, factory: ErrorInterceptor.ɵfac, providedIn: 'root' });
|
|
692
722
|
}
|
|
693
723
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ErrorInterceptor, [{
|
|
@@ -695,7 +725,7 @@ class ErrorInterceptor {
|
|
|
695
725
|
args: [{
|
|
696
726
|
providedIn: 'root'
|
|
697
727
|
}]
|
|
698
|
-
}], function () { return [{ type:
|
|
728
|
+
}], function () { return [{ type: MessageService }]; }, null); })();
|
|
699
729
|
|
|
700
730
|
class IgoErrorModule {
|
|
701
731
|
static forRoot() {
|
|
@@ -868,7 +898,7 @@ class LoggingInterceptor {
|
|
|
868
898
|
// Log when response observable either completes or errors
|
|
869
899
|
finalize(() => {
|
|
870
900
|
const elapsed = Date.now() - started;
|
|
871
|
-
const msg = `${req.method} "${req.urlWithParams}"
|
|
901
|
+
const msg = `${req.method} "${req.urlWithParams}"
|
|
872
902
|
${ok} in ${elapsed} ms.`;
|
|
873
903
|
console.log(msg);
|
|
874
904
|
}));
|