@mosa-ng/core 19.0.0 → 20.0.1

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 (53) hide show
  1. package/fesm2022/mosa-ng-core.mjs +126 -240
  2. package/fesm2022/mosa-ng-core.mjs.map +1 -1
  3. package/index.d.ts +816 -3
  4. package/package.json +3 -3
  5. package/lib/constants/local-storage.constant.d.ts +0 -2
  6. package/lib/enums/browser.enum.d.ts +0 -9
  7. package/lib/enums/content-position.enum.d.ts +0 -11
  8. package/lib/enums/i18n-supported.enum.d.ts +0 -10
  9. package/lib/enums/theme.enum.d.ts +0 -4
  10. package/lib/models/api-options.model.d.ts +0 -17
  11. package/lib/models/dictionary-item.model.d.ts +0 -7
  12. package/lib/models/key-map.model.d.ts +0 -3
  13. package/lib/models/logger/log-event.model.d.ts +0 -7
  14. package/lib/models/logger/log-message-data.model.d.ts +0 -4
  15. package/lib/models/logger/log-type.model.d.ts +0 -1
  16. package/lib/models/logger/log.model.d.ts +0 -9
  17. package/lib/models/logger/logger-base-config.model.d.ts +0 -8
  18. package/lib/models/logger/logger-config.model.d.ts +0 -8
  19. package/lib/models/logger/logger-default-config.model.d.ts +0 -4
  20. package/lib/models/mosa-duration.model.d.ts +0 -1
  21. package/lib/models/sieve/sieve-filter.model.d.ts +0 -9
  22. package/lib/models/sieve/sieve-operator.model.d.ts +0 -69
  23. package/lib/models/sieve/sieve-options.model.d.ts +0 -12
  24. package/lib/models/sieve/sieve-response.model.d.ts +0 -4
  25. package/lib/models/sieve/sieve-sort.model.d.ts +0 -7
  26. package/lib/models/token-settings.model.d.ts +0 -5
  27. package/lib/models/transform-matrix.model.d.ts +0 -5
  28. package/lib/mosa-core.module.d.ts +0 -80
  29. package/lib/pipes/dictionary-item-pipe/dictionary-item-pipe.module.d.ts +0 -8
  30. package/lib/pipes/dictionary-item-pipe/dictionary-item.pipe.d.ts +0 -8
  31. package/lib/pipes/find-in-array/find-in-array-pipe.module.d.ts +0 -8
  32. package/lib/pipes/find-in-array/find-in-array.pipe.d.ts +0 -7
  33. package/lib/pipes/join/join-pipe.module.d.ts +0 -8
  34. package/lib/pipes/join/join.pipe.d.ts +0 -13
  35. package/lib/pipes/mosa-date-pipe/mosa-date-pipe.module.d.ts +0 -8
  36. package/lib/pipes/mosa-date-pipe/mosa-date.pipe.d.ts +0 -18
  37. package/lib/pipes/mosa-duration-pipe/mosa-duration-pipe.module.d.ts +0 -8
  38. package/lib/pipes/mosa-duration-pipe/mosa-duration.pipe.d.ts +0 -27
  39. package/lib/services/api.service.d.ts +0 -110
  40. package/lib/services/core-logger.service.d.ts +0 -80
  41. package/lib/services/guards/can-deactivate.guard.d.ts +0 -11
  42. package/lib/services/mosa-socket.service.d.ts +0 -11
  43. package/lib/services/translation/assets-i18n-loader.service.d.ts +0 -16
  44. package/lib/services/translation/custom-translate-loader.service.d.ts +0 -9
  45. package/lib/services/translation/translate-collector.service.d.ts +0 -15
  46. package/lib/utils/commons.util.d.ts +0 -47
  47. package/lib/utils/dictionary.util.d.ts +0 -70
  48. package/lib/utils/item.util.d.ts +0 -4
  49. package/lib/utils/promise.util.d.ts +0 -2
  50. package/lib/utils/prototypes.util.d.ts +0 -80
  51. package/lib/utils/sieve.util.d.ts +0 -71
  52. package/lib/utils/size.util.d.ts +0 -4
  53. package/public-api.d.ts +0 -1
