oip-common 0.0.30 → 0.0.31
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/fesm2022/oip-common.mjs +7 -18
- package/fesm2022/oip-common.mjs.map +1 -1
- package/index.d.ts +1 -2
- package/package.json +1 -1
package/fesm2022/oip-common.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, inject, signal, computed, effect, ChangeDetectorRef, Component, Input, PLATFORM_ID, InjectionToken, HostBinding, EventEmitter, Output, ViewChild, Renderer2, Pipe } from '@angular/core';
|
|
2
|
+
import { Injectable, inject, signal, computed, effect, ChangeDetectorRef, Component, Input, PLATFORM_ID, InjectionToken, HostBinding, EventEmitter, Output, ViewChild, Renderer2, ApplicationRef, Pipe } from '@angular/core';
|
|
3
3
|
import * as i2$5 from 'primeng/api';
|
|
4
4
|
import { MessageService, ConfirmationService, PrimeIcons, SharedModule } from 'primeng/api';
|
|
5
5
|
import { HttpErrorResponse, HttpClient as HttpClient$1, HttpHeaders } from '@angular/common/http';
|
|
@@ -3340,7 +3340,7 @@ class L10nService {
|
|
|
3340
3340
|
this.translateService = inject(TranslateService);
|
|
3341
3341
|
this.primeNg = inject(PrimeNG);
|
|
3342
3342
|
this.layoutService = inject(LayoutService);
|
|
3343
|
-
this.
|
|
3343
|
+
this.appRef = inject(ApplicationRef);
|
|
3344
3344
|
}
|
|
3345
3345
|
/**
|
|
3346
3346
|
* Loads translations for a specific component
|
|
@@ -3373,11 +3373,10 @@ class L10nService {
|
|
|
3373
3373
|
const current = this.translateService.translations[lang] || {};
|
|
3374
3374
|
this.translateService.setTranslation(lang, { ...current, ...translations }, true);
|
|
3375
3375
|
this.loadedTranslations.add(key);
|
|
3376
|
-
this.cdf.detectChanges();
|
|
3377
3376
|
});
|
|
3378
3377
|
}
|
|
3379
3378
|
catch (e) {
|
|
3380
|
-
console.
|
|
3379
|
+
console.error(`No translations found for ${component}.${lang}.json`);
|
|
3381
3380
|
console.error(e);
|
|
3382
3381
|
}
|
|
3383
3382
|
}
|
|
@@ -3395,9 +3394,10 @@ class L10nService {
|
|
|
3395
3394
|
this.translateService.addLangs(languages.map((x) => x.code));
|
|
3396
3395
|
const lang = this.layoutService.language() ? this.layoutService.language() : 'en';
|
|
3397
3396
|
this.translateService.setDefaultLang(lang);
|
|
3398
|
-
this.translateService.use(lang)
|
|
3399
|
-
|
|
3400
|
-
|
|
3397
|
+
this.translateService.use(lang).subscribe(() => {
|
|
3398
|
+
this.loadComponentTranslations('app-info');
|
|
3399
|
+
this.translateService.get('primeng').subscribe((res) => this.primeNg.setTranslation(res));
|
|
3400
|
+
});
|
|
3401
3401
|
}
|
|
3402
3402
|
instant(key, interpolateParams) {
|
|
3403
3403
|
return this.translateService.instant(key, interpolateParams);
|
|
@@ -4494,17 +4494,6 @@ class NotificationService {
|
|
|
4494
4494
|
this.msgService.add(opt);
|
|
4495
4495
|
});
|
|
4496
4496
|
}
|
|
4497
|
-
async startConnection() {
|
|
4498
|
-
try {
|
|
4499
|
-
await this.connection.start();
|
|
4500
|
-
console.log('SignalR Connected');
|
|
4501
|
-
}
|
|
4502
|
-
catch (err) {
|
|
4503
|
-
this.msgService.error(err.message);
|
|
4504
|
-
console.error('SignalR Connection Failed: ', err);
|
|
4505
|
-
setTimeout(() => this.startConnection(), 5000);
|
|
4506
|
-
}
|
|
4507
|
-
}
|
|
4508
4497
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: NotificationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4509
4498
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: NotificationService, providedIn: 'root' }); }
|
|
4510
4499
|
}
|