@ecodev/natural 51.0.0 → 52.0.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.
Files changed (39) hide show
  1. package/esm2022/lib/classes/abstract-controller.mjs +13 -13
  2. package/esm2022/lib/classes/abstract-detail.mjs +16 -8
  3. package/esm2022/lib/classes/abstract-list.mjs +8 -9
  4. package/esm2022/lib/classes/abstract-navigable-list.mjs +4 -4
  5. package/esm2022/lib/modules/common/directives/src-density.directive.mjs +3 -2
  6. package/esm2022/lib/modules/detail-header/detail-header.component.mjs +3 -2
  7. package/esm2022/lib/modules/dropdown-components/type-date/type-date.component.mjs +6 -8
  8. package/esm2022/lib/modules/fixed-button/fixed-button.component.mjs +3 -2
  9. package/esm2022/lib/modules/fixed-button-detail/fixed-button-detail.component.mjs +9 -9
  10. package/esm2022/lib/modules/hierarchic-selector/hierarchic-selector/hierarchic-selector.component.mjs +3 -2
  11. package/esm2022/lib/modules/icon/icon.directive.mjs +3 -2
  12. package/esm2022/lib/modules/relations/relations.component.mjs +3 -2
  13. package/esm2022/lib/modules/search/group/group.component.mjs +5 -3
  14. package/esm2022/lib/modules/search/input/input.component.mjs +3 -2
  15. package/esm2022/lib/modules/select/select/select.component.mjs +3 -2
  16. package/esm2022/lib/modules/select/select-enum/select-enum.component.mjs +3 -2
  17. package/esm2022/lib/modules/sidenav/sidenav-container/sidenav-container.component.mjs +3 -2
  18. package/esm2022/lib/modules/stamp/stamp.component.mjs +3 -2
  19. package/fesm2022/ecodev-natural.mjs +75 -54
  20. package/fesm2022/ecodev-natural.mjs.map +1 -1
  21. package/lib/classes/abstract-controller.d.ts +12 -6
  22. package/lib/classes/abstract-detail.d.ts +5 -6
  23. package/lib/classes/abstract-list.d.ts +6 -7
  24. package/lib/classes/abstract-navigable-list.d.ts +2 -2
  25. package/lib/modules/common/directives/src-density.directive.d.ts +1 -1
  26. package/lib/modules/detail-header/detail-header.component.d.ts +1 -1
  27. package/lib/modules/dropdown-components/type-date/type-date.component.d.ts +1 -2
  28. package/lib/modules/fixed-button/fixed-button.component.d.ts +1 -1
  29. package/lib/modules/fixed-button-detail/fixed-button-detail.component.d.ts +2 -3
  30. package/lib/modules/hierarchic-selector/hierarchic-selector/hierarchic-selector.component.d.ts +1 -1
  31. package/lib/modules/icon/icon.directive.d.ts +1 -1
  32. package/lib/modules/relations/relations.component.d.ts +1 -1
  33. package/lib/modules/search/group/group.component.d.ts +1 -1
  34. package/lib/modules/search/input/input.component.d.ts +1 -1
  35. package/lib/modules/select/select/select.component.d.ts +1 -1
  36. package/lib/modules/select/select-enum/select-enum.component.d.ts +1 -1
  37. package/lib/modules/sidenav/sidenav-container/sidenav-container.component.d.ts +1 -1
  38. package/lib/modules/stamp/stamp.component.d.ts +1 -1
  39. package/package.json +1 -1