@@ -1,12 +1,11 @@
1
- import * as i2 from '@angular/common';
2
- import { CommonModule, DatePipe } from '@angular/common';
3
1
  import * as i0 from '@angular/core';
4
- import { Injectable, Pipe, NgModule, provideAppInitializer, inject } from '@angular/core';
2
+ import { Injectable, Pipe, makeEnvironmentProviders, provideAppInitializer, inject } from '@angular/core';
5
3
  import { firstValueFrom, of, BehaviorSubject, throwError, Observable, Subject } from 'rxjs';
6
4
  import { share, tap, catchError, map } from 'rxjs/operators';
7
5
  import * as i1$1 from '@angular/common/http';
8
6
  import { HttpErrorResponse, HttpResponse, HttpHeaders } from '@angular/common/http';
9
7
  import * as i1 from '@ngx-translate/core';
8
+ import * as i2 from '@angular/common';
10
9
 
11
10
  /**
12
11
  * Checks if an object is null or undefined. Does not check for
@@ -67,6 +66,13 @@ function getTransformMatrix(element) {
67
66
  z: transform[2],
68
67
  };
69
68
  }
69
+ function some(item, searchValue, searchKey) {
70
+ let searchValues = searchValue;
71
+ if (!Array.isArray(searchValue)) {
72
+ searchValues = [searchValue];
73
+ }
74
+ return searchValues.includes(searchKey ? item[searchKey] : item);
75
+ }
70
76
  /**
71
77
  * Generates a random string with numbers and letters
72
78
  * @param length
@@ -88,7 +94,7 @@ function tryJsonParse(data, fallback) {
88
94
  return JSON.parse(data);
89
95
  }
90
96
  }
91
- catch (err) {
97
+ catch {
92
98
  // Ignore - go on with fallback check
93
99
  }
94
100
  if (fallback) {
@@ -151,10 +157,10 @@ class TranslateCollectorService {
151
157
  localStorage.setItem(MOSA_MERGED_TRANSLATION(lang), JSON.stringify(merged));
152
158
  this.myTranslateService.reloadLang(lang);
153
159
  }
154
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: TranslateCollectorService, deps: [{ token: i1.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable }); }
155
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: TranslateCollectorService, providedIn: 'root' }); }
160
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: TranslateCollectorService, deps: [{ token: i1.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable }); }
161
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: TranslateCollectorService, providedIn: 'root' }); }
156
162
  }
157
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: TranslateCollectorService, decorators: [{
163
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: TranslateCollectorService, decorators: [{
158
164
  type: Injectable,
159
165
  args: [{
160
166
  providedIn: 'root',
@@ -202,10 +208,10 @@ class AssetsI18nLoaderService {
202
208
  return of(null);
203
209
  }));
204
210
  }
205
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: AssetsI18nLoaderService, deps: [{ token: i1$1.HttpClient }, { token: TranslateCollectorService }], target: i0.ɵɵFactoryTarget.Injectable }); }
206
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: AssetsI18nLoaderService, providedIn: 'root' }); }
211
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: AssetsI18nLoaderService, deps: [{ token: i1$1.HttpClient }, { token: TranslateCollectorService }], target: i0.ɵɵFactoryTarget.Injectable }); }
212
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: AssetsI18nLoaderService, providedIn: 'root' }); }
207
213
  }
208
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: AssetsI18nLoaderService, decorators: [{
214
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: AssetsI18nLoaderService, decorators: [{
209
215
  type: Injectable,
210
216
  args: [{
211
217
  providedIn: 'root',
@@ -249,7 +255,7 @@ class CoreLoggerService {
249
255
  else if (err.error?.message) {
250
256
  msg = err.error.message;
251
257
  }
252
- else if (err.error?.errors && err.error?.errors[0]?.message) {
258
+ else if (err.error?.errors?.[0]?.message) {
253
259
  msg = err.error.errors[0].message;
254
260
  }
255
261
  else if (err.message) {
@@ -394,10 +400,10 @@ class CoreLoggerService {
394
400
  }
395
401
  return val;
396
402
  }
397
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CoreLoggerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
398
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CoreLoggerService, providedIn: 'root' }); }
403
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: CoreLoggerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
404
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: CoreLoggerService, providedIn: 'root' }); }
399
405
  }
400
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CoreLoggerService, decorators: [{
406
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: CoreLoggerService, decorators: [{
401
407
  type: Injectable,
402
408
  args: [{
403
409
  providedIn: 'root',
@@ -542,7 +548,7 @@ class ApiService {
542
548
  delete(url, headers, options) {
543
549
  options = ApiService.serializeOptions(options);
544
550
  headers = this.getHeaders(headers, options);
545
- // eslint-disable-next-line @typescript-eslint/ban-types
551
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
546
552
  return this.myHttpClient.delete(url, { ...options.httpOptions, headers })
547
553
  .pipe(catchError((err) => this.handleError(err, options)));
548
554
  }
@@ -573,7 +579,7 @@ class ApiService {
573
579
  if (!options?.skipErrorHandling) {
574
580
  this.myCoreLoggerService.logError({ msg: err });
575
581
  }
576
- return throwError(err);
582
+ return throwError(() => err);
577
583
  }
578
584
  handleResponse(response) {
579
585
  if (response instanceof HttpResponse) {
@@ -611,10 +617,10 @@ class ApiService {
611
617
  }
612
618
  return options;
613
619
  }
614
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ApiService, deps: [{ token: CoreLoggerService }, { token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
615
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ApiService, providedIn: 'root' }); }
620
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: ApiService, deps: [{ token: CoreLoggerService }, { token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
621
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: ApiService, providedIn: 'root' }); }
616
622
  }
617
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ApiService, decorators: [{
623
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: ApiService, decorators: [{
618
624
  type: Injectable,
619
625
  args: [{
620
626
  providedIn: 'root',
@@ -652,10 +658,10 @@ class MosaSocketService {
652
658
  };
653
659
  return Subject.create(observer, observable);
654
660
  }
655
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: MosaSocketService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
656
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: MosaSocketService, providedIn: 'root' }); }
661
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: MosaSocketService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
662
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: MosaSocketService, providedIn: 'root' }); }
657
663
  }
658
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: MosaSocketService, decorators: [{
664
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: MosaSocketService, decorators: [{
659
665
  type: Injectable,
660
666
  args: [{
661
667
  providedIn: 'root',
@@ -675,10 +681,10 @@ class CustomTranslateLoaderService {
675
681
  const defaultTranslation = localStorage.getItem(MOSA_FALLBACK_TRANSLATION);
676
682
  return isNullOrEmpty(defaultTranslation) ? {} : JSON.parse(defaultTranslation);
677
683
  }
678
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CustomTranslateLoaderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
679
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CustomTranslateLoaderService, providedIn: 'root' }); }
684
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: CustomTranslateLoaderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
685
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: CustomTranslateLoaderService, providedIn: 'root' }); }
680
686
  }
681
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CustomTranslateLoaderService, decorators: [{
687
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: CustomTranslateLoaderService, decorators: [{
682
688
  type: Injectable,
683
689
  args: [{
684
690
  providedIn: 'root',
@@ -689,10 +695,10 @@ class CanDeactivateGuard {
689
695
  canDeactivate(component) {
690
696
  return component.canDeactivate ? component.canDeactivate() : true;
691
697
  }
692
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CanDeactivateGuard, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
693
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CanDeactivateGuard, providedIn: 'root' }); }
698
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: CanDeactivateGuard, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
699
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: CanDeactivateGuard, providedIn: 'root' }); }
694
700
  }
695
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CanDeactivateGuard, decorators: [{
701
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: CanDeactivateGuard, decorators: [{
696
702
  type: Injectable,
697
703
  args: [{
698
704
  providedIn: 'root',
@@ -818,7 +824,6 @@ class Dictionary {
818
824
  }
819
825
  }
820
826
 
821
- /* eslint-disable @typescript-eslint/unbound-method */
822
827
  /**
823
828
  * Cast any type
824
829
  * @param data to be casted
@@ -847,7 +852,7 @@ class StringExtensions {
847
852
  try {
848
853
  str = JSON.parse(str);
849
854
  }
850
- catch (e) {
855
+ catch {
851
856
  return null;
852
857
  }
853
858
  if (typeof str === 'object') {
@@ -1071,6 +1076,81 @@ var Browser;
1071
1076
  Browser[Browser["other"] = 6] = "other";
1072
1077
  })(Browser || (Browser = {}));
1073
1078
 
1079
+ class DictionaryItemPipe {
1080
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1081
+ transform(key, dictionary) {
1082
+ return dictionary.get(key)?.value;
1083
+ }
1084
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: DictionaryItemPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1085
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.11", ngImport: i0, type: DictionaryItemPipe, isStandalone: true, name: "dictionaryItem" }); }
1086
+ }
1087
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: DictionaryItemPipe, decorators: [{
1088
+ type: Pipe,
1089
+ args: [{ name: 'dictionaryItem' }]
1090
+ }] });
1091
+
1092
+ class FilterPipe {
1093
+ transform(array, searchValue, searchKey) {
1094
+ // Return if array is empty or null
1095
+ if (!array?.length) {
1096
+ return [];
1097
+ }
1098
+ const foundItems = array.filter((v) => some(v, searchValue, searchKey));
1099
+ if (!foundItems.length) {
1100
+ return [];
1101
+ }
1102
+ // Return whole item
1103
+ return foundItems;
1104
+ }
1105
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: FilterPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1106
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.11", ngImport: i0, type: FilterPipe, isStandalone: true, name: "filter" }); }
1107
+ }
1108
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: FilterPipe, decorators: [{
1109
+ type: Pipe,
1110
+ args: [{ name: 'filter' }]
1111
+ }] });
1112
+
1113
+ class FindPipe {
1114
+ transform(array, searchValue, searchKey) {
1115
+ // Return if array is empty or null
1116
+ if (!array?.length) {
1117
+ return null;
1118
+ }
1119
+ const foundItem = array.find((v) => some(v, searchValue, searchKey));
1120
+ if (!foundItem) {
1121
+ return null;
1122
+ }
1123
+ // Return whole item
1124
+ return foundItem;
1125
+ }
1126
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: FindPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1127
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.11", ngImport: i0, type: FindPipe, isStandalone: true, name: "find" }); }
1128
+ }
1129
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: FindPipe, decorators: [{
1130
+ type: Pipe,
1131
+ args: [{ name: 'find' }]
1132
+ }] });
1133
+
1134
+ class JoinPipe {
1135
+ /**
1136
+ * Join array by separator
1137
+ * @param array
1138
+ * @param returnField
1139
+ * @param separator
1140
+ */
1141
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1142
+ transform(array, returnField, separator = ', ') {
1143
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1144
+ return array.map((val) => returnField ? val[returnField] : val).join(separator);
1145
+ }
1146
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: JoinPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1147
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.11", ngImport: i0, type: JoinPipe, isStandalone: true, name: "join" }); }
1148
+ }
1149
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: JoinPipe, decorators: [{
1150
+ type: Pipe,
1151
+ args: [{ name: 'join' }]
1152
+ }] });
1153
+
1074
1154
  class MosaDatePipe {
1075
1155
  constructor(myTranslateService, myDatePipe) {
1076
1156
  this.myTranslateService = myTranslateService;
@@ -1127,7 +1207,7 @@ class MosaDatePipe {
1127
1207
  return convertedDate;
1128
1208
  }
1129
1209
  template(key, val) {
1130
- return this.templates[key] && this.templates[key].replace(/%d/i, String(Math.abs(Math.round(val))));
1210
+ return this.templates[key]?.replace(/%d/i, String(Math.abs(Math.round(val))));
1131
1211
  }
1132
1212
  updateTemplates() {
1133
1213
  this.templates = {
@@ -1146,68 +1226,14 @@ class MosaDatePipe {
1146
1226
  years: this.myTranslateService.instant('mosa.pipes.timeSince.years'),
1147
1227
  };
1148
1228
  }
1149
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: MosaDatePipe, deps: [{ token: i1.TranslateService }, { token: i2.DatePipe }], target: i0.ɵɵFactoryTarget.Pipe }); }
1150
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.5", ngImport: i0, type: MosaDatePipe, isStandalone: false, name: "mosaDate" }); }
1229
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: MosaDatePipe, deps: [{ token: i1.TranslateService }, { token: i2.DatePipe }], target: i0.ɵɵFactoryTarget.Pipe }); }
1230
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.11", ngImport: i0, type: MosaDatePipe, isStandalone: true, name: "mosaDate" }); }
1151
1231
  }
