@ecodev/natural 42.2.0 → 42.3.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.
@@ -1,7 +1,7 @@
1
1
  import '@angular/localize/init';
2
2
  import * as i0 from '@angular/core';
3
- import { Directive, Component, Inject, Injectable, HostBinding, HostListener, InjectionToken, Input, NgModule, EventEmitter, ChangeDetectionStrategy, Output, ContentChildren, Pipe, TemplateRef, ViewEncapsulation, ViewChild, Injector, Optional, Self, ContentChild, PLATFORM_ID } from '@angular/core';
4
- import { Subject, BehaviorSubject, of, timer, EMPTY, Observable, ReplaySubject, forkJoin, merge as merge$1, asyncScheduler } from 'rxjs';
3
+ import { Directive, Component, Inject, Injectable, HostBinding, HostListener, InjectionToken, Input, NgModule, EventEmitter, ChangeDetectionStrategy, Output, ContentChildren, Pipe, TemplateRef, ViewEncapsulation, ViewChild, Injector, Optional, Self, ContentChild, PLATFORM_ID, ErrorHandler } from '@angular/core';
4
+ import { Subject, BehaviorSubject, of, timer, EMPTY, Observable, ReplaySubject, forkJoin, merge as merge$1, asyncScheduler, catchError } from 'rxjs';
5
5
  import * as i5 from '@angular/forms';
6
6
  import { FormGroup, FormArray, Validators, FormControl, FormsModule, FormControlDirective, FormControlName, ReactiveFormsModule } from '@angular/forms';
7
7
  import * as i2$1 from '@angular/router';
@@ -66,6 +66,8 @@ import { MatPaginatorModule } from '@angular/material/paginator';
66
66
  import * as i2$6 from '@angular/material/sidenav';
67
67
  import { MatSidenavContainer, MatSidenav, MatSidenavModule } from '@angular/material/sidenav';
68
68
  import { Md5 } from 'ts-md5';
69
+ import * as i1$a from '@angular/common/http';
70
+ import { HttpHeaders, HttpClientModule } from '@angular/common/http';
69
71
 
70
72
  /**
71
73
  * Use
@@ -6687,7 +6689,7 @@ class NaturalInputComponent {
6687
6689
  };
6688
6690
  const injectorTokens = this.createProviders(data);
6689
6691
  const component = dropdownFacet.component;
6690
- this.dropdownRef = this.dropdownService.open(component, this.element, injectorTokens, dropdownFacet.showValidateButton || false);
6692
+ this.dropdownRef = this.dropdownService.open(component, this.element, injectorTokens, dropdownFacet.showValidateButton !== undefined ? dropdownFacet.showValidateButton : true);
6691
6693
  this.dropdownRef.closed.subscribe(result => {
6692
6694
  this.dropdownRef = null;
6693
6695
  if (result !== undefined) {
@@ -10485,11 +10487,100 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
10485
10487
  * Public API Surface of natural
10486
10488
  */
10487
10489
 