@@ -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, TemplateRef, ViewEncapsulation, ViewChild, Injector, Optional, Input, NgModule, Host, Self, EventEmitter, Output, Pipe, ContentChild, createEnvironmentInjector, createComponent, runInInjectionContext, PLATFORM_ID, ErrorHandler } from '@angular/core';
4
- import { Subject, BehaviorSubject, of, timer, switchMap as switchMap$1, endWith, last, EMPTY, merge as merge$1, Observable, first as first$1, combineLatest, catchError, from, ReplaySubject, debounceTime as debounceTime$1, raceWith, take as take$1, mergeMap, shareReplay as shareReplay$1, forkJoin, map as map$1, tap as tap$1, asyncScheduler, takeUntil as takeUntil$1 } from 'rxjs';
3
+ import { Directive, Component, Inject, Injectable, HostBinding, HostListener, inject, InjectionToken, TemplateRef, ViewEncapsulation, ViewChild, Injector, Optional, Input, NgModule, Host, Self, EventEmitter, Output, Pipe, ContentChild, createEnvironmentInjector, createComponent, runInInjectionContext, PLATFORM_ID, ErrorHandler } from '@angular/core';
4
+ import { Subject, BehaviorSubject, of, timer, switchMap as switchMap$1, endWith, last, EMPTY, merge as merge$1, Observable, first as first$1, combineLatest, catchError, from, ReplaySubject, debounceTime as debounceTime$1, raceWith, take as take$1, mergeMap, shareReplay as shareReplay$1, forkJoin, map as map$1, tap as tap$1, asyncScheduler } from 'rxjs';
5
5
  import * as i3 from '@angular/forms';
6
6
  import { FormGroup, FormArray, Validators, UntypedFormGroup, UntypedFormArray, FormControl, UntypedFormControl, FormsModule, FormControlDirective, FormControlName, ReactiveFormsModule } from '@angular/forms';
7
7
  import * as i2$2 from '@angular/router';
@@ -27,6 +27,7 @@ import { trigger, state, style, transition, sequence, query, animate, group } fr
27
27
  import * as i1$1 from '@angular/cdk/a11y';
28
28
  import * as i2$1 from '@angular/common';
29
29
  import { CommonModule, DatePipe, DOCUMENT, isPlatformBrowser } from '@angular/common';
30
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
30
31
  import * as i4$2 from '@angular/material/form-field';
31
32
  import { MatFormFieldModule, MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field';
32
33
  import * as i5 from '@angular/material/input';
@@ -71,26 +72,26 @@ import { MatSidenavContainer, MatSidenav, MatSidenavModule } from '@angular/mate
71
72
  import * as i1$8 from '@angular/common/http';
72
73
  import { HttpHeaders, HttpClientModule } from '@angular/common/http';
73
74
 
74
- /**
75
- * Use
76
- * import { takeUntil } from 'rxjs/operators';
77
- * .pipe(takeUntil(this.ngUnsubscribe)) as first pipe on observables that should be destroyed on component destroy
78
- */
79
75
  class NaturalAbstractController {
80
76
  constructor() {
77
+ /**
78
+ * Usage:
79
+ *
80
+ * ```ts
81
+ * import { takeUntil } from 'rxjs/operators';
82
+ * .pipe(takeUntil(this.ngUnsubscribe)) // as first pipe on observables that should be destroyed on component destroy
83
+ * ```
84
+ *
85
+ * @deprecated Instead of this, you should create the observable in the constructor or field initializers and use
86
+ * Angular native `.pipe(takeUntilDestroyed())`. And most likely subscribe at a later point. We keep this method until
87
+ * all existing usages (typically in `ngOnInit()`) are migrated away.
88
+ */
81
89
  this.ngUnsubscribe = new Subject();
82
90
  }
83
91
  ngOnDestroy() {
84
92
  this.ngUnsubscribe.next(); // unsubscribe everybody
85
93
  this.ngUnsubscribe.complete(); // complete the stream, because we will never emit again
86
94
  }
87
- back() {
88
- // This is bad, but we don't want to force the injection of document in ,
89
- // all our child classes. And hopefully this particular method is only called
90
- // by a user-interaction, so not used in SSR
91
- // eslint-disable-next-line no-restricted-globals
92
- window.history.back();
93
- }
94
95
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: NaturalAbstractController, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
95
96
  static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.2", type: NaturalAbstractController, ngImport: i0 }); }
96
97
  }
@@ -2281,11 +2282,10 @@ function money(control) {
2281
2282
 
2282
2283
  // @dynamic
2283
2284
  class NaturalAbstractDetail extends NaturalAbstractPanel {
2284
- constructor(key, service, injector) {
2285
+ constructor(key, service) {
2285
2286
  super();
2286
2287
  this.key = key;
2287
2288
  this.service = service;
2288
- this.injector = injector;
2289
2289
  /**
2290
2290
  * Empty placeholder for data retrieved by the server
2291
2291
  */
@@ -2301,9 +2301,18 @@ class NaturalAbstractDetail extends NaturalAbstractPanel {
2301
2301
  * semantic of data on other tab, like relations that list other objects)
2302
2302
  */
2303
2303
  this.showFabButton = true;
2304
- this.alertService = injector.get(NaturalAlertService);
2305
- this.router = injector.get(Router);
2306
- this.route = injector.get(ActivatedRoute);
2304
+ /**
2305
+ * Injected service
2306
+ */
2307
+ this.alertService = inject(NaturalAlertService);
2308
+ /**
2309
+ * Injected service
2310
+ */
2311
+ this.router = inject(Router);
2312
+ /**
2313
+ * Injected service
2314
+ */
2315
+ this.route = inject(ActivatedRoute);
2307
2316
  }
2308
2317
  ngOnInit() {
2309
2318
  if (!this.isPanel) {
@@ -2424,7 +2433,7 @@ class NaturalAbstractDetail extends NaturalAbstractPanel {
2424
2433
  }
2425
2434
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: NaturalAbstractDetail, decorators: [{
2426
2435
  type: Directive
2427
- }], ctorParameters: function () { return [{ type: undefined }, { type: undefined }, { type: i0.Injector }]; } });
2436
+ }], ctorParameters: function () { return [{ type: undefined }, { type: undefined }]; } });
2428
2437
 