1152
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: MosaDatePipe, decorators: [{
1232
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: MosaDatePipe, decorators: [{
1153
1233
  type: Pipe,
1154
- args: [{
1155
- name: 'mosaDate',
1156
- standalone: false,
1157
- }]
1234
+ args: [{ name: 'mosaDate' }]
1158
1235
  }], ctorParameters: () => [{ type: i1.TranslateService }, { type: i2.DatePipe }] });
1159
1236
 
1160
- class MosaDatePipeModule {
1161
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: MosaDatePipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1162
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.5", ngImport: i0, type: MosaDatePipeModule, declarations: [MosaDatePipe], imports: [CommonModule], exports: [MosaDatePipe] }); }
1163
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: MosaDatePipeModule, providers: [DatePipe], imports: [CommonModule] }); }
1164
- }
1165
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: MosaDatePipeModule, decorators: [{
1166
- type: NgModule,
1167
- args: [{
1168
- declarations: [MosaDatePipe],
1169
- imports: [
1170
- CommonModule,
1171
- ],
1172
- exports: [MosaDatePipe],
1173
- providers: [DatePipe],
1174
- }]
1175
- }] });
1176
-
1177
- class DictionaryItemPipe {
1178
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1179
- transform(key, dictionary) {
1180
- return dictionary.get(key)?.value;
1181
- }
1182
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DictionaryItemPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1183
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.5", ngImport: i0, type: DictionaryItemPipe, isStandalone: false, name: "dictionaryItem" }); }
1184
- }
1185
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DictionaryItemPipe, decorators: [{
1186
- type: Pipe,
1187
- args: [{
1188
- name: 'dictionaryItem',
1189
- standalone: false,
1190
- }]
1191
- }] });
1192
-
1193
- class DictionaryItemPipeModule {
1194
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DictionaryItemPipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1195
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.5", ngImport: i0, type: DictionaryItemPipeModule, declarations: [DictionaryItemPipe], imports: [CommonModule], exports: [DictionaryItemPipe] }); }
1196
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DictionaryItemPipeModule, imports: [CommonModule] }); }
1197
- }
1198
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DictionaryItemPipeModule, decorators: [{
1199
- type: NgModule,
1200
- args: [{
1201
- declarations: [DictionaryItemPipe],
1202
- imports: [
1203
- CommonModule,
1204
- ],
1205
- exports: [
1206
- DictionaryItemPipe,
1207
- ],
1208
- }]
1209
- }] });
1210
-
1211
1237
  class MosaDurationPipe {
1212
1238
  constructor(myTranslateService) {
1213
1239
  this.myTranslateService = myTranslateService;
@@ -1281,168 +1307,28 @@ class MosaDurationPipe {
1281
1307
  }
1282
1308
  return null;
1283
1309
  }
1284
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: MosaDurationPipe, deps: [{ token: i1.TranslateService }], target: i0.ɵɵFactoryTarget.Pipe }); }
1285
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.5", ngImport: i0, type: MosaDurationPipe, isStandalone: false, name: "mosaDuration" }); }
1310
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: MosaDurationPipe, deps: [{ token: i1.TranslateService }], target: i0.ɵɵFactoryTarget.Pipe }); }
1311
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.11", ngImport: i0, type: MosaDurationPipe, isStandalone: true, name: "mosaDuration" }); }
1286
1312
  }
