@ecodev/natural 45.1.0 → 45.2.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.
- package/esm2020/lib/classes/utility.mjs +1 -6
- package/esm2020/lib/modules/common/common-module.mjs +11 -7
- package/esm2020/lib/modules/common/pipes/time-ago.pipe.mjs +138 -0
- package/esm2020/lib/modules/common/public-api.mjs +2 -1
- package/esm2020/lib/modules/dropdown-components/type-select/type-select.component.mjs +2 -2
- package/esm2020/lib/modules/fixed-button-detail/fixed-button-detail.component.mjs +8 -4
- package/esm2020/lib/modules/hierarchic-selector/classes/model-node.mjs +1 -1
- package/esm2020/lib/modules/logger/error-handler.mjs +2 -4
- package/esm2020/lib/modules/stamp/stamp-module.module.mjs +9 -7
- package/esm2020/lib/modules/stamp/stamp.component.mjs +11 -3
- package/esm2020/lib/types/types.mjs +1 -1
- package/fesm2015/ecodev-natural.mjs +176 -31
- package/fesm2015/ecodev-natural.mjs.map +1 -1
- package/fesm2020/ecodev-natural.mjs +172 -31
- package/fesm2020/ecodev-natural.mjs.map +1 -1
- package/lib/classes/utility.d.ts +2 -0
- package/lib/modules/common/common-module.d.ts +9 -8
- package/lib/modules/common/pipes/time-ago.pipe.d.ts +19 -0
- package/lib/modules/common/public-api.d.ts +1 -0
- package/lib/modules/fixed-button-detail/fixed-button-detail.component.d.ts +2 -1
- package/lib/modules/hierarchic-selector/classes/model-node.d.ts +0 -1
- package/lib/modules/stamp/stamp-module.module.d.ts +2 -1
- package/lib/modules/stamp/stamp.component.d.ts +1 -0
- package/lib/types/types.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
import { Component, Input } from '@angular/core';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
import * as i1 from "@angular/common";
|
|
4
|
+
import * as i2 from "../common/pipes/swiss-date.pipe";
|
|
5
|
+
import * as i3 from "../common/pipes/time-ago.pipe";
|
|
4
6
|
export class NaturalStampComponent {
|
|
7
|
+
showUpdate() {
|
|
8
|
+
const same = this.item.updater?.id === this.item.creator?.id &&
|
|
9
|
+
this.item.updateDate &&
|
|
10
|
+
this.item.updateDate === this.item.creationDate;
|
|
11
|
+
return !same && (!!this.item.updateDate || !!this.item.updater);
|
|
12
|
+
}
|
|
5
13
|
}
|
|
6
14
|
NaturalStampComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: NaturalStampComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7
|
-
NaturalStampComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.1", type: NaturalStampComponent, selector: "natural-stamp", inputs: { item: "item" }, ngImport: i0, template: "<ng-container *ngIf=\"item\">\n <div *ngIf=\"item.creationDate || item.creator\">\n <span class=\"mat-body-2\" i18n>Cr\u00E9ation</span>\n :\n <span *ngIf=\"item.creator\">{{ item.creator.fullName || item.creator.name }}</span>\n <span *ngIf=\"item.creator && item.creationDate\">, </span>\n <span *ngIf=\"item.creationDate\"
|
|
15
|
+
NaturalStampComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.1", type: NaturalStampComponent, selector: "natural-stamp", inputs: { item: "item" }, ngImport: i0, template: "<ng-container *ngIf=\"item\">\n <div *ngIf=\"item.creationDate || item.creator\">\n <span class=\"mat-body-2\" i18n>Cr\u00E9ation</span>\n :\n <span *ngIf=\"item.creator\">{{ item.creator.fullName || item.creator.name }}</span>\n <span *ngIf=\"item.creator && item.creationDate\">, </span>\n <span *ngIf=\"item.creationDate\">{{ item.creationDate | swissDate }} ({{ item.creationDate | timeAgo }})</span>\n </div>\n\n <div *ngIf=\"showUpdate()\">\n <span class=\"mat-body-2\" i18n>Modification</span>\n :\n <span *ngIf=\"item.updater\">{{ item.updater.fullName || item.updater.name }}</span>\n <span *ngIf=\"item.updater && item.updateDate\">, </span>\n <span *ngIf=\"item.updateDate\">{{ item.updateDate | swissDate }} ({{ item.updateDate | timeAgo }})</span>\n </div>\n</ng-container>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.NaturalSwissDatePipe, name: "swissDate" }, { kind: "pipe", type: i3.NaturalTimeAgoPipe, name: "timeAgo" }] });
|
|
8
16
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: NaturalStampComponent, decorators: [{
|
|
9
17
|
type: Component,
|
|
10
|
-
args: [{ selector: 'natural-stamp', template: "<ng-container *ngIf=\"item\">\n <div *ngIf=\"item.creationDate || item.creator\">\n <span class=\"mat-body-2\" i18n>Cr\u00E9ation</span>\n :\n <span *ngIf=\"item.creator\">{{ item.creator.fullName || item.creator.name }}</span>\n <span *ngIf=\"item.creator && item.creationDate\">, </span>\n <span *ngIf=\"item.creationDate\"
|
|
18
|
+
args: [{ selector: 'natural-stamp', template: "<ng-container *ngIf=\"item\">\n <div *ngIf=\"item.creationDate || item.creator\">\n <span class=\"mat-body-2\" i18n>Cr\u00E9ation</span>\n :\n <span *ngIf=\"item.creator\">{{ item.creator.fullName || item.creator.name }}</span>\n <span *ngIf=\"item.creator && item.creationDate\">, </span>\n <span *ngIf=\"item.creationDate\">{{ item.creationDate | swissDate }} ({{ item.creationDate | timeAgo }})</span>\n </div>\n\n <div *ngIf=\"showUpdate()\">\n <span class=\"mat-body-2\" i18n>Modification</span>\n :\n <span *ngIf=\"item.updater\">{{ item.updater.fullName || item.updater.name }}</span>\n <span *ngIf=\"item.updater && item.updateDate\">, </span>\n <span *ngIf=\"item.updateDate\">{{ item.updateDate | swissDate }} ({{ item.updateDate | timeAgo }})</span>\n </div>\n</ng-container>\n" }]
|
|
11
19
|
}], propDecorators: { item: [{
|
|
12
20
|
type: Input
|
|
13
21
|
}] } });
|
|
14
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
22
|
+
//# sour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2PlxuPC9uZy1jb250YWluZXI+XG4iXX0=
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9uYXR1cmFsL3NyYy9saWIvdHlwZXMvdHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7UGFnaW5hdGVkRGF0YX0gZnJvbSAnLi4vY2xhc3Nlcy9kYXRhLXNvdXJjZSc7XG5pbXBvcnQge05hdHVyYWxBYnN0cmFjdE1vZGVsU2VydmljZSwgVmFyaWFibGVzV2l0aElucHV0fSBmcm9tICcuLi9zZXJ2aWNlcy9hYnN0cmFjdC1tb2RlbC5zZXJ2aWNlJztcbmltcG9ydCB7UXVlcnlWYXJpYWJsZXN9IGZyb20gJy4uL2NsYXNzZXMvcXVlcnktdmFyaWFibGUtbWFuYWdlcic7XG5cbi8qKlxuICogQW4gb2JqZWN0IGxpdGVyYWwgd2l0aCBhbnkga2V5cyBhbmQgdmFsdWVzXG4gKi9cbmV4cG9ydCBpbnRlcmZhY2UgTGl0ZXJhbCB7XG4gICAgW2tleTogc3RyaW5nXTogYW55O1xufVxuXG4vKipcbiAqIEFuIG9iamVjdCB3aXRoIGVpdGhlciBhIG5hbWUgb3IgYSBmdWxsTmFtZSAob3IgbWF5YmUgYm90aClcbiAqL1xuZXhwb3J0IHR5cGUgTmFtZU9yRnVsbE5hbWUgPVxuICAgIHwge1xuICAgICAgICAgIGlkOiBzdHJpbmc7XG4gICAgICAgICAgbmFtZTogc3RyaW5nO1xuICAgICAgICAgIGZ1bGxOYW1lPzogc3RyaW5nO1xuICAgICAgfVxuICAgIHwge1xuICAgICAgICA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ciBUZGVsZXRlLFxuICAgIGFueVxuPlxuICAgID8gVGRlbGV0ZVxuICAgIDogbmV2ZXI7XG5cbi8qKlxuICogRXh0cmFjdCB0aGUgVmRlbGV0ZSB0eXBlIGZyb20gYSBOYXR1cmFsQWJzdHJhY3RNb2RlbFNlcnZpY2VcbiAqL1xuZXhwb3J0IHR5cGUgRXh0cmFjdFZkZWxldGU8UD4gPSBQIGV4dGVuZHMgTmF0dXJhbEFic3RyYWN0TW9kZWxTZXJ2aWNlPFxuICAgIGFueSxcbiAgICBhbnksXG4gICAgYW55LFxuICAgIGFueSxcbiAgICBhbnksXG4gICAgYW55LFxuICAgIGFueSxcbiAgICBhbnksXG4gICAgYW55LFxuICAgIGluZmVyIFZkZWxldGVcbj5cbiAgICA/IFZkZWxldGUgZXh0ZW5kcyB7aWRzOiBzdHJpbmdbXX1cbiAgICAgICAgPyBWZGVsZXRlXG4gICAgICAgIDogbmV2ZXJcbiAgICA6IG5ldmVyO1xuIl19
|
|
@@ -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,
|
|
4
|
-
import { Subject, BehaviorSubject, of, timer, switchMap as switchMap$1, endWith, last, EMPTY, Observable, first as first$1, combineLatest, ReplaySubject, debounceTime as debounceTime$1, raceWith, take as take$1, mergeMap, shareReplay as shareReplay$1, catchError, forkJoin, map as map$1, merge as merge$1, tap as tap$1, asyncScheduler } from 'rxjs';
|
|
3
|
+
import { Directive, Component, Inject, Injectable, HostBinding, HostListener, InjectionToken, Input, NgModule, EventEmitter, ChangeDetectionStrategy, Output, ContentChildren, Pipe, Optional, TemplateRef, ViewEncapsulation, ViewChild, Injector, Self, ContentChild, createEnvironmentInjector, createComponent, PLATFORM_ID, ErrorHandler } from '@angular/core';
|
|
4
|
+
import { Subject, BehaviorSubject, of, timer, switchMap as switchMap$1, endWith, last, EMPTY, Observable, first as first$1, combineLatest, ReplaySubject, debounceTime as debounceTime$1, raceWith, take as take$1, mergeMap, shareReplay as shareReplay$1, catchError, forkJoin, map as map$1, merge as merge$1, tap as tap$1, asyncScheduler, takeUntil as takeUntil$1 } from 'rxjs';
|
|
5
5
|
import * as i3 from '@angular/forms';
|
|
6
6
|
import { FormGroup, FormArray, Validators, UntypedFormGroup, UntypedFormArray, UntypedFormControl, FormsModule, FormControl, FormControlDirective, FormControlName, ReactiveFormsModule } from '@angular/forms';
|
|
7
7
|
import * as i2$1 from '@angular/router';
|
|
@@ -216,11 +216,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", ngImpor
|
|
|
216
216
|
args: ['click']
|
|
217
217
|
}] } });
|
|
218
218
|
|
|
219
|
-
/**
|
|
220
|
-
* Very basic formatting to get only date, without time and ignoring entirely the timezone
|
|
221
|
-
*
|
|
222
|
-
* So something like: "2021-09-23"
|
|
223
|
-
*/
|
|
224
219
|
function formatIsoDate(date) {
|
|
225
220
|
if (!date) {
|
|
226
221
|
return null;
|
|
@@ -4974,14 +4969,154 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", ngImpor
|
|
|
4974
4969
|
type: Input
|
|
4975
4970
|
}] } });
|
|
4976
4971
|
|
|
4977
|
-
|
|
4972
|
+
function isDate(value) {
|
|
4973
|
+
return value instanceof Date && !isNaN(value.valueOf());
|
|
4974
|
+
}
|
|
4975
|
+
/**
|
|
4976
|
+
* Returns a string to approximately describe the date.
|
|
4977
|
+
*
|
|
4978
|
+
* Eg:
|
|
4979
|
+
*
|
|
4980
|
+
* - "il y a quelques minutes"
|
|
4981
|
+
* - "dans 3 jours"
|
|
4982
|
+
* - "dans 3 ans"
|
|
4983
|
+
*/
|
|
4984
|
+
class NaturalTimeAgoPipe {
|
|
4985
|
+
constructor(fakedNow = null) {
|
|
4986
|
+
this.fakedNow = fakedNow;
|
|
4987
|
+
}
|
|
4988
|
+
getNow() {
|
|
4989
|
+
var _a;
|
|
4990
|
+
return (_a = this.fakedNow) !== null && _a !== void 0 ? _a : Date.now();
|
|
4991
|
+
}
|
|
4992
|
+
transform(date) {
|
|
4993
|
+
if (!date) {
|
|
4994
|
+
return '';
|
|
4995
|
+
}
|
|
4996
|
+
const stamp = isDate(date) ? date.getTime() : Date.parse(date);
|
|
4997
|
+
const now = this.getNow();
|
|
4998
|
+
const $seconds = (stamp - now) / 1000;
|
|
4999
|
+
const minutes = $seconds / 60;
|
|
5000
|
+
const hours = minutes / 60;
|
|
5001
|
+
const days = hours / 24;
|
|
5002
|
+
const weeks = days / 7;
|
|
5003
|
+
const months = days / 31;
|
|
5004
|
+
const years = days / 365;
|
|
5005
|
+
// Find out the best unit to use for display
|
|
5006
|
+
if (years <= -2) {
|
|
5007
|
+
const value = Math.round(Math.abs(years));
|
|
5008
|
+
return $localize `il y a ${value} ans`;
|
|
5009
|
+
}
|
|
5010
|
+
else if (years <= -1) {
|
|
5011
|
+
return $localize `il y a un an`;
|
|
5012
|
+
}
|
|
5013
|
+
else if (months <= -2) {
|
|
5014
|
+
const value = Math.round(Math.abs(months));
|
|
5015
|
+
return $localize `il y a ${value} mois`;
|
|
5016
|
+
}
|
|
5017
|
+
else if (months <= -1) {
|
|
5018
|
+
return $localize `il y a un mois`;
|
|
5019
|
+
}
|
|
5020
|
+
else if (weeks <= -2) {
|
|
5021
|
+
const value = Math.round(Math.abs(weeks));
|
|
5022
|
+
return $localize `il y a ${value} semaines`;
|
|
5023
|
+
}
|
|
5024
|
+
else if (weeks <= -1) {
|
|
5025
|
+
return $localize `il y a une semaine`;
|
|
5026
|
+
}
|
|
5027
|
+
else if (days <= -2) {
|
|
5028
|
+
const value = Math.round(Math.abs(days));
|
|
5029
|
+
return $localize `il y a ${value} jours`;
|
|
5030
|
+
}
|
|
5031
|
+
else if (days <= -1) {
|
|
5032
|
+
return $localize `il y a un jour`;
|
|
5033
|
+
}
|
|
5034
|
+
else if (hours <= -2) {
|
|
5035
|
+
const value = Math.round(Math.abs(hours));
|
|
5036
|
+
return $localize `il y a ${value} heures`;
|
|
5037
|
+
}
|
|
5038
|
+
else if (hours <= -1) {
|
|
5039
|
+
return $localize `il y a une heure`;
|
|
5040
|
+
}
|
|
5041
|
+
else if (minutes <= -5) {
|
|
5042
|
+
const value = Math.round(Math.abs(minutes));
|
|
5043
|
+
return $localize `il y a ${value} minutes`;
|
|
5044
|
+
}
|
|
5045
|
+
else if (minutes <= 0) {
|
|
5046
|
+
return $localize `il y a quelques minutes`;
|
|
5047
|
+
}
|
|
5048
|
+
else if (years > 2) {
|
|
5049
|
+
const value = Math.round(years);
|
|
5050
|
+
return $localize `dans ${value} ans`;
|
|
5051
|
+
}
|
|
5052
|
+
else if (years > 1) {
|
|
5053
|
+
return $localize `dans un an`;
|
|
5054
|
+
}
|
|
5055
|
+
else if (months > 2) {
|
|
5056
|
+
const value = Math.round(months);
|
|
5057
|
+
return $localize `dans ${value} mois`;
|
|
5058
|
+
}
|
|
5059
|
+
else if (months > 1) {
|
|
5060
|
+
return $localize `dans un mois`;
|
|
5061
|
+
}
|
|
5062
|
+
else if (weeks > 2) {
|
|
5063
|
+
const value = Math.round(weeks);
|
|
5064
|
+
return $localize `dans ${value} semaines`;
|
|
5065
|
+
}
|
|
5066
|
+
else if (weeks > 1) {
|
|
5067
|
+
return $localize `dans une semaine`;
|
|
5068
|
+
}
|
|
5069
|
+
else if (days > 2) {
|
|
5070
|
+
const value = Math.round(days);
|
|
5071
|
+
return $localize `dans ${value} jours`;
|
|
5072
|
+
}
|
|
5073
|
+
else if (days > 1) {
|
|
5074
|
+
return $localize `dans un jour`;
|
|
5075
|
+
}
|
|
5076
|
+
else if (hours > 2) {
|
|
5077
|
+
const value = Math.round(hours);
|
|
5078
|
+
return $localize `dans ${value} heures`;
|
|
5079
|
+
}
|
|
5080
|
+
else if (hours > 1) {
|
|
5081
|
+
return $localize `dans une heure`;
|
|
5082
|
+
}
|
|
5083
|
+
else if (minutes > 5) {
|
|
5084
|
+
const value = Math.round(minutes);
|
|
5085
|
+
return $localize `dans ${value} minutes`;
|
|
5086
|
+
}
|
|
5087
|
+
else if (minutes > 0) {
|
|
5088
|
+
return $localize `dans quelques minutes`;
|
|
5089
|
+
}
|
|
5090
|
+
else {
|
|
5091
|
+
throw new Error('Time travelling just happened');
|
|
5092
|
+
}
|
|
5093
|
+
}
|
|
5094
|
+
}
|
|
5095
|
+
NaturalTimeAgoPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: NaturalTimeAgoPipe, deps: [{ token: 'SHOULD_NEVER_BE_INJECTED', optional: true }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
5096
|
+
NaturalTimeAgoPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.1", ngImport: i0, type: NaturalTimeAgoPipe, name: "timeAgo" });
|
|
5097
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: NaturalTimeAgoPipe, decorators: [{
|
|
5098
|
+
type: Pipe,
|
|
5099
|
+
args: [{
|
|
5100
|
+
name: 'timeAgo',
|
|
5101
|
+
}]
|
|
5102
|
+
}], ctorParameters: function () {
|
|
5103
|
+
return [{ type: undefined, decorators: [{
|
|
5104
|
+
type: Optional
|
|
5105
|
+
}, {
|
|
5106
|
+
type: Inject,
|
|
5107
|
+
args: ['SHOULD_NEVER_BE_INJECTED']
|
|
5108
|
+
}] }];
|
|
5109
|
+
} });
|
|
5110
|
+
|
|
5111
|
+
const declarationsToExport$1 = [
|
|
4978
5112
|
NaturalCapitalizePipe,
|
|
4979
5113
|
NaturalEllipsisPipe,
|
|
4980
5114
|
NaturalEnumPipe,
|
|
4981
|
-
NaturalSwissDatePipe,
|
|
4982
5115
|
NaturalHttpPrefixDirective,
|
|
4983
|
-
NaturalSrcDensityDirective,
|
|
4984
5116
|
NaturalLinkableTabDirective,
|
|
5117
|
+
NaturalSrcDensityDirective,
|
|
5118
|
+
NaturalSwissDatePipe,
|
|
5119
|
+
NaturalTimeAgoPipe,
|
|
4985
5120
|
];
|
|
4986
5121
|
class NaturalCommonModule {
|
|
4987
5122
|
}
|
|
@@ -4989,23 +5124,25 @@ NaturalCommonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", vers
|
|
|
4989
5124
|
NaturalCommonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.1", ngImport: i0, type: NaturalCommonModule, declarations: [NaturalCapitalizePipe,
|
|
4990
5125
|
NaturalEllipsisPipe,
|
|
4991
5126
|
NaturalEnumPipe,
|
|
4992
|
-
NaturalSwissDatePipe,
|
|
4993
5127
|
NaturalHttpPrefixDirective,
|
|
5128
|
+
NaturalLinkableTabDirective,
|
|
4994
5129
|
NaturalSrcDensityDirective,
|
|
4995
|
-
|
|
5130
|
+
NaturalSwissDatePipe,
|
|
5131
|
+
NaturalTimeAgoPipe], imports: [CommonModule, MatFormFieldModule, MatInputModule, MatSelectModule], exports: [NaturalCapitalizePipe,
|
|
4996
5132
|
NaturalEllipsisPipe,
|
|
4997
5133
|
NaturalEnumPipe,
|
|
4998
|
-
NaturalSwissDatePipe,
|
|
4999
5134
|
NaturalHttpPrefixDirective,
|
|
5135
|
+
NaturalLinkableTabDirective,
|
|
5000
5136
|
NaturalSrcDensityDirective,
|
|
5001
|
-
|
|
5137
|
+
NaturalSwissDatePipe,
|
|
5138
|
+
NaturalTimeAgoPipe] });
|
|
5002
5139
|
NaturalCommonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: NaturalCommonModule, providers: [sessionStorageProvider, localStorageProvider], imports: [CommonModule, MatFormFieldModule, MatInputModule, MatSelectModule] });
|
|
5003
5140
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: NaturalCommonModule, decorators: [{
|
|
5004
5141
|
type: NgModule,
|
|
5005
5142
|
args: [{
|
|
5006
|
-
declarations: [...declarationsToExport],
|
|
5143
|
+
declarations: [...declarationsToExport$1],
|
|
5007
5144
|
imports: [CommonModule, MatFormFieldModule, MatInputModule, MatSelectModule],
|
|
5008
|
-
exports: [...declarationsToExport],
|
|
5145
|
+
exports: [...declarationsToExport$1],
|
|
5009
5146
|
providers: [sessionStorageProvider, localStorageProvider],
|
|
5010
5147
|
}]
|
|
5011
5148
|
}] });
|
|
@@ -5579,7 +5716,7 @@ class TypeSelectComponent extends NaturalAbstractController {
|
|
|
5579
5716
|
this.items = items;
|
|
5580
5717
|
// Reload selection, according to possible values from configuration
|
|
5581
5718
|
const possibleIds = this.items.map(item => this.getId(item));
|
|
5582
|
-
const wantedAndPossibleIds = wantedIds.filter(id =>
|
|
5719
|
+
const wantedAndPossibleIds = wantedIds.filter(id => possibleIds.some(i => i === id));
|
|
5583
5720
|
return wantedAndPossibleIds;
|
|
5584
5721
|
}));
|
|
5585
5722
|
}
|
|
@@ -8872,13 +9009,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", ngImpor
|
|
|
8872
9009
|
* Public API Surface of natural
|
|
8873
9010
|
*/
|
|
8874
9011
|
|
|
8875
|
-
class NaturalFixedButtonDetailComponent {
|
|
9012
|
+
class NaturalFixedButtonDetailComponent extends NaturalAbstractController {
|
|
8876
9013
|
constructor(route) {
|
|
9014
|
+
super();
|
|
8877
9015
|
this.canChange = true;
|
|
8878
9016
|
this.isCreation = false;
|
|
8879
9017
|
this.create = new EventEmitter();
|
|
8880
9018
|
this.delete = new EventEmitter();
|
|
8881
|
-
route.params.subscribe(() => (this.canChange = true));
|
|
9019
|
+
route.params.pipe(takeUntil$1(this.ngUnsubscribe)).subscribe(() => (this.canChange = true));
|
|
8882
9020
|
}
|
|
8883
9021
|
get model() {
|
|
8884
9022
|
return this._model;
|
|
@@ -8887,6 +9025,7 @@ class NaturalFixedButtonDetailComponent {
|
|
|
8887
9025
|
this._model = value;
|
|
8888
9026
|
if (this.canChange) {
|
|
8889
9027
|
this.isCreation = !this._model.id;
|
|
9028
|
+
this.canChange = false;
|
|
8890
9029
|
}
|
|
8891
9030
|
}
|
|
8892
9031
|
clickCreate() {
|
|
@@ -8901,7 +9040,7 @@ class NaturalFixedButtonDetailComponent {
|
|
|
8901
9040
|
}
|
|
8902
9041
|
}
|
|
8903
9042
|
NaturalFixedButtonDetailComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: NaturalFixedButtonDetailComponent, deps: [{ token: i2$1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
|
|
8904
|
-
NaturalFixedButtonDetailComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.1", type: NaturalFixedButtonDetailComponent, selector: "natural-fixed-button-detail", inputs: { model: "model", form: "form" }, outputs: { create: "create", delete: "delete" }, ngImport: i0, template: "<natural-fixed-button\n (click)=\"clickCreate()\"\n *ngIf=\"isCreation\"\n [disabled]=\"form.disabled\"\n [color]=\"form.valid ? 'accent' : 'warn'\"\n class=\"detail-speed-dial\"\n icon=\"save\"\n></natural-fixed-button>\n\n<natural-fixed-button\n (click)=\"clickDelete()\"\n *ngIf=\"!isCreation && (!model.permissions || model.permissions.delete)\"\n [disabled]=\"form.disabled\"\n class=\"detail-speed-dial\"\n color=\"warn\"\n icon=\"delete_forever\"\n i18n-matTooltip\n matTooltip=\"Supprimer d\u00E9finitivement\"\n matTooltipPosition=\"left\"\n></natural-fixed-button>\n", styles: [""], dependencies: [{ kind: "directive", type: i1$3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: NaturalFixedButtonComponent, selector: "natural-fixed-button", inputs: ["icon", "link", "color", "disabled"] }, { kind: "directive", type: i7.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }] });
|
|
9043
|
+
NaturalFixedButtonDetailComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.1", type: NaturalFixedButtonDetailComponent, selector: "natural-fixed-button-detail", inputs: { model: "model", form: "form" }, outputs: { create: "create", delete: "delete" }, usesInheritance: true, ngImport: i0, template: "<natural-fixed-button\n (click)=\"clickCreate()\"\n *ngIf=\"isCreation\"\n [disabled]=\"form.disabled\"\n [color]=\"form.valid ? 'accent' : 'warn'\"\n class=\"detail-speed-dial\"\n icon=\"save\"\n></natural-fixed-button>\n\n<natural-fixed-button\n (click)=\"clickDelete()\"\n *ngIf=\"!isCreation && (!model.permissions || model.permissions.delete)\"\n [disabled]=\"form.disabled\"\n class=\"detail-speed-dial\"\n color=\"warn\"\n icon=\"delete_forever\"\n i18n-matTooltip\n matTooltip=\"Supprimer d\u00E9finitivement\"\n matTooltipPosition=\"left\"\n></natural-fixed-button>\n", styles: [""], dependencies: [{ kind: "directive", type: i1$3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: NaturalFixedButtonComponent, selector: "natural-fixed-button", inputs: ["icon", "link", "color", "disabled"] }, { kind: "directive", type: i7.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }] });
|
|
8905
9044
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: NaturalFixedButtonDetailComponent, decorators: [{
|
|
8906
9045
|
type: Component,
|
|
8907
9046
|
args: [{ selector: 'natural-fixed-button-detail', template: "<natural-fixed-button\n (click)=\"clickCreate()\"\n *ngIf=\"isCreation\"\n [disabled]=\"form.disabled\"\n [color]=\"form.valid ? 'accent' : 'warn'\"\n class=\"detail-speed-dial\"\n icon=\"save\"\n></natural-fixed-button>\n\n<natural-fixed-button\n (click)=\"clickDelete()\"\n *ngIf=\"!isCreation && (!model.permissions || model.permissions.delete)\"\n [disabled]=\"form.disabled\"\n class=\"detail-speed-dial\"\n color=\"warn\"\n icon=\"delete_forever\"\n i18n-matTooltip\n matTooltip=\"Supprimer d\u00E9finitivement\"\n matTooltipPosition=\"left\"\n></natural-fixed-button>\n" }]
|
|
@@ -10052,27 +10191,35 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", ngImpor
|
|
|
10052
10191
|
*/
|
|
10053
10192
|
|
|
10054
10193
|
class NaturalStampComponent {
|
|
10194
|
+
showUpdate() {
|
|
10195
|
+
var _a, _b;
|
|
10196
|
+
const same = ((_a = this.item.updater) === null || _a === void 0 ? void 0 : _a.id) === ((_b = this.item.creator) === null || _b === void 0 ? void 0 : _b.id) &&
|
|
10197
|
+
this.item.updateDate &&
|
|
10198
|
+
this.item.updateDate === this.item.creationDate;
|
|
10199
|
+
return !same && (!!this.item.updateDate || !!this.item.updater);
|
|
10200
|
+
}
|
|
10055
10201
|
}
|
|
10056
10202
|
NaturalStampComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: NaturalStampComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
10057
|
-
NaturalStampComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.1", type: NaturalStampComponent, selector: "natural-stamp", inputs: { item: "item" }, ngImport: i0, template: "<ng-container *ngIf=\"item\">\n <div *ngIf=\"item.creationDate || item.creator\">\n <span class=\"mat-body-2\" i18n>Cr\u00E9ation</span>\n :\n <span *ngIf=\"item.creator\">{{ item.creator.fullName || item.creator.name }}</span>\n <span *ngIf=\"item.creator && item.creationDate\">, </span>\n <span *ngIf=\"item.creationDate\"
|
|
10203
|
+
NaturalStampComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.1", type: NaturalStampComponent, selector: "natural-stamp", inputs: { item: "item" }, ngImport: i0, template: "<ng-container *ngIf=\"item\">\n <div *ngIf=\"item.creationDate || item.creator\">\n <span class=\"mat-body-2\" i18n>Cr\u00E9ation</span>\n :\n <span *ngIf=\"item.creator\">{{ item.creator.fullName || item.creator.name }}</span>\n <span *ngIf=\"item.creator && item.creationDate\">, </span>\n <span *ngIf=\"item.creationDate\">{{ item.creationDate | swissDate }} ({{ item.creationDate | timeAgo }})</span>\n </div>\n\n <div *ngIf=\"showUpdate()\">\n <span class=\"mat-body-2\" i18n>Modification</span>\n :\n <span *ngIf=\"item.updater\">{{ item.updater.fullName || item.updater.name }}</span>\n <span *ngIf=\"item.updater && item.updateDate\">, </span>\n <span *ngIf=\"item.updateDate\">{{ item.updateDate | swissDate }} ({{ item.updateDate | timeAgo }})</span>\n </div>\n</ng-container>\n", dependencies: [{ kind: "directive", type: i1$3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: NaturalSwissDatePipe, name: "swissDate" }, { kind: "pipe", type: NaturalTimeAgoPipe, name: "timeAgo" }] });
|
|
10058
10204
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: NaturalStampComponent, decorators: [{
|
|
10059
10205
|
type: Component,
|
|
10060
|
-
args: [{ selector: 'natural-stamp', template: "<ng-container *ngIf=\"item\">\n <div *ngIf=\"item.creationDate || item.creator\">\n <span class=\"mat-body-2\" i18n>Cr\u00E9ation</span>\n :\n <span *ngIf=\"item.creator\">{{ item.creator.fullName || item.creator.name }}</span>\n <span *ngIf=\"item.creator && item.creationDate\">, </span>\n <span *ngIf=\"item.creationDate\"
|
|
10206
|
+
args: [{ selector: 'natural-stamp', template: "<ng-container *ngIf=\"item\">\n <div *ngIf=\"item.creationDate || item.creator\">\n <span class=\"mat-body-2\" i18n>Cr\u00E9ation</span>\n :\n <span *ngIf=\"item.creator\">{{ item.creator.fullName || item.creator.name }}</span>\n <span *ngIf=\"item.creator && item.creationDate\">, </span>\n <span *ngIf=\"item.creationDate\">{{ item.creationDate | swissDate }} ({{ item.creationDate | timeAgo }})</span>\n </div>\n\n <div *ngIf=\"showUpdate()\">\n <span class=\"mat-body-2\" i18n>Modification</span>\n :\n <span *ngIf=\"item.updater\">{{ item.updater.fullName || item.updater.name }}</span>\n <span *ngIf=\"item.updater && item.updateDate\">, </span>\n <span *ngIf=\"item.updateDate\">{{ item.updateDate | swissDate }} ({{ item.updateDate | timeAgo }})</span>\n </div>\n</ng-container>\n" }]
|
|
10061
10207
|
}], propDecorators: { item: [{
|
|
10062
10208
|
type: Input
|
|
10063
10209
|
}] } });
|
|
10064
10210
|
|
|
10211
|
+
const declarationsToExport = [NaturalStampComponent];
|
|
10065
10212
|
class NaturalStampModule {
|
|
10066
10213
|
}
|
|
10067
10214
|
NaturalStampModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: NaturalStampModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
10068
|
-
NaturalStampModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.1", ngImport: i0, type: NaturalStampModule, declarations: [NaturalStampComponent], imports: [CommonModule], exports: [NaturalStampComponent] });
|
|
10069
|
-
NaturalStampModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: NaturalStampModule, imports: [CommonModule] });
|
|
10215
|
+
NaturalStampModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.1", ngImport: i0, type: NaturalStampModule, declarations: [NaturalStampComponent], imports: [CommonModule, NaturalCommonModule], exports: [NaturalStampComponent] });
|
|
10216
|
+
NaturalStampModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: NaturalStampModule, imports: [CommonModule, NaturalCommonModule] });
|
|
10070
10217
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: NaturalStampModule, decorators: [{
|
|
10071
10218
|
type: NgModule,
|
|
10072
10219
|
args: [{
|
|
10073
|
-
declarations: [
|
|
10074
|
-
imports: [CommonModule],
|
|
10075
|
-
exports: [
|
|
10220
|
+
declarations: [...declarationsToExport],
|
|
10221
|
+
imports: [CommonModule, NaturalCommonModule],
|
|
10222
|
+
exports: [...declarationsToExport],
|
|
10076
10223
|
}]
|
|
10077
10224
|
}] });
|
|
10078
10225
|
|
|
@@ -10968,9 +11115,7 @@ class NaturalErrorHandler extends ErrorHandler {
|
|
|
10968
11115
|
if (this.url) {
|
|
10969
11116
|
this.http
|
|
10970
11117
|
.post(this.url, params, { headers: new HttpHeaders().set('content-type', 'application/json') })
|
|
10971
|
-
.pipe(catchError(() =>
|
|
10972
|
-
return EMPTY;
|
|
10973
|
-
}))
|
|
11118
|
+
.pipe(catchError(() => EMPTY))
|
|
10974
11119
|
.subscribe();
|
|
10975
11120
|
}
|
|
10976
11121
|
}
|
|
@@ -11041,5 +11186,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", ngImpor
|
|
|
11041
11186
|
* Generated bundle index. Do not edit.
|
|
11042
11187
|
*/
|
|
11043
11188
|
|
|
11044
|
-
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, NaturalDebounceService, 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, deepFreeze, 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 };
|
|
11189
|
+
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, NaturalDebounceService, 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, NaturalTimeAgoPipe, PanelsHooksConfig, SESSION_STORAGE, SortingOrder, TypeDateComponent, TypeDateRangeComponent, TypeHierarchicSelectorComponent, TypeNaturalSelectComponent, TypeNumberComponent, TypeSelectComponent, TypeTextComponent, available, cancellableTimeout, cleanSameValues, collectErrors, copyToClipboard, debug, decimal, deepFreeze, 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 };
|
|
11045
11190
|
//# sourceMappingURL=ecodev-natural.mjs.map
|