2429
2438
  /**
2430
2439
  * This class helps managing non-paginated rows of items that can be edited in-place, typically in a <mat-table>.
@@ -2950,9 +2959,8 @@ function dateMax(dateAdapter, max) {
2950
2959
  };
2951
2960
  }
2952
2961
 
2953
- class TypeDateComponent extends NaturalAbstractController {
2962
+ class TypeDateComponent {
2954
2963
  constructor(data, dateAdapter, dateFormats) {
2955
- super();
2956
2964
  this.dateAdapter = dateAdapter;
2957
2965
  this.dateFormats = dateFormats;
2958
2966
  this.renderedValue = new BehaviorSubject('');
@@ -2970,7 +2978,7 @@ class TypeDateComponent extends NaturalAbstractController {
2970
2978
  max: null,
2971
2979
  };
2972
2980
  this.configuration = { ...this.defaults, ...data.configuration };
2973
- this.todayCtrl.valueChanges.pipe(takeUntil(this.ngUnsubscribe)).subscribe(isToday => {
2981
+ this.todayCtrl.valueChanges.pipe(takeUntilDestroyed()).subscribe(isToday => {
2974
2982
  if (isToday) {
2975
2983
  this.valueCtrl.setValue(this.dateAdapter.today());
2976
2984
  this.valueCtrl.disable();
@@ -2980,7 +2988,7 @@ class TypeDateComponent extends NaturalAbstractController {
2980
2988
  }
2981
2989
  });
2982
2990
  merge$1(this.operatorCtrl.valueChanges, this.valueCtrl.valueChanges, this.todayCtrl.valueChanges)
2983
- .pipe(takeUntil(this.ngUnsubscribe))
2991
+ .pipe(takeUntilDestroyed())
2984
2992
  .subscribe(() => this.renderedValue.next(this.getRenderedValue()));
2985
2993
  this.initValidators();
2986
2994
  this.reloadCondition(data.condition);
@@ -3085,7 +3093,7 @@ class TypeDateComponent extends NaturalAbstractController {
3085
3093
  }
3086
3094
  }
3087
3095
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: TypeDateComponent, deps: [{ token: NATURAL_DROPDOWN_DATA }, { token: i1$3.DateAdapter }, { token: MAT_DATE_FORMATS }], target: i0.ɵɵFactoryTarget.Component }); }
3088
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.2", type: TypeDateComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "<form [formGroup]=\"form\">\n <mat-form-field>\n <mat-label i18n=\"Mathematical operator < > =\">Op\u00E9rateur</mat-label>\n <mat-select [formControl]=\"operatorCtrl\" [required]=\"true\">\n <mat-option *ngFor=\"let item of operators\" [value]=\"item.key\">\n {{ item.label }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label i18n>Date</mat-label>\n <input\n [formControl]=\"valueCtrl\"\n [matDatepicker]=\"value\"\n [max]=\"configuration.max\"\n [min]=\"configuration.min\"\n [required]=\"true\"\n matInput\n />\n <mat-datepicker-toggle [for]=\"value\" matIconSuffix></mat-datepicker-toggle>\n <mat-datepicker #value></mat-datepicker>\n <mat-error *ngIf=\"valueCtrl.hasError('min')\">< {{ configuration.min }}</mat-error>\n <mat-error *ngIf=\"valueCtrl.hasError('max')\">> {{ configuration.max }}</mat-error>\n <mat-error *ngIf=\"valueCtrl.hasError('required')\">*</mat-error>\n </mat-form-field>\n\n <mat-checkbox [formControl]=\"todayCtrl\" i18n>Aujourd'hui</mat-checkbox>\n</form>\n", styles: ["form{display:grid;grid:auto auto/4em auto;grid-gap:0 1em}form>mat-checkbox{grid-column-start:2;margin-bottom:.3em}\n"], dependencies: [{ kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "component", type: i4$2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4$2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4$2.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i4$2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i5.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i6.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: i7.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i7.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i7.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i4$3.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex", "panelWidth", "hideSingleSelectionIndicator"], exportAs: ["matSelect"] }, { kind: "component", type: i1$3.MatOption, selector: "mat-option", exportAs: ["matOption"] }] }); }
3096
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.2", type: TypeDateComponent, selector: "ng-component", ngImport: i0, template: "<form [formGroup]=\"form\">\n <mat-form-field>\n <mat-label i18n=\"Mathematical operator < > =\">Op\u00E9rateur</mat-label>\n <mat-select [formControl]=\"operatorCtrl\" [required]=\"true\">\n <mat-option *ngFor=\"let item of operators\" [value]=\"item.key\">\n {{ item.label }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label i18n>Date</mat-label>\n <input\n [formControl]=\"valueCtrl\"\n [matDatepicker]=\"value\"\n [max]=\"configuration.max\"\n [min]=\"configuration.min\"\n [required]=\"true\"\n matInput\n />\n <mat-datepicker-toggle [for]=\"value\" matIconSuffix></mat-datepicker-toggle>\n <mat-datepicker #value></mat-datepicker>\n <mat-error *ngIf=\"valueCtrl.hasError('min')\">< {{ configuration.min }}</mat-error>\n <mat-error *ngIf=\"valueCtrl.hasError('max')\">> {{ configuration.max }}</mat-error>\n <mat-error *ngIf=\"valueCtrl.hasError('required')\">*</mat-error>\n </mat-form-field>\n\n <mat-checkbox [formControl]=\"todayCtrl\" i18n>Aujourd'hui</mat-checkbox>\n</form>\n", styles: ["form{display:grid;grid:auto auto/4em auto;grid-gap:0 1em}form>mat-checkbox{grid-column-start:2;margin-bottom:.3em}\n"], dependencies: [{ kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "component", type: i4$2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4$2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4$2.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i4$2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i5.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i6.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: i7.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i7.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i7.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i4$3.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex", "panelWidth", "hideSingleSelectionIndicator"], exportAs: ["matSelect"] }, { kind: "component", type: i1$3.MatOption, selector: "mat-option", exportAs: ["matOption"] }] }); }
3089
3097
  }
3090
3098
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: TypeDateComponent, decorators: [{
3091
3099
  type: Component,
@@ -3569,10 +3577,9 @@ function unwrapNavigable(item) {
3569
3577
  */