10490
+ const NaturalLoggerConfigUrl = new InjectionToken('NaturalLoggerConfigUrl');
10491
+ const NaturalLoggerConfigExtra = new InjectionToken('NaturalLoggerConfigExtra');
10492
+ class NaturalErrorHandler extends ErrorHandler {
10493
+ constructor(http, document, url, loggerExtra) {
10494
+ super();
10495
+ this.http = http;
10496
+ this.document = document;
10497
+ this.url = url;
10498
+ this.loggerExtra = loggerExtra;
10499
+ }
10500
+ handleError(error) {
10501
+ console.log('Error handler', error);
10502
+ const params = {
10503
+ error: error,
10504
+ url: this.document.defaultView?.window.location.href,
10505
+ };
10506
+ const headers = new HttpHeaders().set('content-type', 'application/json');
10507
+ if (this.loggerExtra) {
10508
+ params.extras = this.loggerExtra?.getExtras(error);
10509
+ }
10510
+ if (this.url) {
10511
+ this.http
10512
+ .post(this.url, params, { headers })
10513
+ .pipe(catchError(() => {
10514
+ console.log('Error submission error', error);
10515
+ return EMPTY;
10516
+ }))
10517
+ .subscribe();
10518
+ }
10519
+ }
10520
+ }
10521
+ NaturalErrorHandler.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: NaturalErrorHandler, deps: [{ token: i1$a.HttpClient }, { token: DOCUMENT }, { token: NaturalLoggerConfigUrl, optional: true }, { token: NaturalLoggerConfigExtra, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
10522
+ NaturalErrorHandler.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: NaturalErrorHandler, providedIn: 'root' });
10523
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: NaturalErrorHandler, decorators: [{
10524
+ type: Injectable,
10525
+ args: [{
10526
+ providedIn: 'root',
10527
+ }]
10528
+ }], ctorParameters: function () { return [{ type: i1$a.HttpClient }, { type: Document, decorators: [{
10529
+ type: Inject,
10530
+ args: [DOCUMENT]
10531
+ }] }, { type: undefined, decorators: [{
10532
+ type: Optional
10533
+ }, {
10534
+ type: Inject,
10535
+ args: [NaturalLoggerConfigUrl]
10536
+ }] }, { type: undefined, decorators: [{
10537
+ type: Optional
10538
+ }, {
10539
+ type: Inject,
10540
+ args: [NaturalLoggerConfigExtra]
10541
+ }] }]; } });
10542
+
10543
+ class NaturalErrorModule {
10544
+ static forRoot(url, extraService) {
10545
+ const providers = [];
10546
+ providers.push({
10547
+ provide: ErrorHandler,
10548
+ useClass: NaturalErrorHandler,
10549
+ }, {
10550
+ provide: NaturalLoggerConfigUrl,
10551
+ useValue: url,
10552
+ });
10553
+ if (extraService) {
10554
+ providers.push({
10555
+ provide: NaturalLoggerConfigExtra,
10556
+ useClass: extraService,
10557
+ });
10558
+ }
10559
+ return {
10560
+ ngModule: NaturalErrorModule,
10561
+ providers: providers,
10562
+ };
10563
+ }
10564
+ }
10565
+ NaturalErrorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: NaturalErrorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
10566
+ NaturalErrorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: NaturalErrorModule, imports: [HttpClientModule] });
10567
+ NaturalErrorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: NaturalErrorModule, imports: [[HttpClientModule]] });
10568
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: NaturalErrorModule, decorators: [{
10569
+ type: NgModule,
10570
+ args: [{
10571
+ imports: [HttpClientModule],
10572
+ }]
10573
+ }] });
10574
+
10575
+ /*
10576
+ * Public API Surface of natural
10577
+ */
10578
+
10488
10579
  // Load `$localize` onto the global scope - to be able to use that function to translate strings in components/services.
10489
10580
 
10490
10581
  /**
10491
10582
  * Generated bundle index. Do not edit.
10492
10583
  */
10493
10584
 