1287
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: MosaDurationPipe, decorators: [{
1313
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: MosaDurationPipe, decorators: [{
1288
1314
  type: Pipe,
1289
- args: [{
1290
- name: 'mosaDuration',
1291
- standalone: false,
1292
- }]
1315
+ args: [{ name: 'mosaDuration' }]
1293
1316
  }], ctorParameters: () => [{ type: i1.TranslateService }] });
1294
1317
 
1295
- class MosaDurationPipeModule {
1296
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: MosaDurationPipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1297
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.5", ngImport: i0, type: MosaDurationPipeModule, declarations: [MosaDurationPipe], imports: [CommonModule], exports: [MosaDurationPipe] }); }
1298
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: MosaDurationPipeModule, imports: [CommonModule] }); }
1299
- }
1300
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: MosaDurationPipeModule, decorators: [{
1301
- type: NgModule,
1302
- args: [{
1303
- declarations: [MosaDurationPipe],
1304
- imports: [
1305
- CommonModule,
1306
- ],
1307
- exports: [MosaDurationPipe],
1308
- }]
1309
- }] });
1310
-
1311
- class FindInArrayPipe {
1312
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1313
- transform(searchValue, array, searchKey, returnElements) {
1314
- // Return if array is empty or null
1315
- if (!array || !array.length) {
1316
- return null;
1317
- }
1318
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1319
- const foundItem = array.find((val) => (searchKey ? val[searchKey] : val) === searchValue);
1320
- if (!foundItem) {
1321
- return null;
1322
- }
1323
- // Return whole item
1324
- if (!returnElements) {
1325
- return foundItem;
1326
- }
1327
- if (returnElements.length === 1) {
1328
- return foundItem[returnElements[0]];
1329
- }
1330
- // Return given values to the keys
1331
- return returnElements.map((val) => foundItem[val]);
1332
- }
1333
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: FindInArrayPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1334
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.5", ngImport: i0, type: FindInArrayPipe, isStandalone: false, name: "findInArray" }); }
1335
- }
1336
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: FindInArrayPipe, decorators: [{
1337
- type: Pipe,
1338
- args: [{
1339
- name: 'findInArray',
1340
- standalone: false,
1341
- }]
1342
- }] });
1343
-
1344
- class FindInArrayPipeModule {
1345
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: FindInArrayPipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1346
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.5", ngImport: i0, type: FindInArrayPipeModule, declarations: [FindInArrayPipe], imports: [CommonModule], exports: [FindInArrayPipe] }); }
1347
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: FindInArrayPipeModule, imports: [CommonModule] }); }
1348
- }
1349
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: FindInArrayPipeModule, decorators: [{
1350
- type: NgModule,
1351
- args: [{
1352
- declarations: [
1353
- FindInArrayPipe,
1354
- ],
1355
- imports: [
1356
- CommonModule,
1357
- ],
1358
- exports: [
1359
- FindInArrayPipe,
1360
- ],
1361
- }]
1362
- }] });
1363
-
1364
- class JoinPipe {
1365
- /**
1366
- * Join array by separator
1367
- * @param array
1368
- * @param returnField
1369
- * @param separator
1370
- */
1371
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1372
- transform(array, returnField, separator = ', ') {
1373
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1374
- return array.map((val) => returnField ? val[returnField] : val).join(separator);
1375
- }
1376
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: JoinPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1377
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.5", ngImport: i0, type: JoinPipe, isStandalone: false, name: "join" }); }
1378
- }
1379
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: JoinPipe, decorators: [{
1380
- type: Pipe,
1381
- args: [{
1382
- name: 'join',
1383
- standalone: false,
1384
- }]
1385
- }] });
1386
-
1387
- class JoinPipeModule {
1388
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: JoinPipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1389
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.5", ngImport: i0, type: JoinPipeModule, declarations: [JoinPipe], imports: [CommonModule], exports: [JoinPipe] }); }
1390
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: JoinPipeModule, imports: [CommonModule] }); }
1391
- }
1392
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: JoinPipeModule, decorators: [{
1393
- type: NgModule,
1394
- args: [{
1395
- declarations: [
1396
- JoinPipe,
1397
- ],
1398
- exports: [
1399
- JoinPipe,
1400
- ],
1401
- imports: [
1402
- CommonModule,
1403
- ],
1404
- }]
1405
- }] });
1406
-
1407
1318
  function initI18n(i18n) {
1408
- return () => i18n.init(null, null, 1);
1319
+ return i18n.init(null, null, 1);
1409
1320
  }