3570
3578
  // @dynamic
3571
3579
  class NaturalAbstractList extends NaturalAbstractPanel {
3572
- constructor(service, injector) {
3580
+ constructor(service) {
3573
3581
  super();
3574
3582
  this.service = service;
3575
- this.injector = injector;
3576
3583
  /**
3577
3584
  * Wherever search should be loaded from url/storage and persisted in it too.
3578
3585
  */
@@ -3621,10 +3628,10 @@ class NaturalAbstractList extends NaturalAbstractPanel {
3621
3628
  pageIndex: 0,
3622
3629
  pageSize: 25,
3623
3630
  };
3624
- this.router = injector.get(Router);
3625
- this.route = injector.get(ActivatedRoute);
3626
- this.alertService = injector.get(NaturalAlertService);
3627
- this.persistenceService = injector.get(NaturalPersistenceService);
3631
+ this.router = inject(Router);
3632
+ this.route = inject(ActivatedRoute);
3633
+ this.alertService = inject(NaturalAlertService);
3634
+ this.persistenceService = inject(NaturalPersistenceService);
3628
3635
  }
3629
3636
  /**
3630
3637
  * Variables that are always forced on a list, in addition to whatever the end-user might select
@@ -3963,7 +3970,7 @@ class NaturalAbstractList extends NaturalAbstractPanel {
3963
3970
  }
3964
3971
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: NaturalAbstractList, decorators: [{
3965
3972
  type: Directive
3966
- }], ctorParameters: function () { return [{ type: undefined }, { type: i0.Injector }]; }, propDecorators: { persistSearch: [{
3973
+ }], ctorParameters: function () { return [{ type: undefined }]; }, propDecorators: { persistSearch: [{
3967
3974
  type: Input
3968
3975
  }], availableColumns: [{
3969
3976
  type: Input
@@ -3980,8 +3987,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImpor
3980
3987
  * @dynamic
3981
3988
  */
3982
3989
  class NaturalAbstractNavigableList extends NaturalAbstractList {
3983
- constructor(service, injector) {
3984
- super(service, injector);
3990
+ constructor(service) {
3991
+ super(service);
3985
3992
  /**
3986
3993
  * Name of filter for child items to access ancestor item
3987
3994
  */
@@ -4094,7 +4101,7 @@ class NaturalAbstractNavigableList extends NaturalAbstractList {
4094
4101
  }
4095
4102
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: NaturalAbstractNavigableList, decorators: [{
4096
4103
  type: Directive
4097
- }], ctorParameters: function () { return [{ type: undefined }, { type: i0.Injector }]; }, propDecorators: { ancestorRelationName: [{
4104
+ }], ctorParameters: function () { return [{ type: undefined }]; }, propDecorators: { ancestorRelationName: [{
4098
4105
  type: Input
4099
4106
  }] } });
4100
4107
 
@@ -5163,7 +5170,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImpor
5163
5170
  type: HostBinding,
5164
5171
  args: ['class']
5165
5172
  }], naturalIcon: [{
5166
- type: Input
5173
+ type: Input,
5174
+ args: [{ required: true }]
5167
5175
  }], size: [{
5168
5176
  type: Input
5169
5177
  }] } });
