@bnsights/bbsf-utilities 1.0.69-beta.3 → 1.2.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/README.md +81 -2
- package/fesm2022/bnsights-bbsf-utilities.mjs +135 -61
- package/fesm2022/bnsights-bbsf-utilities.mjs.map +1 -1
- package/lib/bbsf-utilities.module.d.ts +22 -2
- package/lib/shared/authentication/auth.service.d.ts +0 -1
- package/lib/shared/services/language.service.d.ts +12 -0
- package/lib/shared/services/request-handler.service.d.ts +2 -3
- package/package.json +11 -21
- package/esm2022/auth/bnsights-bbsf-utilities-auth.mjs +0 -5
- package/esm2022/auth/public-api.mjs +0 -5
- package/esm2022/bnsights-bbsf-utilities.mjs +0 -5
- package/esm2022/http/bnsights-bbsf-utilities-http.mjs +0 -5
- package/esm2022/http/public-api.mjs +0 -8
- package/esm2022/lib/bbsf-utilities.module.mjs +0 -63
- package/esm2022/lib/shared/authentication/auth.service.mjs +0 -260
- package/esm2022/lib/shared/authentication/index.mjs +0 -2
- package/esm2022/lib/shared/config/environment.mjs +0 -12
- package/esm2022/lib/shared/enums/authentication-modes-enums.mjs +0 -8
- package/esm2022/lib/shared/index.mjs +0 -4
- package/esm2022/lib/shared/models/UserModel.mjs +0 -3
- package/esm2022/lib/shared/models/area-model.mjs +0 -3
- package/esm2022/lib/shared/models/error-model.mjs +0 -3
- package/esm2022/lib/shared/models/index.mjs +0 -5
- package/esm2022/lib/shared/models/request-options-model.mjs +0 -11
- package/esm2022/lib/shared/models/speech-language.mjs +0 -3
- package/esm2022/lib/shared/services/appearance-configuration.service.mjs +0 -35
- package/esm2022/lib/shared/services/configuration.service.mjs +0 -48
- package/esm2022/lib/shared/services/control-validation.service.mjs +0 -173
- package/esm2022/lib/shared/services/environment.service.mjs +0 -83
- package/esm2022/lib/shared/services/index.mjs +0 -14
- package/esm2022/lib/shared/services/language.service.mjs +0 -21
- package/esm2022/lib/shared/services/master-layout.service.mjs +0 -77
- package/esm2022/lib/shared/services/preload.service.mjs +0 -54
- package/esm2022/lib/shared/services/request-handler.service.mjs +0 -260
- package/esm2022/lib/shared/services/speech-recognition.service.mjs +0 -76
- package/esm2022/lib/shared/services/styles-bundle.service.mjs +0 -76
- package/esm2022/lib/shared/services/translate.service.mjs +0 -14
- package/esm2022/lib/shared/services/translation-resolver.service.mjs +0 -7
- package/esm2022/lib/shared/services/utility.service.mjs +0 -87
- package/esm2022/public-api.mjs +0 -56
- package/esm2022/translate/bnsights-bbsf-utilities-translate.mjs +0 -5
- package/esm2022/translate/public-api.mjs +0 -7
- package/esm2022/ui/bnsights-bbsf-utilities-ui.mjs +0 -5
- package/esm2022/ui/public-api.mjs +0 -8
package/README.md
CHANGED
|
@@ -4,6 +4,63 @@ BBSF Utilities package is part of BBSF 3 packages. It has all the common service
|
|
|
4
4
|
|
|
5
5
|
For more info please visit [BBSF Controls documentation](https://bbsfadmin.bnsights.com/controls) or [BBSF documentation](https://bnsightsprojects.visualstudio.com/BBSF%203/_wiki/wikis/BBSF-3.wiki/65/BBSF-Documentation)
|
|
6
6
|
|
|
7
|
+
## 🔄 Two Ways to Use This Library
|
|
8
|
+
|
|
9
|
+
### 1️⃣ **Backward Compatible** (All-in-One Module)
|
|
10
|
+
|
|
11
|
+
For existing applications or quick setup, import the `BBSFUtilitiesModule` to get everything:
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
// app.module.ts
|
|
15
|
+
import { BBSFUtilitiesModule } from '@bnsights/bbsf-utilities';
|
|
16
|
+
|
|
17
|
+
@NgModule({
|
|
18
|
+
imports: [
|
|
19
|
+
BBSFUtilitiesModule, // Includes ALL services and modules
|
|
20
|
+
// ... other imports
|
|
21
|
+
]
|
|
22
|
+
})
|
|
23
|
+
export class AppModule { }
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**What you get:**
|
|
27
|
+
- ✅ All services automatically registered
|
|
28
|
+
- ✅ BlockUI and Toastr modules pre-configured
|
|
29
|
+
- ✅ Works exactly like the original version
|
|
30
|
+
- ⚠️ Larger bundle size (includes all dependencies)
|
|
31
|
+
|
|
32
|
+
### 2️⃣ **Modular** (Optimized for Bundle Size)
|
|
33
|
+
|
|
34
|
+
For new applications or to optimize bundle size, use secondary entry points:
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
// app.module.ts
|
|
38
|
+
import { EnvironmentService } from '@bnsights/bbsf-utilities';
|
|
39
|
+
import { AuthService } from '@bnsights/bbsf-utilities/auth';
|
|
40
|
+
import { BBSFTranslateService } from '@bnsights/bbsf-utilities/translate';
|
|
41
|
+
import { UtilityService } from '@bnsights/bbsf-utilities/ui';
|
|
42
|
+
import { RequestHandlerService } from '@bnsights/bbsf-utilities/http';
|
|
43
|
+
|
|
44
|
+
@NgModule({
|
|
45
|
+
providers: [
|
|
46
|
+
EnvironmentService,
|
|
47
|
+
AuthService,
|
|
48
|
+
BBSFTranslateService,
|
|
49
|
+
UtilityService,
|
|
50
|
+
RequestHandlerService,
|
|
51
|
+
// Only import what you need
|
|
52
|
+
]
|
|
53
|
+
})
|
|
54
|
+
export class AppModule { }
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**Benefits:**
|
|
58
|
+
- 🚀 Smaller bundle size (only include what you use)
|
|
59
|
+
- 📦 Better tree-shaking
|
|
60
|
+
- ⚡ Faster build times
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
7
64
|
## 📦 Secondary Entry Points (Optimized Dependencies)
|
|
8
65
|
|
|
9
66
|
To optimize bundle size, the library now supports **secondary entry points** - only install what you use!
|
|
@@ -62,12 +119,34 @@ See [XMLBUILDER2_FIX.md](./XMLBUILDER2_FIX.md) for technical details.
|
|
|
62
119
|
|
|
63
120
|
### 📚 Documentation
|
|
64
121
|
|
|
65
|
-
- **[
|
|
66
|
-
- **[
|
|
122
|
+
- **[BACKWARD_COMPATIBILITY.md](./BACKWARD_COMPATIBILITY.md)** - Understand both usage patterns (BBSFUtilitiesModule vs Modular) ⭐ START HERE
|
|
123
|
+
- **[USAGE.md](./USAGE.md)** - Complete feature table & examples
|
|
124
|
+
- **[MIGRATION_GUIDE.md](./MIGRATION_GUIDE.md)** - Migrate to modular imports (optional)
|
|
67
125
|
- **[TROUBLESHOOTING.md](./TROUBLESHOOTING.md)** - Fix import issues
|
|
68
126
|
|
|
69
127
|
# Change Log
|
|
70
128
|
|
|
129
|
+
## 1.0.72 / 27/10/2025
|
|
130
|
+
|
|
131
|
+
=====================
|
|
132
|
+
|
|
133
|
+
### 🔄 Enhanced Backward Compatibility
|
|
134
|
+
|
|
135
|
+
- **Clarified BBSFUtilitiesModule usage**: The module now explicitly exports all necessary Angular modules (CommonModule, RouterModule, BlockUIModule, ToastrModule) for complete backward compatibility
|
|
136
|
+
- **Two usage patterns supported**:
|
|
137
|
+
1. **All-in-One**: Import `BBSFUtilitiesModule` for everything (original behavior maintained)
|
|
138
|
+
2. **Modular**: Import from secondary entry points for optimized bundles
|
|
139
|
+
- **No breaking changes**: Existing applications using `BBSFUtilitiesModule` continue to work unchanged
|
|
140
|
+
- **Documentation added**:
|
|
141
|
+
- `BACKWARD_COMPATIBILITY.md` - Quick reference guide
|
|
142
|
+
- Updated README with clear comparison of both approaches
|
|
143
|
+
- Enhanced MIGRATION_GUIDE.md with "no migration required" section
|
|
144
|
+
|
|
145
|
+
### Benefits
|
|
146
|
+
- ✅ Zero migration required for existing apps
|
|
147
|
+
- ✅ Full flexibility for new projects
|
|
148
|
+
- ✅ Clear documentation for both patterns
|
|
149
|
+
- ✅ All services and modules properly exported
|
|
71
150
|
|
|
72
151
|
## 1.0.71 / 27/10/2025
|
|
73
152
|
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { Injectable,
|
|
3
|
+
import { Injectable, inject, Inject, NgModule } from '@angular/core';
|
|
4
4
|
import * as i1$1 from '@angular/router';
|
|
5
|
-
import { RouterModule } from '@angular/router';
|
|
5
|
+
import { Router, RouterModule } from '@angular/router';
|
|
6
6
|
import * as i4 from '@ngx-translate/core';
|
|
7
7
|
import { TranslateService } from '@ngx-translate/core';
|
|
8
8
|
import * as i1$2 from 'ng-block-ui';
|
|
9
9
|
import { BlockUI, BlockUIModule } from 'ng-block-ui';
|
|
10
|
-
import
|
|
11
|
-
import { ToastrService, ToastrModule } from 'ngx-toastr';
|
|
10
|
+
import { ToastrService, provideToastr } from 'ngx-toastr';
|
|
12
11
|
import * as i4$1 from 'ngx-cookie-service';
|
|
13
12
|
import { CookieService } from 'ngx-cookie-service';
|
|
14
13
|
import * as i1 from '@angular/common/http';
|
|
15
14
|
import { HttpParams, HttpErrorResponse, HttpHeaders } from '@angular/common/http';
|
|
16
|
-
import { Subject, throwError, Observable, lastValueFrom, BehaviorSubject } from 'rxjs';
|
|
15
|
+
import { Subject, throwError, of, Observable, lastValueFrom, BehaviorSubject } from 'rxjs';
|
|
17
16
|
import { JwtHelperService } from '@auth0/angular-jwt';
|
|
18
17
|
import { __decorate } from 'tslib';
|
|
19
18
|
import { plainToClass } from 'class-transformer';
|
|
20
|
-
import { takeUntil, tap, map } from 'rxjs/operators';
|
|
19
|
+
import { takeUntil, tap, map, shareReplay, take } from 'rxjs/operators';
|
|
21
20
|
|
|
22
21
|
class User {
|
|
23
22
|
}
|
|
@@ -52,10 +51,10 @@ class AppearanceConfigurationService {
|
|
|
52
51
|
getLogo() {
|
|
53
52
|
return this.configService.getConfigurationValue('AnonymousLayout_Logo');
|
|
54
53
|
}
|
|
55
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
56
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
54
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: AppearanceConfigurationService, deps: [{ token: ConfigurationService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
55
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: AppearanceConfigurationService, providedIn: 'root' }); }
|
|
57
56
|
}
|
|
58
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
57
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: AppearanceConfigurationService, decorators: [{
|
|
59
58
|
type: Injectable,
|
|
60
59
|
args: [{
|
|
61
60
|
providedIn: 'root'
|
|
@@ -96,10 +95,10 @@ class ConfigurationService {
|
|
|
96
95
|
return selectedKey;
|
|
97
96
|
}
|
|
98
97
|
}
|
|
99
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
100
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
98
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ConfigurationService, deps: [{ token: i1.HttpClient }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
99
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ConfigurationService, providedIn: 'root' }); }
|
|
101
100
|
}
|
|
102
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
101
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ConfigurationService, decorators: [{
|
|
103
102
|
type: Injectable,
|
|
104
103
|
args: [{
|
|
105
104
|
providedIn: 'root'
|
|
@@ -280,13 +279,13 @@ class ControlValidationService {
|
|
|
280
279
|
let control = form.get(controlName);
|
|
281
280
|
return control;
|
|
282
281
|
}
|
|
283
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
284
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
282
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ControlValidationService, deps: [{ token: UtilityService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
283
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ControlValidationService, providedIn: 'root' }); }
|
|
285
284
|
}
|
|
286
285
|
__decorate([
|
|
287
286
|
BlockUI()
|
|
288
287
|
], ControlValidationService.prototype, "blockUI", void 0);
|
|
289
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
288
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ControlValidationService, decorators: [{
|
|
290
289
|
type: Injectable,
|
|
291
290
|
args: [{
|
|
292
291
|
providedIn: 'root'
|
|
@@ -375,10 +374,10 @@ class EnvironmentService {
|
|
|
375
374
|
let cookieName = environment["BBSF_CookieName"];
|
|
376
375
|
return cookieName;
|
|
377
376
|
}
|
|
378
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
379
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
377
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EnvironmentService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
378
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EnvironmentService, providedIn: 'root' }); }
|
|
380
379
|
}
|
|
381
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
380
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EnvironmentService, decorators: [{
|
|
382
381
|
type: Injectable,
|
|
383
382
|
args: [{
|
|
384
383
|
providedIn: 'root'
|
|
@@ -444,10 +443,10 @@ class MasterLayoutService {
|
|
|
444
443
|
params = params.append('RoleID', permissionSetID);
|
|
445
444
|
return this.http.post(this.apiUrl + 'SwitchRole', null, null, params);
|
|
446
445
|
}
|
|
447
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
448
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
446
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: MasterLayoutService, deps: [{ token: i1$1.Router }, { token: RequestHandlerService }, { token: AuthService }, { token: StylesBundleService }, { token: i4.TranslateService }, { token: EnvironmentService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
447
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: MasterLayoutService, providedIn: 'root' }); }
|
|
449
448
|
}
|
|
450
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
449
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: MasterLayoutService, decorators: [{
|
|
451
450
|
type: Injectable,
|
|
452
451
|
args: [{
|
|
453
452
|
providedIn: 'root',
|
|
@@ -455,15 +454,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
455
454
|
}], ctorParameters: () => [{ type: i1$1.Router }, { type: RequestHandlerService }, { type: AuthService }, { type: StylesBundleService }, { type: i4.TranslateService }, { type: EnvironmentService }] });
|
|
456
455
|
|
|
457
456
|
class RequestHandlerService {
|
|
458
|
-
constructor(http, authService, environmentService, utilityService, bbsfTranslateService
|
|
457
|
+
constructor(http, authService, environmentService, utilityService, bbsfTranslateService) {
|
|
459
458
|
this.http = http;
|
|
460
459
|
this.authService = authService;
|
|
461
460
|
this.environmentService = environmentService;
|
|
462
461
|
this.utilityService = utilityService;
|
|
463
462
|
this.bbsfTranslateService = bbsfTranslateService;
|
|
464
|
-
this.router = router;
|
|
465
463
|
this.currentLanguage = "";
|
|
466
464
|
this.onDestroy$ = new Subject();
|
|
465
|
+
this.router = inject(Router);
|
|
467
466
|
//using localStorage to avoid call getCurrentLanguage() because it is not all to use async in constructor
|
|
468
467
|
this.bbsfTranslateService.onLangChange.subscribe((event) => {
|
|
469
468
|
if (this.currentLanguage != event.lang) {
|
|
@@ -696,12 +695,15 @@ class RequestHandlerService {
|
|
|
696
695
|
'Image-Upload': 'true',
|
|
697
696
|
});
|
|
698
697
|
}
|
|
699
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
700
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
698
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: RequestHandlerService, deps: [{ token: i1.HttpClient }, { token: AuthService }, { token: EnvironmentService }, { token: UtilityService }, { token: BBSFTranslateService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
699
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: RequestHandlerService, providedIn: 'root' }); }
|
|
701
700
|
}
|
|
702
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
703
|
-
type: Injectable
|
|
704
|
-
|
|
701
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: RequestHandlerService, decorators: [{
|
|
702
|
+
type: Injectable,
|
|
703
|
+
args: [{
|
|
704
|
+
providedIn: 'root',
|
|
705
|
+
}]
|
|
706
|
+
}], ctorParameters: () => [{ type: i1.HttpClient }, { type: AuthService }, { type: EnvironmentService }, { type: UtilityService }, { type: BBSFTranslateService }] });
|
|
705
707
|
|
|
706
708
|
class StylesBundleService {
|
|
707
709
|
constructor(document, translateService) {
|
|
@@ -762,10 +764,10 @@ class StylesBundleService {
|
|
|
762
764
|
const parts = path.split('/');
|
|
763
765
|
return parts[parts.length - 1];
|
|
764
766
|
}
|
|
765
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
766
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
767
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: StylesBundleService, deps: [{ token: DOCUMENT }, { token: BBSFTranslateService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
768
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: StylesBundleService, providedIn: 'root' }); }
|
|
767
769
|
}
|
|
768
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
770
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: StylesBundleService, decorators: [{
|
|
769
771
|
type: Injectable,
|
|
770
772
|
args: [{
|
|
771
773
|
providedIn: 'root'
|
|
@@ -776,10 +778,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
776
778
|
}] }, { type: BBSFTranslateService }] });
|
|
777
779
|
|
|
778
780
|
class BBSFTranslateService extends TranslateService {
|
|
779
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
780
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
781
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: BBSFTranslateService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
782
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: BBSFTranslateService, providedIn: 'root' }); }
|
|
781
783
|
}
|
|
782
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
784
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: BBSFTranslateService, decorators: [{
|
|
783
785
|
type: Injectable,
|
|
784
786
|
args: [{
|
|
785
787
|
providedIn: 'root'
|
|
@@ -859,31 +861,67 @@ class UtilityService {
|
|
|
859
861
|
stopBlockUI() {
|
|
860
862
|
this.blockUI.stop();
|
|
861
863
|
}
|
|
862
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
863
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
864
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: UtilityService, deps: [{ token: BBSFTranslateService }, { token: EnvironmentService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
865
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: UtilityService, providedIn: 'root' }); }
|
|
864
866
|
}
|
|
865
867
|
__decorate([
|
|
866
868
|
BlockUI()
|
|
867
869
|
], UtilityService.prototype, "blockUI", void 0);
|
|
868
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
870
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: UtilityService, decorators: [{
|
|
869
871
|
type: Injectable,
|
|
870
872
|
args: [{
|
|
871
873
|
providedIn: 'root'
|
|
872
874
|
}]
|
|
873
875
|
}], ctorParameters: () => [{ type: BBSFTranslateService }, { type: EnvironmentService }, { type: i0.Injector }], propDecorators: { blockUI: [] } });
|
|
874
876
|
|
|
877
|
+
/**
|
|
878
|
+
* Language service with internal caching
|
|
879
|
+
*/
|
|
875
880
|
class LanguageService {
|
|
876
881
|
constructor(http) {
|
|
877
882
|
this.http = http;
|
|
878
883
|
this.apiUrl = '/api/Language/';
|
|
884
|
+
this._languages = [];
|
|
885
|
+
this.isLoading = false;
|
|
886
|
+
this.isLoaded = false;
|
|
887
|
+
this.loadRequest$ = null;
|
|
888
|
+
}
|
|
889
|
+
/** Pure getter - no side effects */
|
|
890
|
+
get languages() {
|
|
891
|
+
return this._languages;
|
|
892
|
+
}
|
|
893
|
+
/** Internal method - loads languages from API (race-condition safe) */
|
|
894
|
+
loadLanguages() {
|
|
895
|
+
if (this.isLoaded || this.isLoading)
|
|
896
|
+
return; // Sync guard prevents race condition
|
|
897
|
+
this.isLoading = true; // Set immediately to block concurrent calls
|
|
898
|
+
this.loadRequest$ = this.http.get(this.apiUrl + 'GetAll', null, null).pipe(tap((languages) => {
|
|
899
|
+
this._languages = languages;
|
|
900
|
+
this.isLoaded = true;
|
|
901
|
+
this.isLoading = false;
|
|
902
|
+
}), shareReplay(1));
|
|
903
|
+
// take(1) ensures auto-unsubscribe after completion
|
|
904
|
+
this.loadRequest$.pipe(take(1)).subscribe({
|
|
905
|
+
error: (err) => {
|
|
906
|
+
this.isLoading = false;
|
|
907
|
+
this.loadRequest$ = null;
|
|
908
|
+
}
|
|
909
|
+
});
|
|
879
910
|
}
|
|
911
|
+
/** Get languages as Observable - triggers load if not loaded */
|
|
880
912
|
getLanguages() {
|
|
881
|
-
|
|
913
|
+
if (this.isLoaded) {
|
|
914
|
+
return of(this._languages);
|
|
915
|
+
}
|
|
916
|
+
if (!this.isLoading) {
|
|
917
|
+
this.loadLanguages();
|
|
918
|
+
}
|
|
919
|
+
return this.loadRequest$ ?? of(this._languages);
|
|
882
920
|
}
|
|
883
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
884
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
921
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: LanguageService, deps: [{ token: RequestHandlerService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
922
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: LanguageService, providedIn: 'root' }); }
|
|
885
923
|
}
|
|
886
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
924
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: LanguageService, decorators: [{
|
|
887
925
|
type: Injectable,
|
|
888
926
|
args: [{
|
|
889
927
|
providedIn: 'root',
|
|
@@ -952,10 +990,10 @@ class SpeechRecognitionService {
|
|
|
952
990
|
this.recognition.stop();
|
|
953
991
|
}
|
|
954
992
|
}
|
|
955
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
956
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
993
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SpeechRecognitionService, deps: [{ token: i0.NgZone }, { token: UtilityService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
994
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SpeechRecognitionService, providedIn: 'root' }); }
|
|
957
995
|
}
|
|
958
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
996
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SpeechRecognitionService, decorators: [{
|
|
959
997
|
type: Injectable,
|
|
960
998
|
args: [{
|
|
961
999
|
providedIn: 'root'
|
|
@@ -1000,10 +1038,10 @@ class FileLoaderService {
|
|
|
1000
1038
|
console.error('Error preloading translations:', error);
|
|
1001
1039
|
}
|
|
1002
1040
|
}
|
|
1003
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1004
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
1041
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FileLoaderService, deps: [{ token: BBSFTranslateService }, { token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1042
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FileLoaderService, providedIn: 'root' }); }
|
|
1005
1043
|
}
|
|
1006
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1044
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FileLoaderService, decorators: [{
|
|
1007
1045
|
type: Injectable,
|
|
1008
1046
|
args: [{
|
|
1009
1047
|
providedIn: 'root',
|
|
@@ -1248,21 +1286,47 @@ class AuthService {
|
|
|
1248
1286
|
window.location.href = logoutUrl;
|
|
1249
1287
|
return;
|
|
1250
1288
|
}
|
|
1251
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1252
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
1289
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: AuthService, deps: [{ token: i0.Injector }, { token: i1.HttpClient }, { token: EnvironmentService }, { token: BBSFTranslateService }, { token: i1$1.Router }, { token: i4$1.CookieService }, { token: UtilityService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1290
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: AuthService, providedIn: 'root' }); }
|
|
1253
1291
|
}
|
|
1254
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1292
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: AuthService, decorators: [{
|
|
1255
1293
|
type: Injectable,
|
|
1256
1294
|
args: [{
|
|
1257
1295
|
providedIn: 'root',
|
|
1258
1296
|
}]
|
|
1259
1297
|
}], ctorParameters: () => [{ type: i0.Injector }, { type: i1.HttpClient }, { type: EnvironmentService }, { type: BBSFTranslateService }, { type: i1$1.Router }, { type: i4$1.CookieService }, { type: UtilityService }] });
|
|
1260
1298
|
|
|
1299
|
+
/**
|
|
1300
|
+
* BBSFUtilitiesModule
|
|
1301
|
+
*
|
|
1302
|
+
* This module provides full backward compatibility by including ALL services and modules
|
|
1303
|
+
* from the original version. Simply import this module to get all functionality.
|
|
1304
|
+
*
|
|
1305
|
+
* For new applications, consider using modular imports via secondary entry points:
|
|
1306
|
+
* - @bnsights/bbsf-utilities/auth - Authentication services
|
|
1307
|
+
* - @bnsights/bbsf-utilities/http - HTTP request handling
|
|
1308
|
+
* - @bnsights/bbsf-utilities/translate - Translation services
|
|
1309
|
+
* - @bnsights/bbsf-utilities/ui - UI services (BlockUI, Toastr, etc.)
|
|
1310
|
+
*
|
|
1311
|
+
* @example
|
|
1312
|
+
* // Backward compatible usage (imports everything):
|
|
1313
|
+
* import { BBSFUtilitiesModule } from '@bnsights/bbsf-utilities';
|
|
1314
|
+
*
|
|
1315
|
+
* @NgModule({
|
|
1316
|
+
* imports: [BBSFUtilitiesModule]
|
|
1317
|
+
* })
|
|
1318
|
+
* export class AppModule { }
|
|
1319
|
+
*/
|
|
1261
1320
|
class BBSFUtilitiesModule {
|
|
1262
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1263
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
1264
|
-
RouterModule, i1$2.BlockUIModule,
|
|
1265
|
-
|
|
1321
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: BBSFUtilitiesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1322
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: BBSFUtilitiesModule, imports: [CommonModule,
|
|
1323
|
+
RouterModule, i1$2.BlockUIModule], exports: [
|
|
1324
|
+
// Re-export modules for backward compatibility
|
|
1325
|
+
CommonModule,
|
|
1326
|
+
RouterModule,
|
|
1327
|
+
BlockUIModule] }); }
|
|
1328
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: BBSFUtilitiesModule, providers: [
|
|
1329
|
+
// All services for backward compatibility
|
|
1266
1330
|
UtilityService,
|
|
1267
1331
|
EnvironmentService,
|
|
1268
1332
|
AuthService,
|
|
@@ -1275,13 +1339,17 @@ class BBSFUtilitiesModule {
|
|
|
1275
1339
|
ConfigurationService,
|
|
1276
1340
|
CookieService,
|
|
1277
1341
|
LanguageService,
|
|
1278
|
-
SpeechRecognitionService
|
|
1342
|
+
SpeechRecognitionService,
|
|
1343
|
+
provideToastr()
|
|
1279
1344
|
], imports: [CommonModule,
|
|
1280
1345
|
RouterModule,
|
|
1281
|
-
BlockUIModule.forRoot(),
|
|
1282
|
-
|
|
1346
|
+
BlockUIModule.forRoot(),
|
|
1347
|
+
// Re-export modules for backward compatibility
|
|
1348
|
+
CommonModule,
|
|
1349
|
+
RouterModule,
|
|
1350
|
+
BlockUIModule] }); }
|
|
1283
1351
|
}
|
|
1284
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1352
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: BBSFUtilitiesModule, decorators: [{
|
|
1285
1353
|
type: NgModule,
|
|
1286
1354
|
args: [{
|
|
1287
1355
|
declarations: [],
|
|
@@ -1289,10 +1357,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
1289
1357
|
CommonModule,
|
|
1290
1358
|
RouterModule,
|
|
1291
1359
|
BlockUIModule.forRoot(),
|
|
1292
|
-
ToastrModule.forRoot(),
|
|
1293
1360
|
],
|
|
1294
|
-
exports: [
|
|
1361
|
+
exports: [
|
|
1362
|
+
// Re-export modules for backward compatibility
|
|
1363
|
+
CommonModule,
|
|
1364
|
+
RouterModule,
|
|
1365
|
+
BlockUIModule,
|
|
1366
|
+
],
|
|
1295
1367
|
providers: [
|
|
1368
|
+
// All services for backward compatibility
|
|
1296
1369
|
UtilityService,
|
|
1297
1370
|
EnvironmentService,
|
|
1298
1371
|
AuthService,
|
|
@@ -1305,7 +1378,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
1305
1378
|
ConfigurationService,
|
|
1306
1379
|
CookieService,
|
|
1307
1380
|
LanguageService,
|
|
1308
|
-
SpeechRecognitionService
|
|
1381
|
+
SpeechRecognitionService,
|
|
1382
|
+
provideToastr()
|
|
1309
1383
|
]
|
|
1310
1384
|
}]
|
|
1311
1385
|
}] });
|