ngx-scandoc 15.0.6 → 15.0.8

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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, EventEmitter, Component, ChangeDetectionStrategy, Input, HostListener, ViewChild, Output, NgModule, InjectionToken, Inject, Optional, HostBinding, Pipe, ViewContainerRef } from '@angular/core';
2
+ import { Injectable, EventEmitter, Component, ChangeDetectionStrategy, Input, HostListener, ViewChild, Output, NgModule, InjectionToken, Optional, Inject, HostBinding, Pipe, ViewContainerRef } from '@angular/core';
3
3
  import * as i2$1 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
5
  import { Subject, Observable, from, of, tap as tap$1, distinctUntilChanged, switchMap as switchMap$1, throwError, forkJoin } from 'rxjs';
@@ -659,11 +659,12 @@ const AUTH_CONFIG_TOKEN = new InjectionToken('configAuth');
659
659
  const SCAN_CONFIG_TOKEN = new InjectionToken('scanConfig');
660
660
 
661
661
  class ScanProvider {
662
- constructor(http, config) {
662
+ constructor(http, injector) {
663
663
  this.http = http;
664
- this.config = config;
664
+ this.injector = injector;
665
665
  // enableVerification = true;
666
666
  this.canStoreImages = true;
667
+ this.config = this.injector.get(SCAN_CONFIG_TOKEN);
667
668
  }
668
669
  genderList() {
669
670
  return {
@@ -1393,19 +1394,14 @@ class ScanProvider {
1393
1394
  });
1394
1395
  }
1395
1396
  }
1396
- ScanProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ScanProvider, deps: [{ token: i1$1.HttpClient }, { token: SCAN_CONFIG_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable });
1397
+ ScanProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ScanProvider, deps: [{ token: i1$1.HttpClient }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
1397
1398
  ScanProvider.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ScanProvider, providedIn: 'root' });
1398
1399
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ScanProvider, decorators: [{
1399
1400
  type: Injectable,
1400
1401
  args: [{
1401
1402
  providedIn: 'root',
1402
1403
  }]
1403
- }], ctorParameters: function () {
1404
- return [{ type: i1$1.HttpClient }, { type: undefined, decorators: [{
1405
- type: Inject,
1406
- args: [SCAN_CONFIG_TOKEN]
1407
- }] }];
1408
- } });
1404
+ }], ctorParameters: function () { return [{ type: i1$1.HttpClient }, { type: i0.Injector }]; } });
1409
1405
 
1410
1406
  class LayoutProvider {
1411
1407
  constructor(breakpointObserver, platform) {
@@ -1433,9 +1429,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1433
1429
  }], ctorParameters: function () { return [{ type: i1.BreakpointObserver }, { type: i2.Platform }]; } });
1434
1430
 
1435
1431
  class AuthProvider {
1436
- constructor(http, config) {
1432
+ constructor(http, injector) {
1437
1433
  this.http = http;
1438
- this.config = config;
1434
+ this.injector = injector;
1435
+ this.config = this.injector.get(AUTH_CONFIG_TOKEN);
1439
1436
  this.token = '';
1440
1437
  this.refresh_token = '';
1441
1438
  this.tokenTimestamps = {
@@ -1527,32 +1524,31 @@ class AuthProvider {
1527
1524
  }), map((data) => data.access_token));
1528
1525
  }
1529
1526
  }
1530
- AuthProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AuthProvider, deps: [{ token: i1$1.HttpClient }, { token: AUTH_CONFIG_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable });
1527
+ AuthProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AuthProvider, deps: [{ token: i1$1.HttpClient }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
1531
1528
  AuthProvider.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AuthProvider, providedIn: 'root' });
1532
1529
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AuthProvider, decorators: [{
1533
1530
  type: Injectable,
1534
1531
  args: [{
1535
1532
  providedIn: 'root',
1536
1533
  }]
1537
- }], ctorParameters: function () {
1538
- return [{ type: i1$1.HttpClient }, { type: undefined, decorators: [{
1539
- type: Inject,
1540
- args: [AUTH_CONFIG_TOKEN]
1541
- }] }];
1542
- } });
1534
+ }], ctorParameters: function () { return [{ type: i1$1.HttpClient }, { type: i0.Injector }]; } });
1543
1535
 
1544
1536
  const TRANSLATION_PROVIDER = new InjectionToken('Injection token for translation providers.');