@@ -5597,7 +5605,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImpor
5597
5605
  selector: 'img[naturalSrcDensity]',
5598
5606
  }]
5599
5607
  }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { naturalSrcDensity: [{
5600
- type: Input
5608
+ type: Input,
5609
+ args: [{ required: true }]
5601
5610
  }] } });
5602
5611
 
5603
5612
  function isDate(value) {
@@ -6039,7 +6048,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImpor
6039
6048
  }], newLabel: [{
6040
6049
  type: Input
6041
6050
  }], model: [{
6042
- type: Input
6051
+ type: Input,
6052
+ args: [{ required: true }]
6043
6053
  }], breadcrumbs: [{
6044
6054
  type: Input
6045
6055
  }], listRoute: [{
@@ -6753,7 +6763,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImpor
6753
6763
  type: ContentChild,
6754
6764
  args: [TemplateRef]
6755
6765
  }], service: [{
6756
- type: Input
6766
+ type: Input,
6767
+ args: [{ required: true }]
6757
6768
  }], optionRequired: [{
6758
6769
  type: Input
6759
6770
  }], searchField: [{
@@ -7555,7 +7566,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImpor
7555
7566
  }], selection: [{
7556
7567
  type: Input
7557
7568
  }], facets: [{
7558
- type: Input
7569
+ type: Input,
7570
+ args: [{ required: true }]
7559
7571
  }], dropdownTitle: [{
7560
7572
  type: Input
7561
7573
  }], selectionChange: [{
@@ -7604,9 +7616,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImpor
7604
7616
  }], dropdownTitle: [{
7605
7617
  type: Input
7606
7618
  }], placeholder: [{
7607
- type: Input
7619
+ type: Input,
7620
+ args: [{ required: true }]
7608
7621
  }], facets: [{
7609
- type: Input
7622
+ type: Input,
7623
+ args: [{ required: true }]
7610
7624
  }], selectionChange: [{
7611
7625
  type: Output
7612
7626
  }], selections: [{
@@ -8017,7 +8031,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImpor
8017
8031
  }], ctorParameters: function () { return [{ type: NaturalHierarchicSelectorService }]; }, propDecorators: { displayWith: [{
8018
8032
  type: Input
8019
8033
  }], config: [{
8020
- type: Input
8034
+ type: Input,
8035
+ args: [{ required: true }]
8021
8036
  }], multiple: [{
8022
8037
  type: Input
8023
8038
  }], selected: [{
@@ -8536,7 +8551,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImpor
8536
8551
  }, {
8537
8552
  type: Self
8538
8553
  }] }]; }, propDecorators: { enumName: [{
8539
- type: Input
8554
+ type: Input,
8555
+ args: [{ required: true }]
8540
8556
  }], nullLabel: [{
8541
8557
  type: Input
8542
8558
  }], optionDisabled: [{
@@ -9365,7 +9381,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImpor
9365
9381
  type: Component,
9366
9382
  args: [{ selector: 'natural-fixed-button', template: "<button [color]=\"color\" [disabled]=\"disabled\" [routerLink]=\"link\" mat-fab>\n <mat-icon [naturalIcon]=\"icon\"></mat-icon>\n</button>\n", styles: [":host{position:fixed!important;z-index:999;bottom:32px;right:32px}\n"] }]
9367
9383
  }], propDecorators: { icon: [{
9368
- type: Input
9384
+ type: Input,
9385
+ args: [{ required: true }]
9369
9386
  }], link: [{
9370
9387
  type: Input
9371
9388
  }], color: [{
@@ -9392,7 +9409,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImpor
9392
9409
  * Public API Surface of natural
9393
9410
  */
9394
9411
 
9395
- class NaturalFixedButtonDetailComponent extends NaturalAbstractController {
9412
+ class NaturalFixedButtonDetailComponent {
9396
9413
  get model() {
9397
9414
  return this._model;
9398
9415
  }
@@ -9404,12 +9421,11 @@ class NaturalFixedButtonDetailComponent extends NaturalAbstractController {
9404
9421
  }
9405
9422
  }
9406
9423
  constructor(route) {
9407
- super();
9408
9424
  this.canChange = true;
9409
9425
  this.isCreation = false;
9410
9426
  this.create = new EventEmitter();
9411
9427
  this.delete = new EventEmitter();
9412
- route.params.pipe(takeUntil$1(this.ngUnsubscribe)).subscribe(() => (this.canChange = true));
9428
+ route.params.pipe(takeUntilDestroyed()).subscribe(() => (this.canChange = true));
9413
9429
  }
9414
9430
  clickCreate() {
9415
9431
  if (this.form.enabled) {
@@ -9422,15 +9438,17 @@ class NaturalFixedButtonDetailComponent extends NaturalAbstractController {
9422
9438
  }
9423
9439
  }
9424
9440
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: NaturalFixedButtonDetailComponent, deps: [{ token: i2$2.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component }); }
9425
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.2", 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: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: NaturalFixedButtonComponent, selector: "natural-fixed-button", inputs: ["icon", "link", "color", "disabled"] }, { kind: "directive", type: i8.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }] }); }
9441
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.2", 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: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: NaturalFixedButtonComponent, selector: "natural-fixed-button", inputs: ["icon", "link", "color", "disabled"] }, { kind: "directive", type: i8.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }] }); }
9426
9442
  }
9427
9443
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: NaturalFixedButtonDetailComponent, decorators: [{
9428
9444
  type: Component,
9429
9445
  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" }]
9430
9446
  }], ctorParameters: function () { return [{ type: i2$2.ActivatedRoute }]; }, propDecorators: { model: [{
9431
- type: Input
9447
+ type: Input,
9448
+ args: [{ required: true }]
9432
9449
  }], form: [{
9433
- type: Input
9450
+ type: Input,
9451
+ args: [{ required: true }]
9434
9452
  }], create: [{
9435
9453
  type: Output
9436
9454
  }], delete: [{
@@ -10093,7 +10111,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImpor
10093
10111
  }], disabled: [{
10094
10112
  type: Input
10095
10113
  }], main: [{
10096
- type: Input
10114
+ type: Input,
10115
+ args: [{ required: true }]
10097
10116
  }], selectionChange: [{
10098
10117
  type: Output
10099
10118
  }], hierarchicSelectorFilters: [{
@@ -10454,7 +10473,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImpor
10454
10473
  type: Component,
10455
10474
  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"] }]
10456
10475
  }], ctorParameters: function () { return [{ type: NaturalSidenavService }]; }, propDecorators: { name: [{
10457
- type: Input
10476
+ type: Input,
10477
+ args: [{ required: true }]
10458
10478
  }], position: [{
10459
10479
  type: Input
10460
10480
  }], mobileAutoClose: [{
@@ -10528,7 +10548,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImpor
10528
10548
  type: Component,
10529
10549
  args: [{ selector: 'natural-stamp', template: "<ng-container *ngIf=\"item\">\n <div *ngIf=\"item.creationDate || item.creator\">\n <span class=\"mat-subtitle-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\">,&nbsp;</span>\n <span *ngIf=\"item.creationDate\">{{ item.creationDate | swissDate }} ({{ item.creationDate | timeAgo }})</span>\n </div>\n\n <div *ngIf=\"showUpdate()\">\n <span class=\"mat-subtitle-2\" i18n>Modification</span>\n :\n <span *ngIf=\"item.updater\">{{ item.updater.fullName || item.updater.name }}</span>\n <span *ngIf=\"item.updater && item.updateDate\">,&nbsp;</span>\n <span *ngIf=\"item.updateDate\">{{ item.updateDate | swissDate }} ({{ item.updateDate | timeAgo }})</span>\n </div>\n</ng-container>\n" }]
10530
10550
  }], propDecorators: { item: [{
10531
- type: Input
10551
+ type: Input,
10552
+ args: [{ required: true }]
10532
10553
  }] } });
10533
10554
 
10534
10555
  const declarationsToExport = [NaturalStampComponent];