1410
1321
  function initI18nCore(i18n) {
1411
- return () => i18n.init(null, 'mosa');
1412
- }
1413
- class MosaCoreModule {
1414
- static forRoot() {
1415
- return {
1416
- ngModule: MosaCoreModule,
1417
- providers: [
1418
- provideAppInitializer(() => {
1419
- const initializerFn = (initI18n)(inject(AssetsI18nLoaderService));
1420
- return initializerFn();
1421
- }),
1422
- provideAppInitializer(() => {
1423
- const initializerFn = (initI18nCore)(inject(AssetsI18nLoaderService));
1424
- return initializerFn();
1425
- }),
1426
- ],
1427
- };
1428
- }
1429
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: MosaCoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1430
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.5", ngImport: i0, type: MosaCoreModule, imports: [CommonModule] }); }
1431
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: MosaCoreModule, imports: [CommonModule] }); }
1322
+ return i18n.init(null, 'mosa');
1432
1323
  }
1433
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: MosaCoreModule, decorators: [{
1434
- type: NgModule,
1435
- args: [{
1436
- declarations: [],
1437
- imports: [
1438
- CommonModule,
1439
- ],
1440
- }]
1441
- }] });
1324
+ const provideMosaCore = () => makeEnvironmentProviders([
1325
+ provideAppInitializer(() => initI18n(inject(AssetsI18nLoaderService))),
1326
+ provideAppInitializer(() => initI18nCore(inject(AssetsI18nLoaderService))),
1327
+ ]);
1442
1328
 
