@ecodev/natural 42.3.2 → 42.3.3
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/esm2020/lib/modules/logger/error-handler.mjs +88 -0
- package/esm2020/lib/modules/logger/error.module.mjs +36 -0
- package/esm2020/lib/modules/logger/public-api.mjs +6 -0
- package/esm2020/lib/modules/sidenav/sidenav-container/sidenav-container.component.mjs +3 -3
- package/esm2020/public-api.mjs +2 -1
- package/fesm2015/ecodev-natural.mjs +128 -5
- package/fesm2015/ecodev-natural.mjs.map +1 -1
- package/fesm2020/ecodev-natural.mjs +125 -5
- package/fesm2020/ecodev-natural.mjs.map +1 -1
- package/lib/modules/logger/error-handler.d.ts +37 -0
- package/lib/modules/logger/error.module.d.ts +10 -0
- package/lib/modules/logger/public-api.d.ts +2 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -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
|
|
@@ -9783,10 +9785,10 @@ class NaturalSidenavContainerComponent {
|
|
|
9783
9785
|
}
|
|
9784
9786
|
}
|
|
9785
9787
|
NaturalSidenavContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: NaturalSidenavContainerComponent, deps: [{ token: NaturalSidenavService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
9786
|
-
NaturalSidenavContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.0", type: NaturalSidenavContainerComponent, selector: "natural-sidenav-container", inputs: { name: "name", position: "position", mobileAutoClose: "mobileAutoClose", minimizedWidth: "minimizedWidth", noScroll: "noScroll" }, host: { properties: { "attr.no-scroll": "this.noScroll" } }, providers: [NaturalSidenavService], viewQueries: [{ propertyName: "menuContainer", first: true, predicate: MatSidenavContainer, descendants: true, static: true }, { propertyName: "menuSidenav", first: true, predicate: MatSidenav, descendants: true, static: true }], ngImport: i0, template: "<mat-sidenav-container
|
|
9788
|
+
NaturalSidenavContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.0", type: NaturalSidenavContainerComponent, selector: "natural-sidenav-container", inputs: { name: "name", position: "position", mobileAutoClose: "mobileAutoClose", minimizedWidth: "minimizedWidth", noScroll: "noScroll" }, host: { properties: { "attr.no-scroll": "this.noScroll" } }, providers: [NaturalSidenavService], viewQueries: [{ propertyName: "menuContainer", first: true, predicate: MatSidenavContainer, descendants: true, static: true }, { propertyName: "menuSidenav", first: true, predicate: MatSidenav, descendants: true, static: true }], ngImport: i0, template: "<mat-sidenav-container (backdropClick)=\"sidenavService.setOpened(false)\">\n <mat-sidenav\n [mode]=\"sidenavService.activeMode\"\n [ngClass]=\"sidenavService.isMinimized ? 'menuMinimized' : ''\"\n [opened]=\"sidenavService.isOpened\"\n [style.min-width.px]=\"sidenavService.isMinimized && minimizedWidth ? minimizedWidth : null\"\n [style.width.px]=\"sidenavService.isMinimized && minimizedWidth ? minimizedWidth : null\"\n [position]=\"position\"\n >\n <ng-content select=\"natural-sidenav\"></ng-content>\n </mat-sidenav>\n\n <mat-sidenav-content>\n <div>\n <ng-content select=\"natural-sidenav-content\"></ng-content>\n </div>\n </mat-sidenav-content>\n</mat-sidenav-container>\n", styles: [":host{display:flex;flex-direction:column}:host mat-sidenav-container{display:flex;flex-direction:column;flex:1}:host mat-sidenav-content>div{overflow:auto}:host .menuMinimized{overflow-x:hidden}:host .buttons{display:flex;flex-direction:row;justify-content:flex-end}\n"], components: [{ type: i2$6.MatSidenavContainer, selector: "mat-sidenav-container", exportAs: ["matSidenavContainer"] }, { type: i2$6.MatSidenav, selector: "mat-sidenav", inputs: ["fixedInViewport", "fixedTopGap", "fixedBottomGap"], exportAs: ["matSidenav"] }, { type: i2$6.MatSidenavContent, selector: "mat-sidenav-content" }], directives: [{ type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
9787
9789
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: NaturalSidenavContainerComponent, decorators: [{
|
|
9788
9790
|
type: Component,
|
|
9789
|
-
args: [{ selector: 'natural-sidenav-container', providers: [NaturalSidenavService], template: "<mat-sidenav-container
|
|
9791
|
+
args: [{ selector: 'natural-sidenav-container', providers: [NaturalSidenavService], template: "<mat-sidenav-container (backdropClick)=\"sidenavService.setOpened(false)\">\n <mat-sidenav\n [mode]=\"sidenavService.activeMode\"\n [ngClass]=\"sidenavService.isMinimized ? 'menuMinimized' : ''\"\n [opened]=\"sidenavService.isOpened\"\n [style.min-width.px]=\"sidenavService.isMinimized && minimizedWidth ? minimizedWidth : null\"\n [style.width.px]=\"sidenavService.isMinimized && minimizedWidth ? minimizedWidth : null\"\n [position]=\"position\"\n >\n <ng-content select=\"natural-sidenav\"></ng-content>\n </mat-sidenav>\n\n <mat-sidenav-content>\n <div>\n <ng-content select=\"natural-sidenav-content\"></ng-content>\n </div>\n </mat-sidenav-content>\n</mat-sidenav-container>\n", styles: [":host{display:flex;flex-direction:column}:host mat-sidenav-container{display:flex;flex-direction:column;flex:1}:host mat-sidenav-content>div{overflow:auto}:host .menuMinimized{overflow-x:hidden}:host .buttons{display:flex;flex-direction:row;justify-content:flex-end}\n"] }]
|
|
9790
9792
|
}], ctorParameters: function () { return [{ type: NaturalSidenavService }, { type: i0.ElementRef }]; }, propDecorators: { name: [{
|
|
9791
9793
|
type: Input
|
|
9792
9794
|
}], position: [{
|
|
@@ -10485,11 +10487,129 @@ 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.error(error);
|
|
10502
|
+
const params = {
|
|
10503
|
+
href: this.document.defaultView?.window.location.href,
|
|
10504
|
+
host: this.document.defaultView?.window.location.hostname,
|
|
10505
|
+
path: this.document.defaultView?.window.location.pathname,
|
|
10506
|
+
agent: this.document.defaultView?.window.navigator.userAgent,
|
|
10507
|
+
level: 'error',
|
|
10508
|
+
};
|
|
10509
|
+
if (error?.message) {
|
|
10510
|
+
params.message = error.message;
|
|
10511
|
+
}
|
|
10512
|
+
else {
|
|
10513
|
+
params.message = error;
|
|
10514
|
+
}
|
|
10515
|
+
if (error?.stack) {
|
|
10516
|
+
params.stacktrace = error.stack;
|
|
10517
|
+
}
|
|
10518
|
+
if (typeof error?.status !== 'undefined') {
|
|
10519
|
+
params.status = error.status;
|
|
10520
|
+
}
|
|
10521
|
+
if (error?.referrer) {
|
|
10522
|
+
params.referrer = error.referrer;
|
|
10523
|
+
}
|
|
10524
|
+
if (error?.url) {
|
|
10525
|
+
params.url = error.url;
|
|
10526
|
+
}
|
|
10527
|
+
if (this.loggerExtra) {
|
|
10528
|
+
this.loggerExtra?.getExtras(error).subscribe(result => {
|
|
10529
|
+
this.postLog(Object.assign(params, result));
|
|
10530
|
+
});
|
|
10531
|
+
}
|
|
10532
|
+
else {
|
|
10533
|
+
this.postLog(params);
|
|
10534
|
+
}
|
|
10535
|
+
}
|
|
10536
|
+
/**
|
|
10537
|
+
* Send parameters to remote log
|
|
10538
|
+
*/
|
|
10539
|
+
postLog(params) {
|
|
10540
|
+
if (this.url) {
|
|
10541
|
+
this.http
|
|
10542
|
+
.post(this.url, params, { headers: new HttpHeaders().set('content-type', 'application/json') })
|
|
10543
|
+
.pipe(catchError(() => {
|
|
10544
|
+
return EMPTY;
|
|
10545
|
+
}))
|
|
10546
|
+
.subscribe();
|
|
10547
|
+
}
|
|
10548
|
+
}
|
|
10549
|
+
}
|
|
10550
|
+
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 });
|
|
10551
|
+
NaturalErrorHandler.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: NaturalErrorHandler, providedIn: 'root' });
|
|
10552
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: NaturalErrorHandler, decorators: [{
|
|
10553
|
+
type: Injectable,
|
|
10554
|
+
args: [{
|
|
10555
|
+
providedIn: 'root',
|
|
10556
|
+
}]
|
|
10557
|
+
}], ctorParameters: function () { return [{ type: i1$a.HttpClient }, { type: Document, decorators: [{
|
|
10558
|
+
type: Inject,
|
|
10559
|
+
args: [DOCUMENT]
|
|
10560
|
+
}] }, { type: undefined, decorators: [{
|
|
10561
|
+
type: Optional
|
|
10562
|
+
}, {
|
|
10563
|
+
type: Inject,
|
|
10564
|
+
args: [NaturalLoggerConfigUrl]
|
|
10565
|
+
}] }, { type: undefined, decorators: [{
|
|
10566
|
+
type: Optional
|
|
10567
|
+
}, {
|
|
10568
|
+
type: Inject,
|
|
10569
|
+
args: [NaturalLoggerConfigExtra]
|
|
10570
|
+
}] }]; } });
|
|
10571
|
+
|
|
10572
|
+
class NaturalErrorModule {
|
|
10573
|
+
static forRoot(url, extraService) {
|
|
10574
|
+
const providers = [];
|
|
10575
|
+
providers.push({
|
|
10576
|
+
provide: ErrorHandler,
|
|
10577
|
+
useClass: NaturalErrorHandler,
|
|
10578
|
+
}, {
|
|
10579
|
+
provide: NaturalLoggerConfigUrl,
|
|
10580
|
+
useValue: url,
|
|
10581
|
+
});
|
|
10582
|
+
if (extraService) {
|
|
10583
|
+
providers.push({
|
|
10584
|
+
provide: NaturalLoggerConfigExtra,
|
|
10585
|
+
useClass: extraService,
|
|
10586
|
+
});
|
|
10587
|
+
}
|
|
10588
|
+
return {
|
|
10589
|
+
ngModule: NaturalErrorModule,
|
|
10590
|
+
providers: providers,
|
|
10591
|
+
};
|
|
10592
|
+
}
|
|
10593
|
+
}
|
|
10594
|
+
NaturalErrorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: NaturalErrorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
10595
|
+
NaturalErrorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: NaturalErrorModule, imports: [HttpClientModule] });
|
|
10596
|
+
NaturalErrorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: NaturalErrorModule, imports: [[HttpClientModule]] });
|
|
10597
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: NaturalErrorModule, decorators: [{
|
|
10598
|
+
type: NgModule,
|
|
10599
|
+
args: [{
|
|
10600
|
+
imports: [HttpClientModule],
|
|
10601
|
+
}]
|
|
10602
|
+
}] });
|
|
10603
|
+
|
|
10604
|
+
/*
|
|
10605
|
+
* Public API Surface of natural
|
|
10606
|
+
*/
|
|
10607
|
+
|
|
10488
10608
|
// Load `$localize` onto the global scope - to be able to use that function to translate strings in components/services.
|
|
10489
10609
|
|
|
10490
10610
|
/**
|
|
10491
10611
|
* Generated bundle index. Do not edit.
|
|
10492
10612
|
*/
|
|
10493
10613
|
|
|
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 };
|
|
10614
|
+
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, NaturalErrorHandler, NaturalErrorModule, NaturalFileDropDirective, NaturalFileModule, NaturalFileSelectDirective, NaturalFileService, NaturalFixedButtonComponent, NaturalFixedButtonDetailComponent, NaturalFixedButtonDetailModule, NaturalFixedButtonModule, NaturalHierarchicSelectorComponent, NaturalHierarchicSelectorDialogComponent, NaturalHierarchicSelectorDialogService, NaturalHierarchicSelectorModule, NaturalHierarchicSelectorService, NaturalHttpPrefixDirective, NaturalIconComponent, NaturalIconModule, NaturalLinkMutationService, NaturalLinkableTabDirective, NaturalLoggerConfigExtra, NaturalLoggerConfigUrl, 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
10615
|
//# sourceMappingURL=ecodev-natural.mjs.map
|