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 {
@@ -1396,17 +1397,14 @@ class ScanProvider {
1396
1397
  });
1397
1398
  }
1398
1399
  }
1399
- 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 });
1400
+ 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 });
1400
1401
  ScanProvider.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ScanProvider, providedIn: 'root' });
1401
1402
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ScanProvider, decorators: [{
1402
1403
  type: Injectable,
1403
1404
  args: [{
1404
1405
  providedIn: 'root',
1405
1406
  }]
1406
- }], ctorParameters: function () { return [{ type: i1$1.HttpClient }, { type: undefined, decorators: [{
1407
- type: Inject,
1408
- args: [SCAN_CONFIG_TOKEN]
1409
- }] }]; } });
1407
+ }], ctorParameters: function () { return [{ type: i1$1.HttpClient }, { type: i0.Injector }]; } });
1410
1408
 
1411
1409
  class LayoutProvider {
1412
1410
  constructor(breakpointObserver, platform) {
@@ -1434,9 +1432,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1434
1432
  }], ctorParameters: function () { return [{ type: i1.BreakpointObserver }, { type: i2.Platform }]; } });
1435
1433
 
1436
1434
  class AuthProvider {
1437
- constructor(http, config) {
1435
+ constructor(http, injector) {
1438
1436
  this.http = http;
1439
- this.config = config;
1437
+ this.injector = injector;
1438
+ this.config = this.injector.get(AUTH_CONFIG_TOKEN);
1440
1439
  this.token = '';
1441
1440
  this.refresh_token = '';
1442
1441
  this.tokenTimestamps = {
@@ -1528,30 +1527,31 @@ class AuthProvider {
1528
1527
  }), map((data) => data.access_token));
1529
1528
  }
1530
1529
  }
1531
- 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 });
1530
+ 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 });
1532
1531
  AuthProvider.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AuthProvider, providedIn: 'root' });
1533
1532
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AuthProvider, decorators: [{
1534
1533
  type: Injectable,
1535
1534
  args: [{
1536
1535
  providedIn: 'root',
1537
1536
  }]
1538
- }], ctorParameters: function () { return [{ type: i1$1.HttpClient }, { type: undefined, decorators: [{
1539
- type: Inject,
1540
- args: [AUTH_CONFIG_TOKEN]
1541
- }] }]; } });
1537
+ }], ctorParameters: function () { return [{ type: i1$1.HttpClient }, { type: i0.Injector }]; } });
1542
1538
 
1543
1539
  const TRANSLATION_PROVIDER = new InjectionToken('Injection token for translation providers.');
1544
1540
  class NgxScanDocTranslationProvider {
1545
- constructor(translate, providers, platformLocation) {
1541
+ constructor(translate, injector, providers, platformLocation) {
1546
1542
  this.translate = translate;
1543
+ this.injector = injector;
1547
1544
  this.platformLocation = platformLocation;
1548
- // console.log(this.translate)
1549
- this.customLoader = this.translate.currentLoader;
1550
- this.defaultLang = 'en';
1551
- translate.setDefaultLang(this.defaultLang);
1552
- if (providers && providers.length > 0) {
1553
- for (const provider of providers) {
1554
- this.addTranslationFolder(provider.name, provider.source);
1545
+ this.config = this.injector.get(SCAN_CONFIG_TOKEN);
1546
+ if (this.config.useTranslation) {
1547
+ // console.log(this.translate)
1548
+ this.customLoader = this.translate.currentLoader;
1549
+ this.defaultLang = 'en';
1550
+ translate.setDefaultLang(this.defaultLang);
1551
+ if (providers && providers.length > 0) {
1552
+ for (const provider of providers) {
1553
+ this.addTranslationFolder(provider.name, provider.source);
1554
+ }
1555
1555
  }
1556
1556
  }
1557
1557
  }
@@ -1641,14 +1641,14 @@ class NgxScanDocTranslationProvider {
1641
1641
  return item;
1642
1642
  }
1643
1643
  }
1644
- 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 });
1644
+ 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 });
1645
1645
  NgxScanDocTranslationProvider.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NgxScanDocTranslationProvider, providedIn: 'root' });
1646
1646
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NgxScanDocTranslationProvider, decorators: [{
1647
1647
  type: Injectable,
1648
1648
  args: [{
1649
1649
  providedIn: 'root',
1650
1650
  }]
1651
- }], ctorParameters: function () { return [{ type: i4.TranslateService }, { type: undefined, decorators: [{
1651
+ }], ctorParameters: function () { return [{ type: i4.TranslateService }, { type: i0.Injector }, { type: undefined, decorators: [{
1652
1652
  type: Optional
1653
1653
  }, {
1654
1654
  type: Inject,
@@ -4313,11 +4313,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
4313
4313
  /*
4314
4314
  * Public API Surface of ngx-scandoc
4315
4315
  */
4316
- // export {NgxScandocCameraProvider} from './providers/camera.provider'
4317
4316
 
4318
4317
  /**
4319
4318
  * Generated bundle index. Do not edit.
4320
4319
  */
4321
4320
 
4322
- 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 };
4321
+ 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 };
4323
4322
  //# sourceMappingURL=ngx-scandoc.mjs.map