1443
1329
  /**
1444
1330
  * Generated bundle index. Do not edit.
1445
1331
  */
1446
1332
 
1447
- export { ApiService, ArrayExtensions, AssetsI18nLoaderService, Browser, CanDeactivateGuard, ContentPosition, CoreLoggerService, CustomTranslateLoaderService, Dictionary, DictionaryItemPipe, DictionaryItemPipeModule, FindInArrayPipe, FindInArrayPipeModule, I18nSupported, JoinPipe, JoinPipeModule, LOCAL_STORAGE_TOKEN_KEY, MOSA_FALLBACK_TRANSLATION, MOSA_MERGED_TRANSLATION, MosaCoreModule, MosaDatePipe, MosaDatePipeModule, MosaDurationPipe, MosaDurationPipeModule, MosaSocketService, NumberExtensions, Prototypes, Sieve, StringExtensions, Theme, TranslateCollectorService, cast, getRandomString, getTransformMatrix, initI18n, initI18nCore, isNullOrEmpty, isNullOrUndefined, isNumber, isZeroOrHigher, mergeArray, roundNearest, tryJsonParse };
1333
+ export { ApiService, ArrayExtensions, AssetsI18nLoaderService, Browser, CanDeactivateGuard, ContentPosition, CoreLoggerService, CustomTranslateLoaderService, Dictionary, DictionaryItemPipe, FilterPipe, FindPipe, I18nSupported, JoinPipe, LOCAL_STORAGE_TOKEN_KEY, MOSA_FALLBACK_TRANSLATION, MOSA_MERGED_TRANSLATION, MosaDatePipe, MosaDurationPipe, MosaSocketService, NumberExtensions, Prototypes, Sieve, StringExtensions, Theme, TranslateCollectorService, cast, getRandomString, getTransformMatrix, isNullOrEmpty, isNullOrUndefined, isNumber, isZeroOrHigher, mergeArray, provideMosaCore, roundNearest, some, tryJsonParse };
1448
1334
  //# sourceMappingURL=mosa-ng-core.mjs.map