1545
1537
  class NgxScanDocTranslationProvider {
1546
- constructor(translate, providers, platformLocation) {
1538
+ constructor(translate, injector, providers, platformLocation) {
1547
1539
  this.translate = translate;
1540
+ this.injector = injector;
1548
1541
  this.platformLocation = platformLocation;
1549
- // console.log(this.translate)
1550
- this.customLoader = this.translate.currentLoader;
1551
- this.defaultLang = 'en';
1552
- translate.setDefaultLang(this.defaultLang);
1553
- if (providers && providers.length > 0) {
1554
- for (const provider of providers) {
1555
- this.addTranslationFolder(provider.name, provider.source);
1542
+ this.config = this.injector.get(SCAN_CONFIG_TOKEN);
1543
+ if (this.config.useTranslation) {
1544
+ // console.log(this.translate)
1545
+ this.customLoader = this.translate.currentLoader;
1546
+ this.defaultLang = 'en';
1547
+ translate.setDefaultLang(this.defaultLang);
1548
+ if (providers && providers.length > 0) {
1549
+ for (const provider of providers) {
1550
+ this.addTranslationFolder(provider.name, provider.source);
1551
+ }
1556
1552
  }
1557
1553
  }
1558
1554
  }
@@ -1642,7 +1638,7 @@ class NgxScanDocTranslationProvider {
1642
1638
  return item;
1643
1639
  }
1644
1640
  }
1645
- NgxScanDocTranslationProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NgxScanDocTranslationProvider, deps: [{ token: i4.TranslateService }, { token: TRANSLATION_PROVIDER, optional: true }, { token: i2$1.PlatformLocation }], target: i0.ɵɵFactoryTarget.Injectable });
1641
+ NgxScanDocTranslationProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NgxScanDocTranslationProvider, deps: [{ token: i4.TranslateService }, { token: i0.Injector }, { token: TRANSLATION_PROVIDER, optional: true }, { token: i2$1.PlatformLocation }], target: i0.ɵɵFactoryTarget.Injectable });
1646
1642
  NgxScanDocTranslationProvider.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NgxScanDocTranslationProvider, providedIn: 'root' });
1647
1643
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NgxScanDocTranslationProvider, decorators: [{
1648
1644
  type: Injectable,
@@ -1650,7 +1646,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1650
1646
  providedIn: 'root',
1651
1647
  }]
1652
1648
  }], ctorParameters: function () {
1653
- return [{ type: i4.TranslateService }, { type: undefined, decorators: [{
1649
+ return [{ type: i4.TranslateService }, { type: i0.Injector }, { type: undefined, decorators: [{
1654
1650
  type: Optional
1655
1651
  }, {
1656
1652
  type: Inject,
@@ -4336,11 +4332,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
4336
4332
  /*
4337
4333
  * Public API Surface of ngx-scandoc
4338
4334
  */
4339
- // export {NgxScandocCameraProvider} from './providers/camera.provider'
4340
4335
 
4341
4336
  /**
4342
4337
  * Generated bundle index. Do not edit.
4343
4338
  */
4344
4339
 
4345
- export { AppFormModule, AuthProvider, BlankComponent, CameraSwitchComponent, CoreComponentsModule, CorePipesModule, DialogsModule, HttpErrorInterceptor, LoadingComponent, ManualScanComponent, MaterialModule, NgxScanDocTranslationProvider, NgxScandocDialogsCoreProvider, NgxScandocModule, PromptManualComponent, SafeResourceUrlPipe, ScanComponent, ScanFieldsProvider, ScanProfileComponent, ScanProvider, ScanSelfieComponent, TranslateLoaderProvider, TurnDocumentComponent, WebcamComponent, WebcamModule, webRtcProvider };
4340
+ export { AUTH_CONFIG_TOKEN, AppFormModule, AuthProvider, BlankComponent, CameraSwitchComponent, CoreComponentsModule, CorePipesModule, DialogsModule, HttpErrorInterceptor, LoadingComponent, ManualScanComponent, MaterialModule, NgxScanDocTranslationProvider, NgxScandocDialogsCoreProvider, NgxScandocModule, PromptManualComponent, SCAN_CONFIG_TOKEN, SafeResourceUrlPipe, ScanComponent, ScanFieldsProvider, ScanProfileComponent, ScanProvider, ScanSelfieComponent, TranslateLoaderProvider, TurnDocumentComponent, WebcamComponent, WebcamModule, webRtcProvider };
4346
4341
  //# sourceMappingURL=ngx-scandoc.mjs.map