@ecodev/natural 42.3.4 → 42.4.2
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/classes/rxjs.mjs +2 -1
- package/esm2020/lib/modules/logger/error-handler.mjs +26 -11
- package/esm2020/lib/modules/logger/public-api.mjs +3 -3
- package/esm2020/lib/modules/search/dropdown-container/dropdown-container.component.mjs +3 -3
- package/esm2020/lib/modules/table-button/table-button.component.mjs +21 -6
- package/fesm2015/ecodev-natural.mjs +48 -16
- package/fesm2015/ecodev-natural.mjs.map +1 -1
- package/fesm2020/ecodev-natural.mjs +46 -15
- package/fesm2020/ecodev-natural.mjs.map +1 -1
- package/lib/modules/logger/error-handler.d.ts +19 -3
- package/lib/modules/logger/public-api.d.ts +2 -2
- package/lib/modules/table-button/table-button.component.d.ts +9 -6
- package/package.json +1 -1
|
@@ -39,9 +39,10 @@ export function cancellableTimeout(canceller, milliSeconds = 0) {
|
|
|
39
39
|
*/
|
|
40
40
|
export function debug(debugName) {
|
|
41
41
|
return tap({
|
|
42
|
+
subscribe: () => console.log('SUBSCRIBE', debugName),
|
|
42
43
|
next: value => console.log('NEXT', debugName, value),
|
|
43
44
|
error: error => console.log('ERROR', debugName, error),
|
|
44
45
|
complete: () => console.log('COMPLETE', debugName),
|
|
45
46
|
});
|
|
46
47
|
}
|
|
47
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
48
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicnhqcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL25hdHVyYWwvc3JjL2xpYi9jbGFzc2VzL3J4anMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUF1QyxLQUFLLEVBQUMsTUFBTSxNQUFNLENBQUM7QUFDakUsT0FBTyxFQUFDLEdBQUcs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IGZ1bmN0aW9uIGNhbmNlbGxhYmxlVGltZW91dChjYW5jZWxsZXI6IE9ic2VydmFibGU8dW5rbm93bj4sIG1pbGxpU2Vjb25kczogbnVtYmVyID0gMCk6IE9ic2VydmFibGU8dm9pZD4ge1xuICAgIHJldHVybiB0aW1lcihtaWxsaVNlY29uZHMpLnBpcGUoXG4gICAgICAgIHRha2UoMSksXG4gICAgICAgIHRha2VVbnRpbChjYW5jZWxsZXIpLFxuICAgICAgICBtYXAoKCkgPT4ge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9KSxcbiAgICApO1xufVxuXG4vKipcbiAqIEZvciBkZWJ1Z2dpbmcgcHVycG9zZSBvbmx5LCB3aWxsIGR1bXAgaW4gY29uc29sZSBldmVyeXRoaW5nIHRoYXQgaGFwcGVuIHRvXG4gKiB0aGUgb2JzZXJ2YWJsZVxuICovXG5leHBvcnQgZnVuY3Rpb24gZGVidWc8VD4oZGVidWdOYW1lOiBzdHJpbmcpOiBNb25vVHlwZU9wZXJhdG9yRnVuY3Rpb248VD4ge1xuICAgIHJldHVybiB0YXA8VD4oe1xuICAgICAgICBzdWJzY3JpYmU6ICgpID0+IGNvbnNvbGUubG9nKCdTVUJTQ1JJQkUnLCBkZWJ1Z05hbWUpLFxuICAgICAgICBuZXh0OiB2YWx1ZSA9PiBjb25zb2xlLmxvZygnTkVYVCcsIGRlYnVnTmFtZSwgdmFsdWUpLFxuICAgICAgICBlcnJvcjogZXJyb3IgPT4gY29uc29sZS5sb2coJ0VSUk9SJywgZGVidWdOYW1lLCBlcnJvciksXG4gICAgICAgIGNvbXBsZXRlOiAoKSA9PiBjb25zb2xlLmxvZygnQ09NUExFVEUnLCBkZWJ1Z05hbWUpLFxuICAgIH0pO1xufVxuIl19
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
import { DOCUMENT } from '@angular/common';
|
|
2
2
|
import { HttpHeaders } from '@angular/common/http';
|
|
3
3
|
import { ErrorHandler, Inject, Injectable, InjectionToken, Optional } from '@angular/core';
|
|
4
|
-
import { catchError, EMPTY } from 'rxjs';
|
|
4
|
+
import { catchError, EMPTY, first, of } from 'rxjs';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
import * as i1 from "@angular/common/http";
|
|
7
|
-
export const NaturalLoggerConfigUrl = new InjectionToken('
|
|
8
|
-
export const NaturalLoggerConfigExtra = new InjectionToken('
|
|
7
|
+
export const NaturalLoggerConfigUrl = new InjectionToken('Absolute URL of the log server');
|
|
8
|
+
export const NaturalLoggerConfigExtra = new InjectionToken('Class that may provide extra data to log');
|
|
9
|
+
/**
|
|
10
|
+
* Replace Angular's error handler to also send the log to a remote server via HTTP POST.
|
|
11
|
+
*
|
|
12
|
+
* Usage is automatic as soon we import the module via:
|
|
13
|
+
*
|
|
14
|
+
* ```ts
|
|
15
|
+
* NaturalErrorModule.forRoot('http://example.com', ExtraService),
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
9
18
|
export class NaturalErrorHandler extends ErrorHandler {
|
|
10
19
|
constructor(http, document, url, loggerExtra) {
|
|
11
20
|
super();
|
|
@@ -17,18 +26,13 @@ export class NaturalErrorHandler extends ErrorHandler {
|
|
|
17
26
|
handleError(error) {
|
|
18
27
|
console.error(error);
|
|
19
28
|
const params = {
|
|
29
|
+
message: this.toMessage(error),
|
|
20
30
|
href: this.document.defaultView?.window.location.href,
|
|
21
31
|
host: this.document.defaultView?.window.location.hostname,
|
|
22
32
|
path: this.document.defaultView?.window.location.pathname,
|
|
23
33
|
agent: this.document.defaultView?.window.navigator.userAgent,
|
|
24
34
|
level: 'error',
|
|
25
35
|
};
|
|
26
|
-
if (error?.message) {
|
|
27
|
-
params.message = error.message;
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
params.message = error;
|
|
31
|
-
}
|
|
32
36
|
if (error?.stack) {
|
|
33
37
|
params.stacktrace = error.stack;
|
|
34
38
|
}
|
|
@@ -42,7 +46,10 @@ export class NaturalErrorHandler extends ErrorHandler {
|
|
|
42
46
|
params.url = error.url;
|
|
43
47
|
}
|
|
44
48
|
if (this.loggerExtra) {
|
|
45
|
-
this.loggerExtra
|
|
49
|
+
this.loggerExtra
|
|
50
|
+
.getExtras(error)
|
|
51
|
+
.pipe(catchError(e => of({ getExtrasErrorMessage: this.toMessage(e) })), first())
|
|
52
|
+
.subscribe(result => {
|
|
46
53
|
this.postLog(Object.assign(params, result));
|
|
47
54
|
});
|
|
48
55
|
}
|
|
@@ -50,6 +57,14 @@ export class NaturalErrorHandler extends ErrorHandler {
|
|
|
50
57
|
this.postLog(params);
|
|
51
58
|
}
|
|
52
59
|
}
|
|
60
|
+
toMessage(error) {
|
|
61
|
+
if (error && typeof error === 'object' && 'message' in error) {
|
|
62
|
+
return '' + error.message;
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
return '' + error;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
53
68
|
/**
|
|
54
69
|
* Send parameters to remote log
|
|
55
70
|
*/
|
|
@@ -85,4 +100,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
|
|
|
85
100
|
type: Inject,
|
|
86
101
|
args: [NaturalLoggerConfigExtra]
|
|
87
102
|
}] }]; } });
|
|
88
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
103
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXJyb3ItaGFuZGxlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL25hdHVyYWwvc3JjL2xpYi9tb2R1bGVzL2xvZ2dlci9lcnJvci1oYW5kbGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBQyxRQUFRLEVBQUMsTUFBTSxpQkFBaUIsQ0FBQztBQUN6QyxPQUFPLEVBQWEsV0FBVyxFQUFDLE1BQU0sc0JBQXN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XRvci51c2VyQWdlbnQsXG4gICAgICAgICAgICBsZXZlbDogJ2Vycm9yJyxcbiAgICAgICAgfTtcblxuICAgICAgICBpZiAoZXJyb3I/LnN0YWNrKSB7XG4gICAgICAgICAgICBwYXJhbXMuc3RhY2t0cmFjZSA9IGVycm9yLnN0YWNrO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHR5cGVvZiBlcnJvcj8uc3RhdHVzICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgcGFyYW1zLnN0YXR1cyA9IGVycm9yLnN0YXR1cztcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChlcnJvcj8ucmVmZXJyZXIpIHtcbiAgICAgICAgICAgIHBhcmFtcy5yZWZlcnJlciA9IGVycm9yLnJlZmVycmVyO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGVycm9yPy51cmwpIHtcbiAgICAgICAgICAgIHBhcmFtcy51cmwgPSBlcnJvci51cmw7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGhpcy5sb2dnZXJFeHRyYSkge1xuICAgICAgICAgICAgdGhpcy5sb2dnZXJFeHRyYVxuICAgICAgICAgICAgICAgIC5nZXRFeHRyYXMoZXJyb3IpXG4gICAgICAgICAgICAgICAgLnBpcGUoXG4gICAgICAgICAgICAgICAgICAgIGNhdGNoRXJyb3IoZSA9PiBvZih7Z2V0RXh0cmFzRXJyb3JNZXNzYWdlOiB0aGlzLnRvTWVzc2FnZShlKX0pKSxcbiAgICAgICAgICAgICAgICAgICAgZmlyc3QoKSxcbiAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgLnN1YnNjcmliZShyZXN1bHQgPT4ge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnBvc3RMb2coT2JqZWN0LmFzc2lnbihwYXJhbXMsIHJlc3VsdCkpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5wb3N0TG9nKHBhcmFtcyk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBwcml2YXRlIHRvTWVzc2FnZShlcnJvcjogYW55KTogc3RyaW5nIHtcbiAgICAgICAgaWYgKGVycm9yICYmIHR5cGVvZiBlcnJvciA9PT0gJ29iamVjdCcgJiYgJ21lc3NhZ2UnIGluIGVycm9yKSB7XG4gICAgICAgICAgICByZXR1cm4gJycgKyBlcnJvci5tZXNzYWdlO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuICcnICsgZXJyb3I7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBTZW5kIHBhcmFtZXRlcnMgdG8gcmVtb3RlIGxvZ1xuICAgICAqL1xuICAgIHByaXZhdGUgcG9zdExvZyhwYXJhbXM6IE5hdHVyYWxMb2dnZXJUeXBlKTogdm9pZCB7XG4gICAgICAgIGlmICh0aGlzLnVybCkge1xuICAgICAgICAgICAgdGhpcy5odHRwXG4gICAgICAgICAgICAgICAgLnBvc3QodGhpcy51cmwsIHBhcmFtcywge2hlYWRlcnM6IG5ldyBIdHRwSGVhZGVycygpLnNldCgnY29udGVudC10eXBlJywgJ2FwcGxpY2F0aW9uL2pzb24nKX0pXG4gICAgICAgICAgICAgICAgLnBpcGUoXG4gICAgICAgICAgICAgICAgICAgIGNhdGNoRXJyb3IoKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEVNUFRZO1xuICAgICAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgLnN1YnNjcmliZSgpO1xuICAgICAgICB9XG4gICAgfVxufVxuIl19
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Public API Surface of natural
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
4
|
+
export { NaturalErrorModule } from './error.module';
|
|
5
|
+
export { NaturalErrorHandler, NaturalLoggerConfigExtra, NaturalLoggerConfigUrl, } from './error-handler';
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL25hdHVyYWwvc3JjL2xpYi9tb2R1bGVzL2xvZ2dlci9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsT0FBTyxFQUFDLGtCQUFrQixFQUFDLE1BQU0sZ0JBQWdCLENBQUM7QUFFbEQsT0FBTyxFQUNILG1CQUFtQixFQUNuQix3QkFBd0IsRUFDeEIsc0JBQXNCLEdBR3pCLE1BQU0saUJBQWlCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKlxuICogUHVibGljIEFQSSBTdXJmYWNlIG9mIG5hdHVyYWxcbiAqL1xuXG5leHBvcnQge05hdHVyYWxFcnJvck1vZHVsZX0gZnJvbSAnLi9lcnJvci5tb2R1bGUnO1xuXG5leHBvcnQge1xuICAgIE5hdHVyYWxFcnJvckhhbmRsZXIsXG4gICAgTmF0dXJhbExvZ2dlckNvbmZpZ0V4dHJhLFxuICAgIE5hdHVyYWxMb2dnZXJDb25maWdVcmwsXG4gICAgTmF0dXJhbExvZ2dlckV4dHJhLFxuICAgIE5hdHVyYWxMb2dnZXJUeXBlLFxufSBmcm9tICcuL2Vycm9yLWhhbmRsZXInO1xuIl19
|
|
@@ -71,10 +71,10 @@ export class NaturalDropdownContainerComponent extends BasePortalOutlet {
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
NaturalDropdownContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: NaturalDropdownContainerComponent, deps: [{ token: i0.ElementRef }, { token: i1.ConfigurableFocusTrapFactory }, { token: NATURAL_DROPDOWN_CONTAINER_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
74
|
-
NaturalDropdownContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.0", type: NaturalDropdownContainerComponent, selector: "ng-component", viewQueries: [{ propertyName: "portalOutlet", first: true, predicate: CdkPortalOutlet, descendants: true, static: true }, { propertyName: "templateRef", first: true, predicate: TemplateRef, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<div\n (@transformMenu.done)=\"onAnimationDone($event)\"\n [@transformMenu]=\"panelAnimationState\"\n class=\"natural-dropdown-container mat-elevation-z2\"\n role=\"menu\"\n tabindex=\"-1\"\n>\n <div class=\"natural-dropdown-container-content\">\n <ng-template cdkPortalOutlet></ng-template>\n </div>\n\n <div *ngIf=\"data.showValidateButton\" class=\"natural-dropdown-validate-button\">\n <button (click)=\"close()\" color=\"primary\" mat-raised-button>Valider</button>\n </div>\n</div>\n", styles: [".natural-dropdown-container{display:flex;flex-direction:column;border-radius:2px;height:100%}.natural-dropdown-container-content{flex:1;padding:5px;overflow:auto}.natural-dropdown-container .natural-dropdown-validate-button{flex:none;display:flex;flex-direction:row;justify-content:flex-end;margin:5px}\n"], components: [{ type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i3.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], animations: [naturalDropdownAnimations.transformMenu, naturalDropdownAnimations.fadeInItems], encapsulation: i0.ViewEncapsulation.None });
|
|
74
|
+
NaturalDropdownContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.0", type: NaturalDropdownContainerComponent, selector: "ng-component", viewQueries: [{ propertyName: "portalOutlet", first: true, predicate: CdkPortalOutlet, descendants: true, static: true }, { propertyName: "templateRef", first: true, predicate: TemplateRef, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<div\n (@transformMenu.done)=\"onAnimationDone($event)\"\n [@transformMenu]=\"panelAnimationState\"\n class=\"natural-dropdown-container mat-elevation-z2\"\n role=\"menu\"\n tabindex=\"-1\"\n>\n <div class=\"natural-dropdown-container-content\">\n <ng-template cdkPortalOutlet></ng-template>\n </div>\n\n <div *ngIf=\"data.showValidateButton\" class=\"natural-dropdown-validate-button\">\n <button (click)=\"close()\" color=\"primary\" mat-raised-button i18n>Valider</button>\n </div>\n</div>\n", styles: [".natural-dropdown-container{display:flex;flex-direction:column;border-radius:2px;height:100%}.natural-dropdown-container-content{flex:1;padding:5px;overflow:auto}.natural-dropdown-container .natural-dropdown-validate-button{flex:none;display:flex;flex-direction:row;justify-content:flex-end;margin:5px}\n"], components: [{ type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i3.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], animations: [naturalDropdownAnimations.transformMenu, naturalDropdownAnimations.fadeInItems], encapsulation: i0.ViewEncapsulation.None });
|
|
75
75
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: NaturalDropdownContainerComponent, decorators: [{
|
|
76
76
|
type: Component,
|
|
77
|
-
args: [{ encapsulation: ViewEncapsulation.None, preserveWhitespaces: false, animations: [naturalDropdownAnimations.transformMenu, naturalDropdownAnimations.fadeInItems], template: "<div\n (@transformMenu.done)=\"onAnimationDone($event)\"\n [@transformMenu]=\"panelAnimationState\"\n class=\"natural-dropdown-container mat-elevation-z2\"\n role=\"menu\"\n tabindex=\"-1\"\n>\n <div class=\"natural-dropdown-container-content\">\n <ng-template cdkPortalOutlet></ng-template>\n </div>\n\n <div *ngIf=\"data.showValidateButton\" class=\"natural-dropdown-validate-button\">\n <button (click)=\"close()\" color=\"primary\" mat-raised-button>Valider</button>\n </div>\n</div>\n", styles: [".natural-dropdown-container{display:flex;flex-direction:column;border-radius:2px;height:100%}.natural-dropdown-container-content{flex:1;padding:5px;overflow:auto}.natural-dropdown-container .natural-dropdown-validate-button{flex:none;display:flex;flex-direction:row;justify-content:flex-end;margin:5px}\n"] }]
|
|
77
|
+
args: [{ encapsulation: ViewEncapsulation.None, preserveWhitespaces: false, animations: [naturalDropdownAnimations.transformMenu, naturalDropdownAnimations.fadeInItems], template: "<div\n (@transformMenu.done)=\"onAnimationDone($event)\"\n [@transformMenu]=\"panelAnimationState\"\n class=\"natural-dropdown-container mat-elevation-z2\"\n role=\"menu\"\n tabindex=\"-1\"\n>\n <div class=\"natural-dropdown-container-content\">\n <ng-template cdkPortalOutlet></ng-template>\n </div>\n\n <div *ngIf=\"data.showValidateButton\" class=\"natural-dropdown-validate-button\">\n <button (click)=\"close()\" color=\"primary\" mat-raised-button i18n>Valider</button>\n </div>\n</div>\n", styles: [".natural-dropdown-container{display:flex;flex-direction:column;border-radius:2px;height:100%}.natural-dropdown-container-content{flex:1;padding:5px;overflow:auto}.natural-dropdown-container .natural-dropdown-validate-button{flex:none;display:flex;flex-direction:row;justify-content:flex-end;margin:5px}\n"] }]
|
|
78
78
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.ConfigurableFocusTrapFactory }, { type: undefined, decorators: [{
|
|
79
79
|
type: Inject,
|
|
80
80
|
args: [NATURAL_DROPDOWN_CONTAINER_DATA]
|
|
@@ -85,4 +85,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
|
|
|
85
85
|
type: ViewChild,
|
|
86
86
|
args: [TemplateRef, { static: true }]
|
|
87
87
|
}] } });
|
|
88
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
88
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHJvcGRvd24tY29udGFpbmVyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL25hdHVyYWwvc3JjL2xpYi9tb2R1bGVzL3NlYXJjaC9kcm9wZG93bi1jb250YWluZXIvZHJvcGRvd24tY29udGFpbmVyLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL25hdHVyYWwvc3JjL2xpYi9tb2R1bGVzL3NlYXJjaC9kcm9wZG93bi1jb250YWluZXIvZHJvcGRvd24tY29udGFpbmVyLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLE9BQU8sRUFBQyxnQkFBZ0IsRUFBRSxlQUFlLEVBQWtDLE1BQU0scUJBQXFCLENBQUM7QUFDdkcsT0FBTyxFQUNILFNBQVMsRUFJVCxNQUFNLEVBQ04sY0FBYyxFQUVkLFdBQVcsRUFDWCxTQUFTLEVBQ1QsaUJBQWlCLEdBQ3BCLE1BQU0sZUFBZSxDQUFDO0FBQ3ZCLE9BQU8sRUFBQyxPQUFPLEVBQUMsTUFBTSxNQUFNLENBQUM7QUFDN0IsT0FBTyxFQUFDLHlCQUF5QixFQUFDLE1BQU0saUNBQWlDLENBQUM7Ozs7OztBQUUxRSxNQUFNLFVBQVUseUNBQXlDO0lBQ3JELE1BQU0sS0FBSyxDQUFDLHVFQUF1RSxDQUFDLENBQUM7QUFDekYsQ0FBQztBQU1ELE1BQU0sQ0FBQyxNQUFNLCtCQUErQ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from "@angular/core";
|
|
3
|
-
import * as i1 from "
|
|
4
|
-
import * as i2 from "
|
|
3
|
+
import * as i1 from "../icon/icon.component";
|
|
4
|
+
import * as i2 from "@angular/material/button";
|
|
5
5
|
import * as i3 from "@angular/common";
|
|
6
6
|
import * as i4 from "@angular/router";
|
|
7
7
|
/**
|
|
8
8
|
* Button that fits well in a `<mat-table>` and support either
|
|
9
9
|
* route navigation via `navigate` or external URL via `href`.
|
|
10
10
|
*
|
|
11
|
+
* If neither `navigate` nor `href` has a meaningful value, then
|
|
12
|
+
* it will show the icon and/or label in `<span>` instead of a button
|
|
13
|
+
*
|
|
11
14
|
* External URL will always be opened in new tab.
|
|
12
15
|
*/
|
|
13
16
|
export class NaturalTableButtonComponent {
|
|
@@ -17,14 +20,26 @@ export class NaturalTableButtonComponent {
|
|
|
17
20
|
this.navigate = [];
|
|
18
21
|
this.preserveFragment = false;
|
|
19
22
|
this.raised = false;
|
|
23
|
+
this.type = 'none';
|
|
24
|
+
}
|
|
25
|
+
ngOnChanges(changes) {
|
|
26
|
+
if (this.navigate?.length || Object.keys(this.queryParams).length) {
|
|
27
|
+
this.type = 'routerLink';
|
|
28
|
+
}
|
|
29
|
+
else if (this.href) {
|
|
30
|
+
this.type = 'href';
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
this.type = 'none';
|
|
34
|
+
}
|
|
20
35
|
}
|
|
21
36
|
}
|
|
22
37
|
NaturalTableButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: NaturalTableButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
23
|
-
NaturalTableButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.0", type: NaturalTableButtonComponent, selector: "natural-table-button", inputs: { queryParams: "queryParams", queryParamsHandling: "queryParamsHandling", label: "label", icon: "icon", href: "href", navigate: "navigate", fragment: "fragment", preserveFragment: "preserveFragment", raised: "raised", color: "color" }, ngImport: i0, template: "<!-- Because directives can't be applied conditionally (routerLink, mat-button and mat-icon-button), we have to use different elements -->\n\n<ng-container *ngIf=\"!raised\">\n <!-- App routed link with label... -->\n <a\n *ngIf=\"
|
|
38
|
+
NaturalTableButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.0", type: NaturalTableButtonComponent, selector: "natural-table-button", inputs: { queryParams: "queryParams", queryParamsHandling: "queryParamsHandling", label: "label", icon: "icon", href: "href", navigate: "navigate", fragment: "fragment", preserveFragment: "preserveFragment", raised: "raised", color: "color" }, usesOnChanges: true, ngImport: i0, template: "<!-- Because directives can't be applied conditionally (routerLink, mat-button and mat-icon-button), we have to use different elements -->\n\n<!-- Edge case of a button without any kind of link at all -->\n<span *ngIf=\"type === 'none'\">\n <natural-icon *ngIf=\"icon\" [name]=\"icon\"></natural-icon>\n <span *ngIf=\"label\">{{ label }}</span>\n</span>\n\n<ng-container *ngIf=\"!raised\">\n <!-- App routed link with label... -->\n <a\n *ngIf=\"type === 'routerLink' && label\"\n [color]=\"color\"\n [queryParams]=\"queryParams\"\n [queryParamsHandling]=\"queryParamsHandling\"\n [routerLink]=\"navigate\"\n [fragment]=\"fragment\"\n [preserveFragment]=\"preserveFragment\"\n mat-button\n >\n <natural-icon *ngIf=\"icon\" [name]=\"icon\"></natural-icon>\n <span>{{ label }}</span>\n </a>\n\n <!-- ... and without label -->\n <a\n *ngIf=\"type === 'routerLink' && !label\"\n [color]=\"color\"\n [queryParams]=\"queryParams\"\n [queryParamsHandling]=\"queryParamsHandling\"\n [routerLink]=\"navigate\"\n [fragment]=\"fragment\"\n [preserveFragment]=\"preserveFragment\"\n mat-icon-button\n >\n <natural-icon *ngIf=\"icon\" [name]=\"icon\"></natural-icon>\n </a>\n\n <!-- External link with label... -->\n <a *ngIf=\"type === 'href' && label\" [attr.href]=\"href\" [color]=\"color\" mat-button target=\"_blank\">\n <natural-icon *ngIf=\"icon\" [name]=\"icon\"></natural-icon>\n <span>{{ label }}</span>\n </a>\n\n <!-- ... and without label -->\n <a *ngIf=\"type === 'href' && !label\" [attr.href]=\"href\" [color]=\"color\" mat-icon-button target=\"_blank\">\n <natural-icon *ngIf=\"icon\" [name]=\"icon\"></natural-icon>\n </a>\n</ng-container>\n\n<ng-container *ngIf=\"raised\">\n <!-- App routed link with label... -->\n <a\n *ngIf=\"type === 'routerLink' && label\"\n [color]=\"color\"\n [queryParams]=\"queryParams\"\n [queryParamsHandling]=\"queryParamsHandling\"\n [routerLink]=\"navigate\"\n [fragment]=\"fragment\"\n [preserveFragment]=\"preserveFragment\"\n mat-raised-button\n >\n <natural-icon *ngIf=\"icon\" [name]=\"icon\"></natural-icon>\n <span>{{ label }}</span>\n </a>\n\n <!-- ... and without label -->\n <a\n *ngIf=\"type === 'routerLink' && !label\"\n [color]=\"color\"\n [queryParams]=\"queryParams\"\n [queryParamsHandling]=\"queryParamsHandling\"\n [routerLink]=\"navigate\"\n [fragment]=\"fragment\"\n [preserveFragment]=\"preserveFragment\"\n mat-icon-button\n mat-raised-button\n >\n <natural-icon *ngIf=\"icon\" [name]=\"icon\"></natural-icon>\n </a>\n\n <!-- External link with label... -->\n <a *ngIf=\"type === 'href' && label\" [attr.href]=\"href\" [color]=\"color\" mat-raised-button target=\"_blank\">\n <natural-icon *ngIf=\"icon\" [name]=\"icon\"></natural-icon>\n <span>{{ label }}</span>\n </a>\n\n <!-- ... and without label -->\n <a\n *ngIf=\"type === 'href' && !label\"\n [attr.href]=\"href\"\n [color]=\"color\"\n mat-icon-button\n mat-raised-button\n target=\"_blank\"\n >\n <natural-icon *ngIf=\"icon\" [name]=\"icon\"></natural-icon>\n </a>\n</ng-container>\n", styles: ["natural-table-button{flex:1;display:flex;flex-direction:row;justify-content:flex-start;align-items:center}natural-table-button a.mat-button{flex:1;display:flex;flex-direction:row;align-items:center;justify-content:flex-start}natural-table-button a.mat-button .mat-button-wrapper{display:flex;flex-direction:row;align-items:center}natural-table-button a.mat-button .mat-button-wrapper>*{display:flex;flex-direction:row;align-items:center}natural-table-button a.mat-button .mat-button-wrapper>:not(:last-child){margin-right:5px}natural-table-button>span{padding:0 16px}\n"], components: [{ type: i1.NaturalIconComponent, selector: "natural-icon", inputs: ["label", "labelColor", "labelPosition", "name", "size"] }, { type: i2.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab], a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
24
39
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: NaturalTableButtonComponent, decorators: [{
|
|
25
40
|
type: Component,
|
|
26
|
-
args: [{ selector: 'natural-table-button', encapsulation: ViewEncapsulation.None, template: "<!-- Because directives can't be applied conditionally (routerLink, mat-button and mat-icon-button), we have to use different elements -->\n\n<ng-container *ngIf=\"!raised\">\n <!-- App routed link with label... -->\n <a\n *ngIf=\"
|
|
27
|
-
}],
|
|
41
|
+
args: [{ selector: 'natural-table-button', encapsulation: ViewEncapsulation.None, template: "<!-- Because directives can't be applied conditionally (routerLink, mat-button and mat-icon-button), we have to use different elements -->\n\n<!-- Edge case of a button without any kind of link at all -->\n<span *ngIf=\"type === 'none'\">\n <natural-icon *ngIf=\"icon\" [name]=\"icon\"></natural-icon>\n <span *ngIf=\"label\">{{ label }}</span>\n</span>\n\n<ng-container *ngIf=\"!raised\">\n <!-- App routed link with label... -->\n <a\n *ngIf=\"type === 'routerLink' && label\"\n [color]=\"color\"\n [queryParams]=\"queryParams\"\n [queryParamsHandling]=\"queryParamsHandling\"\n [routerLink]=\"navigate\"\n [fragment]=\"fragment\"\n [preserveFragment]=\"preserveFragment\"\n mat-button\n >\n <natural-icon *ngIf=\"icon\" [name]=\"icon\"></natural-icon>\n <span>{{ label }}</span>\n </a>\n\n <!-- ... and without label -->\n <a\n *ngIf=\"type === 'routerLink' && !label\"\n [color]=\"color\"\n [queryParams]=\"queryParams\"\n [queryParamsHandling]=\"queryParamsHandling\"\n [routerLink]=\"navigate\"\n [fragment]=\"fragment\"\n [preserveFragment]=\"preserveFragment\"\n mat-icon-button\n >\n <natural-icon *ngIf=\"icon\" [name]=\"icon\"></natural-icon>\n </a>\n\n <!-- External link with label... -->\n <a *ngIf=\"type === 'href' && label\" [attr.href]=\"href\" [color]=\"color\" mat-button target=\"_blank\">\n <natural-icon *ngIf=\"icon\" [name]=\"icon\"></natural-icon>\n <span>{{ label }}</span>\n </a>\n\n <!-- ... and without label -->\n <a *ngIf=\"type === 'href' && !label\" [attr.href]=\"href\" [color]=\"color\" mat-icon-button target=\"_blank\">\n <natural-icon *ngIf=\"icon\" [name]=\"icon\"></natural-icon>\n </a>\n</ng-container>\n\n<ng-container *ngIf=\"raised\">\n <!-- App routed link with label... -->\n <a\n *ngIf=\"type === 'routerLink' && label\"\n [color]=\"color\"\n [queryParams]=\"queryParams\"\n [queryParamsHandling]=\"queryParamsHandling\"\n [routerLink]=\"navigate\"\n [fragment]=\"fragment\"\n [preserveFragment]=\"preserveFragment\"\n mat-raised-button\n >\n <natural-icon *ngIf=\"icon\" [name]=\"icon\"></natural-icon>\n <span>{{ label }}</span>\n </a>\n\n <!-- ... and without label -->\n <a\n *ngIf=\"type === 'routerLink' && !label\"\n [color]=\"color\"\n [queryParams]=\"queryParams\"\n [queryParamsHandling]=\"queryParamsHandling\"\n [routerLink]=\"navigate\"\n [fragment]=\"fragment\"\n [preserveFragment]=\"preserveFragment\"\n mat-icon-button\n mat-raised-button\n >\n <natural-icon *ngIf=\"icon\" [name]=\"icon\"></natural-icon>\n </a>\n\n <!-- External link with label... -->\n <a *ngIf=\"type === 'href' && label\" [attr.href]=\"href\" [color]=\"color\" mat-raised-button target=\"_blank\">\n <natural-icon *ngIf=\"icon\" [name]=\"icon\"></natural-icon>\n <span>{{ label }}</span>\n </a>\n\n <!-- ... and without label -->\n <a\n *ngIf=\"type === 'href' && !label\"\n [attr.href]=\"href\"\n [color]=\"color\"\n mat-icon-button\n mat-raised-button\n target=\"_blank\"\n >\n <natural-icon *ngIf=\"icon\" [name]=\"icon\"></natural-icon>\n </a>\n</ng-container>\n", styles: ["natural-table-button{flex:1;display:flex;flex-direction:row;justify-content:flex-start;align-items:center}natural-table-button a.mat-button{flex:1;display:flex;flex-direction:row;align-items:center;justify-content:flex-start}natural-table-button a.mat-button .mat-button-wrapper{display:flex;flex-direction:row;align-items:center}natural-table-button a.mat-button .mat-button-wrapper>*{display:flex;flex-direction:row;align-items:center}natural-table-button a.mat-button .mat-button-wrapper>:not(:last-child){margin-right:5px}natural-table-button>span{padding:0 16px}\n"] }]
|
|
42
|
+
}], propDecorators: { queryParams: [{
|
|
28
43
|
type: Input
|
|
29
44
|
}], queryParamsHandling: [{
|
|
30
45
|
type: Input
|
|
@@ -45,4 +60,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
|
|
|
45
60
|
}], color: [{
|
|
46
61
|
type: Input
|
|
47
62
|
}] } });
|
|
48
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
63
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFibGUtYnV0dG9uLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL25hdHVyYWwvc3JjL2xpYi9tb2R1bGVzL3RhYmxlLWJ1dHRvbi90YWJsZS1idXR0b24uY29tcG9uZW50LnRzIiwiLi4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09XCJjb2xvclwiIG1hdC1yYWlzZWQtYnV0dG9uIHRhcmdldD1cIl9ibGFua1wiPlxuICAgICAgICA8bmF0dXJhbC1pY29uICpuZ0lmPVwiaWNvblwiIFtuYW1lXT1cImljb25cIj48L25hdHVyYWwtaWNvbj5cbiAgICAgICAgPHNwYW4+e3sgbGFiZWwgfX08L3NwYW4+XG4gICAgPC9hPlxuXG4gICAgPCEtLSAuLi4gYW5kIHdpdGhvdXQgbGFiZWwgLS0+XG4gICAgPGFcbiAgICAgICAgKm5nSWY9XCJ0eXBlID09PSAnaHJlZicgJiYgIWxhYmVsXCJcbiAgICAgICAgW2F0dHIuaHJlZl09XCJocmVmXCJcbiAgICAgICAgW2NvbG9yXT1cImNvbG9yXCJcbiAgICAgICAgbWF0LWljb24tYnV0dG9uXG4gICAgICAgIG1hdC1yYWlzZWQtYnV0dG9uXG4gICAgICAgIHRhcmdldD1cIl9ibGFua1wiXG4gICAgPlxuICAgICAgICA8bmF0dXJhbC1pY29uICpuZ0lmPVwiaWNvblwiIFtuYW1lXT1cImljb25cIj48L25hdHVyYWwtaWNvbj5cbiAgICA8L2E+XG48L25nLWNvbnRhaW5lcj5cbiJdfQ==
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '@angular/localize/init';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
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';
|
|
4
|
+
import { Subject, BehaviorSubject, of, timer, EMPTY, Observable, ReplaySubject, forkJoin, merge as merge$1, asyncScheduler, catchError, first as first$1 } 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';
|
|
@@ -3560,6 +3560,7 @@ function cancellableTimeout(canceller, milliSeconds = 0) {
|
|
|
3560
3560
|
*/
|
|
3561
3561
|
function debug(debugName) {
|
|
3562
3562
|
return tap({
|
|
3563
|
+
subscribe: () => console.log('SUBSCRIBE', debugName),
|
|
3563
3564
|
next: value => console.log('NEXT', debugName, value),
|
|
3564
3565
|
error: error => console.log('ERROR', debugName, error),
|
|
3565
3566
|
complete: () => console.log('COMPLETE', debugName),
|
|
@@ -5211,10 +5212,10 @@ class NaturalDropdownContainerComponent extends BasePortalOutlet {
|
|
|
5211
5212
|
}
|
|
5212
5213
|
}
|
|
5213
5214
|
NaturalDropdownContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: NaturalDropdownContainerComponent, deps: [{ token: i0.ElementRef }, { token: i1$6.ConfigurableFocusTrapFactory }, { token: NATURAL_DROPDOWN_CONTAINER_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
5214
|
-
NaturalDropdownContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.0", type: NaturalDropdownContainerComponent, selector: "ng-component", viewQueries: [{ propertyName: "portalOutlet", first: true, predicate: CdkPortalOutlet, descendants: true, static: true }, { propertyName: "templateRef", first: true, predicate: TemplateRef, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<div\n (@transformMenu.done)=\"onAnimationDone($event)\"\n [@transformMenu]=\"panelAnimationState\"\n class=\"natural-dropdown-container mat-elevation-z2\"\n role=\"menu\"\n tabindex=\"-1\"\n>\n <div class=\"natural-dropdown-container-content\">\n <ng-template cdkPortalOutlet></ng-template>\n </div>\n\n <div *ngIf=\"data.showValidateButton\" class=\"natural-dropdown-validate-button\">\n <button (click)=\"close()\" color=\"primary\" mat-raised-button>Valider</button>\n </div>\n</div>\n", styles: [".natural-dropdown-container{display:flex;flex-direction:column;border-radius:2px;height:100%}.natural-dropdown-container-content{flex:1;padding:5px;overflow:auto}.natural-dropdown-container .natural-dropdown-validate-button{flex:none;display:flex;flex-direction:row;justify-content:flex-end;margin:5px}\n"], components: [{ type: i1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i3.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], animations: [naturalDropdownAnimations.transformMenu, naturalDropdownAnimations.fadeInItems], encapsulation: i0.ViewEncapsulation.None });
|
|
5215
|
+
NaturalDropdownContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.0", type: NaturalDropdownContainerComponent, selector: "ng-component", viewQueries: [{ propertyName: "portalOutlet", first: true, predicate: CdkPortalOutlet, descendants: true, static: true }, { propertyName: "templateRef", first: true, predicate: TemplateRef, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<div\n (@transformMenu.done)=\"onAnimationDone($event)\"\n [@transformMenu]=\"panelAnimationState\"\n class=\"natural-dropdown-container mat-elevation-z2\"\n role=\"menu\"\n tabindex=\"-1\"\n>\n <div class=\"natural-dropdown-container-content\">\n <ng-template cdkPortalOutlet></ng-template>\n </div>\n\n <div *ngIf=\"data.showValidateButton\" class=\"natural-dropdown-validate-button\">\n <button (click)=\"close()\" color=\"primary\" mat-raised-button i18n>Valider</button>\n </div>\n</div>\n", styles: [".natural-dropdown-container{display:flex;flex-direction:column;border-radius:2px;height:100%}.natural-dropdown-container-content{flex:1;padding:5px;overflow:auto}.natural-dropdown-container .natural-dropdown-validate-button{flex:none;display:flex;flex-direction:row;justify-content:flex-end;margin:5px}\n"], components: [{ type: i1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i3.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], animations: [naturalDropdownAnimations.transformMenu, naturalDropdownAnimations.fadeInItems], encapsulation: i0.ViewEncapsulation.None });
|
|
5215
5216
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: NaturalDropdownContainerComponent, decorators: [{
|
|
5216
5217
|
type: Component,
|
|
5217
|
-
args: [{ encapsulation: ViewEncapsulation.None, preserveWhitespaces: false, animations: [naturalDropdownAnimations.transformMenu, naturalDropdownAnimations.fadeInItems], template: "<div\n (@transformMenu.done)=\"onAnimationDone($event)\"\n [@transformMenu]=\"panelAnimationState\"\n class=\"natural-dropdown-container mat-elevation-z2\"\n role=\"menu\"\n tabindex=\"-1\"\n>\n <div class=\"natural-dropdown-container-content\">\n <ng-template cdkPortalOutlet></ng-template>\n </div>\n\n <div *ngIf=\"data.showValidateButton\" class=\"natural-dropdown-validate-button\">\n <button (click)=\"close()\" color=\"primary\" mat-raised-button>Valider</button>\n </div>\n</div>\n", styles: [".natural-dropdown-container{display:flex;flex-direction:column;border-radius:2px;height:100%}.natural-dropdown-container-content{flex:1;padding:5px;overflow:auto}.natural-dropdown-container .natural-dropdown-validate-button{flex:none;display:flex;flex-direction:row;justify-content:flex-end;margin:5px}\n"] }]
|
|
5218
|
+
args: [{ encapsulation: ViewEncapsulation.None, preserveWhitespaces: false, animations: [naturalDropdownAnimations.transformMenu, naturalDropdownAnimations.fadeInItems], template: "<div\n (@transformMenu.done)=\"onAnimationDone($event)\"\n [@transformMenu]=\"panelAnimationState\"\n class=\"natural-dropdown-container mat-elevation-z2\"\n role=\"menu\"\n tabindex=\"-1\"\n>\n <div class=\"natural-dropdown-container-content\">\n <ng-template cdkPortalOutlet></ng-template>\n </div>\n\n <div *ngIf=\"data.showValidateButton\" class=\"natural-dropdown-validate-button\">\n <button (click)=\"close()\" color=\"primary\" mat-raised-button i18n>Valider</button>\n </div>\n</div>\n", styles: [".natural-dropdown-container{display:flex;flex-direction:column;border-radius:2px;height:100%}.natural-dropdown-container-content{flex:1;padding:5px;overflow:auto}.natural-dropdown-container .natural-dropdown-validate-button{flex:none;display:flex;flex-direction:row;justify-content:flex-end;margin:5px}\n"] }]
|
|
5218
5219
|
}], ctorParameters: function () {
|
|
5219
5220
|
return [{ type: i0.ElementRef }, { type: i1$6.ConfigurableFocusTrapFactory }, { type: undefined, decorators: [{
|
|
5220
5221
|
type: Inject,
|
|
@@ -9954,6 +9955,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
|
|
|
9954
9955
|
* Button that fits well in a `<mat-table>` and support either
|
|
9955
9956
|
* route navigation via `navigate` or external URL via `href`.
|
|
9956
9957
|
*
|
|
9958
|
+
* If neither `navigate` nor `href` has a meaningful value, then
|
|
9959
|
+
* it will show the icon and/or label in `<span>` instead of a button
|
|
9960
|
+
*
|
|
9957
9961
|
* External URL will always be opened in new tab.
|
|
9958
9962
|
*/
|
|
9959
9963
|
class NaturalTableButtonComponent {
|
|
@@ -9963,14 +9967,27 @@ class NaturalTableButtonComponent {
|
|
|
9963
9967
|
this.navigate = [];
|
|
9964
9968
|
this.preserveFragment = false;
|
|
9965
9969
|
this.raised = false;
|
|
9970
|
+
this.type = 'none';
|
|
9971
|
+
}
|
|
9972
|
+
ngOnChanges(changes) {
|
|
9973
|
+
var _a;
|
|
9974
|
+
if (((_a = this.navigate) === null || _a === void 0 ? void 0 : _a.length) || Object.keys(this.queryParams).length) {
|
|
9975
|
+
this.type = 'routerLink';
|
|
9976
|
+
}
|
|
9977
|
+
else if (this.href) {
|
|
9978
|
+
this.type = 'href';
|
|
9979
|
+
}
|
|
9980
|
+
else {
|
|
9981
|
+
this.type = 'none';
|
|
9982
|
+
}
|
|
9966
9983
|
}
|
|
9967
9984
|
}
|
|
9968
9985
|
NaturalTableButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: NaturalTableButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9969
|
-
NaturalTableButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.0", type: NaturalTableButtonComponent, selector: "natural-table-button", inputs: { queryParams: "queryParams", queryParamsHandling: "queryParamsHandling", label: "label", icon: "icon", href: "href", navigate: "navigate", fragment: "fragment", preserveFragment: "preserveFragment", raised: "raised", color: "color" }, ngImport: i0, template: "<!-- Because directives can't be applied conditionally (routerLink, mat-button and mat-icon-button), we have to use different elements -->\n\n<ng-container *ngIf=\"!raised\">\n <!-- App routed link with label... -->\n <a\n *ngIf=\"
|
|
9986
|
+
NaturalTableButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.0", type: NaturalTableButtonComponent, selector: "natural-table-button", inputs: { queryParams: "queryParams", queryParamsHandling: "queryParamsHandling", label: "label", icon: "icon", href: "href", navigate: "navigate", fragment: "fragment", preserveFragment: "preserveFragment", raised: "raised", color: "color" }, usesOnChanges: true, ngImport: i0, template: "<!-- Because directives can't be applied conditionally (routerLink, mat-button and mat-icon-button), we have to use different elements -->\n\n<!-- Edge case of a button without any kind of link at all -->\n<span *ngIf=\"type === 'none'\">\n <natural-icon *ngIf=\"icon\" [name]=\"icon\"></natural-icon>\n <span *ngIf=\"label\">{{ label }}</span>\n</span>\n\n<ng-container *ngIf=\"!raised\">\n <!-- App routed link with label... -->\n <a\n *ngIf=\"type === 'routerLink' && label\"\n [color]=\"color\"\n [queryParams]=\"queryParams\"\n [queryParamsHandling]=\"queryParamsHandling\"\n [routerLink]=\"navigate\"\n [fragment]=\"fragment\"\n [preserveFragment]=\"preserveFragment\"\n mat-button\n >\n <natural-icon *ngIf=\"icon\" [name]=\"icon\"></natural-icon>\n <span>{{ label }}</span>\n </a>\n\n <!-- ... and without label -->\n <a\n *ngIf=\"type === 'routerLink' && !label\"\n [color]=\"color\"\n [queryParams]=\"queryParams\"\n [queryParamsHandling]=\"queryParamsHandling\"\n [routerLink]=\"navigate\"\n [fragment]=\"fragment\"\n [preserveFragment]=\"preserveFragment\"\n mat-icon-button\n >\n <natural-icon *ngIf=\"icon\" [name]=\"icon\"></natural-icon>\n </a>\n\n <!-- External link with label... -->\n <a *ngIf=\"type === 'href' && label\" [attr.href]=\"href\" [color]=\"color\" mat-button target=\"_blank\">\n <natural-icon *ngIf=\"icon\" [name]=\"icon\"></natural-icon>\n <span>{{ label }}</span>\n </a>\n\n <!-- ... and without label -->\n <a *ngIf=\"type === 'href' && !label\" [attr.href]=\"href\" [color]=\"color\" mat-icon-button target=\"_blank\">\n <natural-icon *ngIf=\"icon\" [name]=\"icon\"></natural-icon>\n </a>\n</ng-container>\n\n<ng-container *ngIf=\"raised\">\n <!-- App routed link with label... -->\n <a\n *ngIf=\"type === 'routerLink' && label\"\n [color]=\"color\"\n [queryParams]=\"queryParams\"\n [queryParamsHandling]=\"queryParamsHandling\"\n [routerLink]=\"navigate\"\n [fragment]=\"fragment\"\n [preserveFragment]=\"preserveFragment\"\n mat-raised-button\n >\n <natural-icon *ngIf=\"icon\" [name]=\"icon\"></natural-icon>\n <span>{{ label }}</span>\n </a>\n\n <!-- ... and without label -->\n <a\n *ngIf=\"type === 'routerLink' && !label\"\n [color]=\"color\"\n [queryParams]=\"queryParams\"\n [queryParamsHandling]=\"queryParamsHandling\"\n [routerLink]=\"navigate\"\n [fragment]=\"fragment\"\n [preserveFragment]=\"preserveFragment\"\n mat-icon-button\n mat-raised-button\n >\n <natural-icon *ngIf=\"icon\" [name]=\"icon\"></natural-icon>\n </a>\n\n <!-- External link with label... -->\n <a *ngIf=\"type === 'href' && label\" [attr.href]=\"href\" [color]=\"color\" mat-raised-button target=\"_blank\">\n <natural-icon *ngIf=\"icon\" [name]=\"icon\"></natural-icon>\n <span>{{ label }}</span>\n </a>\n\n <!-- ... and without label -->\n <a\n *ngIf=\"type === 'href' && !label\"\n [attr.href]=\"href\"\n [color]=\"color\"\n mat-icon-button\n mat-raised-button\n target=\"_blank\"\n >\n <natural-icon *ngIf=\"icon\" [name]=\"icon\"></natural-icon>\n </a>\n</ng-container>\n", styles: ["natural-table-button{flex:1;display:flex;flex-direction:row;justify-content:flex-start;align-items:center}natural-table-button a.mat-button{flex:1;display:flex;flex-direction:row;align-items:center;justify-content:flex-start}natural-table-button a.mat-button .mat-button-wrapper{display:flex;flex-direction:row;align-items:center}natural-table-button a.mat-button .mat-button-wrapper>*{display:flex;flex-direction:row;align-items:center}natural-table-button a.mat-button .mat-button-wrapper>:not(:last-child){margin-right:5px}natural-table-button>span{padding:0 16px}\n"], components: [{ type: NaturalIconComponent, selector: "natural-icon", inputs: ["label", "labelColor", "labelPosition", "name", "size"] }, { type: i1.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab], a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
9970
9987
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: NaturalTableButtonComponent, decorators: [{
|
|
9971
9988
|
type: Component,
|
|
9972
|
-
args: [{ selector: 'natural-table-button', encapsulation: ViewEncapsulation.None, template: "<!-- Because directives can't be applied conditionally (routerLink, mat-button and mat-icon-button), we have to use different elements -->\n\n<ng-container *ngIf=\"!raised\">\n <!-- App routed link with label... -->\n <a\n *ngIf=\"
|
|
9973
|
-
}],
|
|
9989
|
+
args: [{ selector: 'natural-table-button', encapsulation: ViewEncapsulation.None, template: "<!-- Because directives can't be applied conditionally (routerLink, mat-button and mat-icon-button), we have to use different elements -->\n\n<!-- Edge case of a button without any kind of link at all -->\n<span *ngIf=\"type === 'none'\">\n <natural-icon *ngIf=\"icon\" [name]=\"icon\"></natural-icon>\n <span *ngIf=\"label\">{{ label }}</span>\n</span>\n\n<ng-container *ngIf=\"!raised\">\n <!-- App routed link with label... -->\n <a\n *ngIf=\"type === 'routerLink' && label\"\n [color]=\"color\"\n [queryParams]=\"queryParams\"\n [queryParamsHandling]=\"queryParamsHandling\"\n [routerLink]=\"navigate\"\n [fragment]=\"fragment\"\n [preserveFragment]=\"preserveFragment\"\n mat-button\n >\n <natural-icon *ngIf=\"icon\" [name]=\"icon\"></natural-icon>\n <span>{{ label }}</span>\n </a>\n\n <!-- ... and without label -->\n <a\n *ngIf=\"type === 'routerLink' && !label\"\n [color]=\"color\"\n [queryParams]=\"queryParams\"\n [queryParamsHandling]=\"queryParamsHandling\"\n [routerLink]=\"navigate\"\n [fragment]=\"fragment\"\n [preserveFragment]=\"preserveFragment\"\n mat-icon-button\n >\n <natural-icon *ngIf=\"icon\" [name]=\"icon\"></natural-icon>\n </a>\n\n <!-- External link with label... -->\n <a *ngIf=\"type === 'href' && label\" [attr.href]=\"href\" [color]=\"color\" mat-button target=\"_blank\">\n <natural-icon *ngIf=\"icon\" [name]=\"icon\"></natural-icon>\n <span>{{ label }}</span>\n </a>\n\n <!-- ... and without label -->\n <a *ngIf=\"type === 'href' && !label\" [attr.href]=\"href\" [color]=\"color\" mat-icon-button target=\"_blank\">\n <natural-icon *ngIf=\"icon\" [name]=\"icon\"></natural-icon>\n </a>\n</ng-container>\n\n<ng-container *ngIf=\"raised\">\n <!-- App routed link with label... -->\n <a\n *ngIf=\"type === 'routerLink' && label\"\n [color]=\"color\"\n [queryParams]=\"queryParams\"\n [queryParamsHandling]=\"queryParamsHandling\"\n [routerLink]=\"navigate\"\n [fragment]=\"fragment\"\n [preserveFragment]=\"preserveFragment\"\n mat-raised-button\n >\n <natural-icon *ngIf=\"icon\" [name]=\"icon\"></natural-icon>\n <span>{{ label }}</span>\n </a>\n\n <!-- ... and without label -->\n <a\n *ngIf=\"type === 'routerLink' && !label\"\n [color]=\"color\"\n [queryParams]=\"queryParams\"\n [queryParamsHandling]=\"queryParamsHandling\"\n [routerLink]=\"navigate\"\n [fragment]=\"fragment\"\n [preserveFragment]=\"preserveFragment\"\n mat-icon-button\n mat-raised-button\n >\n <natural-icon *ngIf=\"icon\" [name]=\"icon\"></natural-icon>\n </a>\n\n <!-- External link with label... -->\n <a *ngIf=\"type === 'href' && label\" [attr.href]=\"href\" [color]=\"color\" mat-raised-button target=\"_blank\">\n <natural-icon *ngIf=\"icon\" [name]=\"icon\"></natural-icon>\n <span>{{ label }}</span>\n </a>\n\n <!-- ... and without label -->\n <a\n *ngIf=\"type === 'href' && !label\"\n [attr.href]=\"href\"\n [color]=\"color\"\n mat-icon-button\n mat-raised-button\n target=\"_blank\"\n >\n <natural-icon *ngIf=\"icon\" [name]=\"icon\"></natural-icon>\n </a>\n</ng-container>\n", styles: ["natural-table-button{flex:1;display:flex;flex-direction:row;justify-content:flex-start;align-items:center}natural-table-button a.mat-button{flex:1;display:flex;flex-direction:row;align-items:center;justify-content:flex-start}natural-table-button a.mat-button .mat-button-wrapper{display:flex;flex-direction:row;align-items:center}natural-table-button a.mat-button .mat-button-wrapper>*{display:flex;flex-direction:row;align-items:center}natural-table-button a.mat-button .mat-button-wrapper>:not(:last-child){margin-right:5px}natural-table-button>span{padding:0 16px}\n"] }]
|
|
9990
|
+
}], propDecorators: { queryParams: [{
|
|
9974
9991
|
type: Input
|
|
9975
9992
|
}], queryParamsHandling: [{
|
|
9976
9993
|
type: Input
|
|
@@ -10556,8 +10573,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
|
|
|
10556
10573
|
* Public API Surface of natural
|
|
10557
10574
|
*/
|
|
10558
10575
|
|
|
10559
|
-
const NaturalLoggerConfigUrl = new InjectionToken('
|
|
10560
|
-
const NaturalLoggerConfigExtra = new InjectionToken('
|
|
10576
|
+
const NaturalLoggerConfigUrl = new InjectionToken('Absolute URL of the log server');
|
|
10577
|
+
const NaturalLoggerConfigExtra = new InjectionToken('Class that may provide extra data to log');
|
|
10578
|
+
/**
|
|
10579
|
+
* Replace Angular's error handler to also send the log to a remote server via HTTP POST.
|
|
10580
|
+
*
|
|
10581
|
+
* Usage is automatic as soon we import the module via:
|
|
10582
|
+
*
|
|
10583
|
+
* ```ts
|
|
10584
|
+
* NaturalErrorModule.forRoot('http://example.com', ExtraService),
|
|
10585
|
+
* ```
|
|
10586
|
+
*/
|
|
10561
10587
|
class NaturalErrorHandler extends ErrorHandler {
|
|
10562
10588
|
constructor(http, document, url, loggerExtra) {
|
|
10563
10589
|
super();
|
|
@@ -10567,21 +10593,16 @@ class NaturalErrorHandler extends ErrorHandler {
|
|
|
10567
10593
|
this.loggerExtra = loggerExtra;
|
|
10568
10594
|
}
|
|
10569
10595
|
handleError(error) {
|
|
10570
|
-
var _a, _b, _c, _d
|
|
10596
|
+
var _a, _b, _c, _d;
|
|
10571
10597
|
console.error(error);
|
|
10572
10598
|
const params = {
|
|
10599
|
+
message: this.toMessage(error),
|
|
10573
10600
|
href: (_a = this.document.defaultView) === null || _a === void 0 ? void 0 : _a.window.location.href,
|
|
10574
10601
|
host: (_b = this.document.defaultView) === null || _b === void 0 ? void 0 : _b.window.location.hostname,
|
|
10575
10602
|
path: (_c = this.document.defaultView) === null || _c === void 0 ? void 0 : _c.window.location.pathname,
|
|
10576
10603
|
agent: (_d = this.document.defaultView) === null || _d === void 0 ? void 0 : _d.window.navigator.userAgent,
|
|
10577
10604
|
level: 'error',
|
|
10578
10605
|
};
|
|
10579
|
-
if (error === null || error === void 0 ? void 0 : error.message) {
|
|
10580
|
-
params.message = error.message;
|
|
10581
|
-
}
|
|
10582
|
-
else {
|
|
10583
|
-
params.message = error;
|
|
10584
|
-
}
|
|
10585
10606
|
if (error === null || error === void 0 ? void 0 : error.stack) {
|
|
10586
10607
|
params.stacktrace = error.stack;
|
|
10587
10608
|
}
|
|
@@ -10595,7 +10616,10 @@ class NaturalErrorHandler extends ErrorHandler {
|
|
|
10595
10616
|
params.url = error.url;
|
|
10596
10617
|
}
|
|
10597
10618
|
if (this.loggerExtra) {
|
|
10598
|
-
|
|
10619
|
+
this.loggerExtra
|
|
10620
|
+
.getExtras(error)
|
|
10621
|
+
.pipe(catchError(e => of({ getExtrasErrorMessage: this.toMessage(e) })), first$1())
|
|
10622
|
+
.subscribe(result => {
|
|
10599
10623
|
this.postLog(Object.assign(params, result));
|
|
10600
10624
|
});
|
|
10601
10625
|
}
|
|
@@ -10603,6 +10627,14 @@ class NaturalErrorHandler extends ErrorHandler {
|
|
|
10603
10627
|
this.postLog(params);
|
|
10604
10628
|
}
|
|
10605
10629
|
}
|
|
10630
|
+
toMessage(error) {
|
|
10631
|
+
if (error && typeof error === 'object' && 'message' in error) {
|
|
10632
|
+
return '' + error.message;
|
|
10633
|
+
}
|
|
10634
|
+
else {
|
|
10635
|
+
return '' + error;
|
|
10636
|
+
}
|
|
10637
|
+
}
|
|
10606
10638
|
/**
|
|
10607
10639
|
* Send parameters to remote log
|
|
10608
10640
|
*/
|