10494
- export { AvatarComponent, AvatarService, FileComponent, IconsConfigService, LOCAL_STORAGE, NATURAL_DROPDOWN_DATA, NATURAL_SEO_CONFIG, NaturalAbstractController, NaturalAbstractDetail, NaturalAbstractEditableList, NaturalAbstractList, NaturalAbstractModelService, NaturalAbstractNavigableList, NaturalAbstractPanel, NaturalAlertModule, NaturalAlertService, NaturalAvatarModule, NaturalCapitalizePipe, NaturalColumnsPickerColumnDirective, NaturalColumnsPickerComponent, NaturalColumnsPickerModule, NaturalCommonModule, NaturalConfirmComponent, NaturalDataSource, NaturalDetailHeaderComponent, NaturalDetailHeaderModule, NaturalDialogTriggerComponent, NaturalDialogTriggerModule, NaturalDropdownComponentsModule, NaturalDropdownRef, NaturalEllipsisPipe, NaturalEnumPipe, NaturalEnumService, NaturalFileDropDirective, NaturalFileModule, NaturalFileSelectDirective, NaturalFileService, NaturalFixedButtonComponent, NaturalFixedButtonDetailComponent, NaturalFixedButtonDetailModule, NaturalFixedButtonModule, NaturalHierarchicSelectorComponent, NaturalHierarchicSelectorDialogComponent, NaturalHierarchicSelectorDialogService, NaturalHierarchicSelectorModule, NaturalHierarchicSelectorService, NaturalHttpPrefixDirective, NaturalIconComponent, NaturalIconModule, NaturalLinkMutationService, NaturalLinkableTabDirective, NaturalMatomoModule, NaturalMatomoService, NaturalMemoryStorage, NaturalPanelsComponent, NaturalPanelsModule, NaturalPanelsService, NaturalPersistenceService, NaturalQueryVariablesManager, NaturalRelationsComponent, NaturalRelationsModule, NaturalSearchComponent, NaturalSearchModule, NaturalSelectComponent, NaturalSelectEnumComponent, NaturalSelectHierarchicComponent, NaturalSelectModule, NaturalSeoService, NaturalSidenavComponent, NaturalSidenavContainerComponent, NaturalSidenavContentComponent, NaturalSidenavModule, NaturalSidenavService, NaturalSidenavStackService, NaturalSrcDensityDirective, NaturalStampComponent, NaturalStampModule, NaturalSwissDatePipe, NaturalSwissParsingDateAdapter, NaturalTableButtonComponent, NaturalTableButtonModule, PanelsHooksConfig, SESSION_STORAGE, SortingOrder, TypeDateComponent, TypeDateRangeComponent, TypeHierarchicSelectorComponent, TypeNaturalSelectComponent, TypeNumberComponent, TypeSelectComponent, TypeTextComponent, available, cancellableTimeout, cleanSameValues, collectErrors, copyToClipboard, debug, decimal, deliverableEmail, ensureHttpPrefix, fallbackIfNoOpenedPanels, formatIsoDate, formatIsoDateTime, fromUrl, getForegroundColor, hasFilesAndProcessDate, ifValid, integer, localStorageFactory, localStorageProvider, lowerCaseFirstLetter, makePlural, memoryLocalStorageProvider, memorySessionStorageProvider, mergeOverrideArray, money, naturalPanelsUrlMatcher, relationsToIds, replaceObjectKeepingReference, replaceOperatorByField, replaceOperatorByName, sessionStorageFactory, sessionStorageProvider, toGraphQLDoctrineFilter, toNavigationParameters, toUrl, unique, upperCaseFirstLetter, urlValidator, validTlds, validateAllFormControls, wrapLike };
10585
+ export { AvatarComponent, AvatarService, FileComponent, IconsConfigService, LOCAL_STORAGE, NATURAL_DROPDOWN_DATA, NATURAL_SEO_CONFIG, NaturalAbstractController, NaturalAbstractDetail, NaturalAbstractEditableList, NaturalAbstractList, NaturalAbstractModelService, NaturalAbstractNavigableList, NaturalAbstractPanel, NaturalAlertModule, NaturalAlertService, NaturalAvatarModule, NaturalCapitalizePipe, NaturalColumnsPickerColumnDirective, NaturalColumnsPickerComponent, NaturalColumnsPickerModule, NaturalCommonModule, NaturalConfirmComponent, NaturalDataSource, NaturalDetailHeaderComponent, NaturalDetailHeaderModule, NaturalDialogTriggerComponent, NaturalDialogTriggerModule, NaturalDropdownComponentsModule, NaturalDropdownRef, NaturalEllipsisPipe, NaturalEnumPipe, NaturalEnumService, NaturalErrorModule, NaturalFileDropDirective, NaturalFileModule, NaturalFileSelectDirective, NaturalFileService, NaturalFixedButtonComponent, NaturalFixedButtonDetailComponent, NaturalFixedButtonDetailModule, NaturalFixedButtonModule, NaturalHierarchicSelectorComponent, NaturalHierarchicSelectorDialogComponent, NaturalHierarchicSelectorDialogService, NaturalHierarchicSelectorModule, NaturalHierarchicSelectorService, NaturalHttpPrefixDirective, NaturalIconComponent, NaturalIconModule, NaturalLinkMutationService, NaturalLinkableTabDirective, NaturalMatomoModule, NaturalMatomoService, NaturalMemoryStorage, NaturalPanelsComponent, NaturalPanelsModule, NaturalPanelsService, NaturalPersistenceService, NaturalQueryVariablesManager, NaturalRelationsComponent, NaturalRelationsModule, NaturalSearchComponent, NaturalSearchModule, NaturalSelectComponent, NaturalSelectEnumComponent, NaturalSelectHierarchicComponent, NaturalSelectModule, NaturalSeoService, NaturalSidenavComponent, NaturalSidenavContainerComponent, NaturalSidenavContentComponent, NaturalSidenavModule, NaturalSidenavService, NaturalSidenavStackService, NaturalSrcDensityDirective, NaturalStampComponent, NaturalStampModule, NaturalSwissDatePipe, NaturalSwissParsingDateAdapter, NaturalTableButtonComponent, NaturalTableButtonModule, PanelsHooksConfig, SESSION_STORAGE, SortingOrder, TypeDateComponent, TypeDateRangeComponent, TypeHierarchicSelectorComponent, TypeNaturalSelectComponent, TypeNumberComponent, TypeSelectComponent, TypeTextComponent, available, cancellableTimeout, cleanSameValues, collectErrors, copyToClipboard, debug, decimal, deliverableEmail, ensureHttpPrefix, fallbackIfNoOpenedPanels, formatIsoDate, formatIsoDateTime, fromUrl, getForegroundColor, hasFilesAndProcessDate, ifValid, integer, localStorageFactory, localStorageProvider, lowerCaseFirstLetter, makePlural, memoryLocalStorageProvider, memorySessionStorageProvider, mergeOverrideArray, money, naturalPanelsUrlMatcher, relationsToIds, replaceObjectKeepingReference, replaceOperatorByField, replaceOperatorByName, sessionStorageFactory, sessionStorageProvider, toGraphQLDoctrineFilter, toNavigationParameters, toUrl, unique, upperCaseFirstLetter, urlValidator, validTlds, validateAllFormControls, wrapLike };
10495
10586
  //# sourceMappingURL=ecodev-natural.mjs.map