@ecodev/natural 42.4.2 → 43.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.
@@ -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, first as first$1 } from 'rxjs';
4
+ import { Subject, BehaviorSubject, of, timer, EMPTY, Observable, first as first$1, combineLatest, ReplaySubject, forkJoin, merge as merge$1, asyncScheduler, catchError } from 'rxjs';
5
5
  import * as i5 from '@angular/forms';
6
6
  import { FormGroup, FormArray, Validators, FormControl, FormsModule, FormControlDirective, FormControlName, ReactiveFormsModule } from '@angular/forms';
7
7
  import * as i2$1 from '@angular/router';
@@ -525,7 +525,7 @@ class NaturalQueryVariablesManager {
525
525
  */
526
526
  updateVariables() {
527
527
  const merged = {};
528
- this.channels.forEach((channelVariables) => {
528
+ this.channels.forEach(channelVariables => {
529
529
  if (channelVariables.filter) {
530
530
  // Merge filter's groups first
531
531
  const groups = this.mergeGroupList(merged.filter && merged.filter.groups ? merged.filter.groups : [], channelVariables.filter.groups || []);
@@ -3678,13 +3678,15 @@ class NaturalAbstractModelService {
3678
3678
  getOne(id) {
3679
3679
  this.throwIfObservable(id);
3680
3680
  this.throwIfNotQuery(this.oneQuery);
3681
- const queryRef = this.apollo.watchQuery({
3682
- query: this.oneQuery,
3683
- variables: this.getVariablesForOne(id),
3684
- fetchPolicy: 'cache-and-network',
3685
- nextFetchPolicy: 'cache-only',
3686
- });
3687
- return queryRef.valueChanges.pipe(filter(result => !!result.data), takeWhile(result => result.networkStatus !== NetworkStatus.ready, true), map(result => result.data[this.name]));
3681
+ return this.getVariablesForOne(id).pipe(switchMap(variables => {
3682
+ this.throwIfNotQuery(this.oneQuery);
3683
+ return this.apollo.watchQuery({
3684
+ query: this.oneQuery,
3685
+ variables: variables,
3686
+ fetchPolicy: 'cache-and-network',
3687
+ nextFetchPolicy: 'cache-only',
3688
+ }).valueChanges;
3689
+ }), filter(result => !!result.data), takeWhile(result => result.networkStatus !== NetworkStatus.ready, true), map(result => result.data[this.name]));
3688
3690
  }
3689
3691
  /**
3690
3692
  * Get a collection of objects
@@ -3694,16 +3696,17 @@ class NaturalAbstractModelService {
3694
3696
  */
3695
3697
  getAll(queryVariablesManager) {
3696
3698
  this.throwIfNotQuery(this.allQuery);
3697
- // Copy manager to prevent to apply internal variables to external QueryVariablesManager
3698
- const manager = new NaturalQueryVariablesManager(queryVariablesManager);
3699
- manager.merge('partial-variables', this.getPartialVariablesForAll());
3700
- return this.apollo
3701
- .query({
3702
- query: this.allQuery,
3703
- variables: manager.variables.value,
3704
- fetchPolicy: 'network-only',
3705
- })
3706
- .pipe(this.mapAll());
3699
+ return this.getPartialVariablesForAll().pipe(first$1(), switchMap(partialVariables => {
3700
+ this.throwIfNotQuery(this.allQuery);
3701
+ // Copy manager to prevent to apply internal variables to external QueryVariablesManager
3702
+ const manager = new NaturalQueryVariablesManager(queryVariablesManager);
3703
+ manager.merge('partial-variables', partialVariables);
3704
+ return this.apollo.query({
3705
+ query: this.allQuery,
3706
+ variables: manager.variables.value,
3707
+ fetchPolicy: 'network-only',
3708
+ });
3709
+ }), this.mapAll());
3707
3710
  }
3708
3711
  /**
3709
3712
  * Get a collection of objects
@@ -3717,16 +3720,19 @@ class NaturalAbstractModelService {
3717
3720
  */
3718
3721
  watchAll(queryVariablesManager, fetchPolicy = 'cache-and-network') {
3719
3722
  this.throwIfNotQuery(this.allQuery);
3720
- return queryVariablesManager.variables.pipe(
3721
- // Ignore very fast variable changes
3722
- debounceTime(20),
3723
- // Wait for variables to be defined to prevent duplicate query: with and without variables
3724
- // Null is accepted value for "no variables"
3725
- filter(variables => typeof variables !== 'undefined'), switchMap(() => {
3723
+ return combineLatest({
3724
+ variables: queryVariablesManager.variables.pipe(
3725
+ // Ignore very fast variable changes
3726
+ debounceTime(20),
3727
+ // Wait for variables to be defined to prevent duplicate query: with and without variables
3728
+ // Null is accepted value for "no variables"
3729
+ filter(variables => typeof variables !== 'undefined')),
3730
+ partialVariables: this.getPartialVariablesForAll(),
3731
+ }).pipe(switchMap(result => {
3726
3732
  // Apply partial variables from service
3727
3733
  // Copy manager to prevent to apply internal variables to external QueryVariablesManager
3728
3734
  const manager = new NaturalQueryVariablesManager(queryVariablesManager);
3729
- manager.merge('partial-variables', this.getPartialVariablesForAll());
3735
+ manager.merge('partial-variables', result.partialVariables);
3730
3736
  this.throwIfNotQuery(this.allQuery);
3731
3737
  return this.apollo
3732
3738
  .watchQuery({
@@ -3943,22 +3949,22 @@ class NaturalAbstractModelService {
3943
3949
  const plural = makePlural(this.name);
3944
3950
  const queryName = 'Count' + upperCaseFirstLetter(plural);
3945
3951
  const filterType = upperCaseFirstLetter(this.name) + 'Filter';
3946
- // Copy manager to prevent to apply internal variables to external QueryVariablesManager
3947
- const manager = new NaturalQueryVariablesManager(queryVariablesManager);
3948
- manager.merge('partial-variables', this.getPartialVariablesForAll());
3949
3952
  const query = gql `
3950
3953
  query ${queryName} ($filter: ${filterType}) {
3951
3954
  count: ${plural} (filter: $filter, pagination: {pageSize: 0, pageIndex: 0}) {
3952
3955
  length
3953
3956
  }
3954
3957
  }`;
3955
- return this.apollo
3956
- .query({
3957
- query: query,
3958
- variables: manager.variables.value,
3959
- fetchPolicy: 'network-only',
3960
- })
3961
- .pipe(map(result => result.data.count.length));
3958
+ return this.getPartialVariablesForAll().pipe(switchMap(partialVariables => {
3959
+ // Copy manager to prevent to apply internal variables to external QueryVariablesManager
3960
+ const manager = new NaturalQueryVariablesManager(queryVariablesManager);
3961
+ manager.merge('partial-variables', partialVariables);
3962
+ return this.apollo.query({
3963
+ query: query,
3964
+ variables: manager.variables.value,
3965
+ fetchPolicy: 'network-only',
3966
+ });
3967
+ }), map(result => result.data.count.length));
3962
3968
  }
3963
3969
  /**
3964
3970
  * Return empty object with some default values from server perspective
@@ -4010,7 +4016,7 @@ class NaturalAbstractModelService {
4010
4016
  * This is typically a site or state ID, and is needed to get appropriate access rights
4011
4017
  */
4012
4018
  getPartialVariablesForOne() {
4013
- return {};
4019
+ return of({});
4014
4020
  }
4015
4021
  /**
4016
4022
  * Returns additional variables to be used when getting multiple objects
@@ -4018,7 +4024,7 @@ class NaturalAbstractModelService {
4018
4024
  * This is typically a site or state ID, but it could be something else to further filter the query
4019
4025
  */
4020
4026
  getPartialVariablesForAll() {
4021
- return {};
4027
+ return of({});
4022
4028
  }
4023
4029
  /**
4024
4030
  * Returns additional variables to be used when creating an object
@@ -4056,7 +4062,7 @@ class NaturalAbstractModelService {
4056
4062
  * Merge given ID with additional partial variables if there is any
4057
4063
  */
4058
4064
  getVariablesForOne(id) {
4059
- return merge({}, { id: id }, this.getPartialVariablesForOne());
4065
+ return this.getPartialVariablesForOne().pipe(map(partialVariables => merge({}, { id: id }, partialVariables)));
4060
4066
  }
4061
4067
  /**
4062
4068
  * Throw exception to prevent executing null queries
@@ -4356,6 +4362,10 @@ class NaturalColumnsPickerColumnDirective {
4356
4362
  * Initial visibility state
4357
4363
  */
4358
4364
  this.hidden = false;
4365
+ /**
4366
+ * Localized label of column, if absent default to key
4367
+ */
4368
+ this.label = '';
4359
4369
  }
4360
4370
  /**
4361
4371
  * This must be the column key as defined in matColumnDef
@@ -4368,7 +4378,8 @@ class NaturalColumnsPickerColumnDirective {
4368
4378
  this.label = this.key;
4369
4379
  }
4370
4380
  ngAfterViewInit() {
4371
- this.label = this.elementRef.nativeElement.textContent;
4381
+ var _a;
4382
+ this.label = (_a = this.elementRef.nativeElement.textContent) !== null && _a !== void 0 ? _a : '';
4372
4383
  }
4373
4384
  }
4374
4385
  NaturalColumnsPickerColumnDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: NaturalColumnsPickerColumnDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
@@ -4705,7 +4716,7 @@ class NaturalLinkableTabDirective extends NaturalAbstractController {
4705
4716
  }
4706
4717
  });
4707
4718
  // When mat-tab-groups selected tab change, update url
4708
- this.component.selectedTabChange.pipe(takeUntil(this.ngUnsubscribe)).subscribe((event) => {
4719
+ this.component.selectedTabChange.pipe(takeUntil(this.ngUnsubscribe)).subscribe(event => {
4709
4720
  const activatedTabName = getTabId(event.tab);
4710
4721
  const segments = this.route.snapshot.url;
4711
4722
  if (!segments.length) {
@@ -6673,6 +6684,8 @@ class NaturalInputComponent {
6673
6684
  configuration: facet.configuration,
6674
6685
  };
6675
6686
  const injector = Injector.create({ providers: this.createProviders(data), parent: this.injector });
6687
+ // TODO replace by this when https://github.com/angular/angular/commit/d1e83e1b30f2cea9f2ed16bff2d3b969335072ab is released
6688
+ // this.dropdownComponentRef = createComponent(facet.component, {environmentInjector: injector});
6676
6689
  const factory = this.componentFactoryResolver.resolveComponentFactory(facet.component);
6677
6690
  this.dropdownComponentRef = factory.create(injector);
6678
6691
  return this.dropdownComponentRef.instance;
@@ -9308,6 +9321,7 @@ class NaturalRelationsComponent extends NaturalAbstractController {
9308
9321
  * Observable variables/options for listing service usage and apollo watchQuery
9309
9322
  */
9310
9323
  this.variablesManager = new NaturalQueryVariablesManager();
9324
+ this.removing = new Set();
9311
9325
  }
9312
9326
  /**
9313
9327
  * The filter used to filter relations
@@ -9341,7 +9355,11 @@ class NaturalRelationsComponent extends NaturalAbstractController {
9341
9355
  * Refetch result to display it in table
9342
9356
  */
9343
9357
  removeRelation(relation) {
9344
- this.linkMutationService.unlink(this.main, relation, this.otherName).subscribe();
9358
+ this.removing.add(relation);
9359
+ this.linkMutationService
9360
+ .unlink(this.main, relation, this.otherName)
9361
+ .pipe(finalize(() => this.removing.delete(relation)))
9362
+ .subscribe(() => { var _a; return (_a = this.dataSource) === null || _a === void 0 ? void 0 : _a.remove(relation); });
9345
9363
  }
9346
9364
  /**
9347
9365
  * Link action
@@ -9418,10 +9436,10 @@ class NaturalRelationsComponent extends NaturalAbstractController {
9418
9436
  }
9419
9437
  }
9420
9438
  NaturalRelationsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: NaturalRelationsComponent, deps: [{ token: NaturalLinkMutationService }, { token: NaturalHierarchicSelectorDialogService }], target: i0.ɵɵFactoryTarget.Component });
9421
- NaturalRelationsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.0", type: NaturalRelationsComponent, selector: "natural-relations", inputs: { service: "service", placeholder: "placeholder", autocompleteSelectorFilter: "autocompleteSelectorFilter", displayWith: "displayWith", disabled: "disabled", main: "main", hierarchicSelectorFilters: "hierarchicSelectorFilters", hierarchicSelectorConfig: "hierarchicSelectorConfig", otherName: "otherName", filter: "filter" }, outputs: { selectionChange: "selectionChange" }, queries: [{ propertyName: "itemTemplate", first: true, predicate: TemplateRef, descendants: true }], viewQueries: [{ propertyName: "select", first: true, predicate: NaturalSelectComponent, descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"body\">\n <ng-template #defaultNameCell let-item=\"item\">\n {{ getDisplayFn()(item) }}\n </ng-template>\n\n <table *ngIf=\"dataSource\" [dataSource]=\"dataSource\" class=\"natural-row-click\" mat-table>\n <tr *matHeaderRowDef=\"displayedColumns\" mat-header-row style=\"display: none\"></tr>\n <tr *matRowDef=\"let row; columns: displayedColumns\" mat-row></tr>\n\n <ng-container matColumnDef=\"name\">\n <th *matHeaderCellDef i18n mat-header-cell>Titre</th>\n <td *matCellDef=\"let item\" mat-cell>\n <ng-template\n [ngTemplateOutletContext]=\"{item: item}\"\n [ngTemplateOutlet]=\"itemTemplate ? itemTemplate : defaultNameCell\"\n ></ng-template>\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"unlink\">\n <th *matHeaderCellDef mat-header-cell></th>\n <td *matCellDef=\"let element\" mat-cell>\n <button\n *ngIf=\"!disabled\"\n (click)=\"removeRelation(element)\"\n color=\"warn\"\n mat-icon-button\n i18n-matTooltip\n matTooltip=\"Dissocier\"\n >\n <natural-icon name=\"link_off\"></natural-icon>\n </button>\n </td>\n </ng-container>\n </table>\n\n <mat-paginator\n (page)=\"pagination($event)\"\n *ngIf=\"dataSource?.data && (dataSource?.data?.length || 0) > (dataSource?.data?.pageSize || 0)\"\n [length]=\"dataSource?.data?.length || 0\"\n [pageIndex]=\"dataSource?.data?.pageIndex || 0\"\n [pageSizeOptions]=\"pageSizeOptions\"\n [pageSize]=\"dataSource?.data?.pageSize || 0\"\n ></mat-paginator>\n\n <div *ngIf=\"!loading && dataSource?.data?.length === 0\" class=\"margin-v mat-body\">\n <span i18n>Aucun r\u00E9sultat</span>\n </div>\n\n <mat-progress-spinner *ngIf=\"loading\" [diameter]=\"40\" class=\"loading\" mode=\"indeterminate\"></mat-progress-spinner>\n</div>\n\n<natural-select\n #select\n (selectionChange)=\"addRelations([$any($event)])\"\n *ngIf=\"!hierarchicSelectorConfig && service && !disabled\"\n [displayWith]=\"getDisplayFn()\"\n [filter]=\"autocompleteSelectorFilter\"\n [placeholder]=\"placeholder\"\n [service]=\"service\"\n [showIcon]=\"false\"\n></natural-select>\n\n<div *ngIf=\"hierarchicSelectorConfig && !disabled\">\n <button (click)=\"openNaturalHierarchicSelector()\" color=\"primary\" mat-flat-button>{{ placeholder }}</button>\n</div>\n", styles: [":host{display:flex;flex-direction:column}:host>*:not(:last-child){margin-bottom:20px}:host .body{display:flex;flex-direction:column}:host .loading{margin:20px auto}:host .mat-column-unlink{width:2.5em}\n"], components: [{ type: i3$2.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { type: i3$2.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { type: i3$2.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { 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"] }, { type: NaturalIconComponent, selector: "natural-icon", inputs: ["label", "labelColor", "labelPosition", "name", "size"] }, { type: i6$1.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }, { type: i5$1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "diameter", "strokeWidth", "mode", "value"], exportAs: ["matProgressSpinner"] }, { type: NaturalSelectComponent, selector: "natural-select", inputs: ["service", "optionRequired", "searchField", "filter", "disabled"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$2.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { type: i3$2.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { type: i3$2.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { type: i3$2.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { type: i3$2.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { type: i3$2.MatCellDef, selector: "[matCellDef]" }, { type: i3$2.MatCell, selector: "mat-cell, td[mat-cell]" }, { type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i10.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }] });
9439
+ NaturalRelationsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.0", type: NaturalRelationsComponent, selector: "natural-relations", inputs: { service: "service", placeholder: "placeholder", autocompleteSelectorFilter: "autocompleteSelectorFilter", displayWith: "displayWith", disabled: "disabled", main: "main", hierarchicSelectorFilters: "hierarchicSelectorFilters", hierarchicSelectorConfig: "hierarchicSelectorConfig", otherName: "otherName", filter: "filter" }, outputs: { selectionChange: "selectionChange" }, queries: [{ propertyName: "itemTemplate", first: true, predicate: TemplateRef, descendants: true }], viewQueries: [{ propertyName: "select", first: true, predicate: NaturalSelectComponent, descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"body\">\n <ng-template #defaultNameCell let-item=\"item\">\n {{ getDisplayFn()(item) }}\n </ng-template>\n\n <table *ngIf=\"dataSource\" [dataSource]=\"dataSource\" class=\"natural-row-click\" mat-table>\n <tr *matHeaderRowDef=\"displayedColumns\" mat-header-row style=\"display: none\"></tr>\n <tr *matRowDef=\"let row; columns: displayedColumns\" mat-row></tr>\n\n <ng-container matColumnDef=\"name\">\n <th *matHeaderCellDef i18n mat-header-cell>Titre</th>\n <td *matCellDef=\"let item\" mat-cell>\n <ng-template\n [ngTemplateOutletContext]=\"{item: item}\"\n [ngTemplateOutlet]=\"itemTemplate ? itemTemplate : defaultNameCell\"\n ></ng-template>\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"unlink\">\n <th *matHeaderCellDef mat-header-cell></th>\n <td *matCellDef=\"let element\" mat-cell>\n <button\n *ngIf=\"!disabled\"\n (click)=\"removeRelation(element)\"\n [disabled]=\"removing.has(element)\"\n color=\"warn\"\n mat-icon-button\n i18n-matTooltip\n matTooltip=\"Dissocier\"\n >\n <natural-icon name=\"link_off\"></natural-icon>\n </button>\n </td>\n </ng-container>\n </table>\n\n <mat-paginator\n (page)=\"pagination($event)\"\n *ngIf=\"dataSource?.data && (dataSource?.data?.length || 0) > (dataSource?.data?.pageSize || 0)\"\n [length]=\"dataSource?.data?.length || 0\"\n [pageIndex]=\"dataSource?.data?.pageIndex || 0\"\n [pageSizeOptions]=\"pageSizeOptions\"\n [pageSize]=\"dataSource?.data?.pageSize || 0\"\n ></mat-paginator>\n\n <div *ngIf=\"!loading && dataSource?.data?.length === 0\" class=\"margin-v mat-body\">\n <span i18n>Aucun r\u00E9sultat</span>\n </div>\n\n <mat-progress-spinner *ngIf=\"loading\" [diameter]=\"40\" class=\"loading\" mode=\"indeterminate\"></mat-progress-spinner>\n</div>\n\n<natural-select\n #select\n (selectionChange)=\"addRelations([$any($event)])\"\n *ngIf=\"!hierarchicSelectorConfig && service && !disabled\"\n [displayWith]=\"getDisplayFn()\"\n [filter]=\"autocompleteSelectorFilter\"\n [placeholder]=\"placeholder\"\n [service]=\"service\"\n [showIcon]=\"false\"\n></natural-select>\n\n<div *ngIf=\"hierarchicSelectorConfig && !disabled\">\n <button (click)=\"openNaturalHierarchicSelector()\" color=\"primary\" mat-flat-button>{{ placeholder }}</button>\n</div>\n", styles: [":host{display:flex;flex-direction:column}:host>*:not(:last-child){margin-bottom:20px}:host .body{display:flex;flex-direction:column}:host .loading{margin:20px auto}:host .mat-column-unlink{width:2.5em}\n"], components: [{ type: i3$2.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { type: i3$2.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { type: i3$2.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { 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"] }, { type: NaturalIconComponent, selector: "natural-icon", inputs: ["label", "labelColor", "labelPosition", "name", "size"] }, { type: i6$1.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }, { type: i5$1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "diameter", "strokeWidth", "mode", "value"], exportAs: ["matProgressSpinner"] }, { type: NaturalSelectComponent, selector: "natural-select", inputs: ["service", "optionRequired", "searchField", "filter", "disabled"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$2.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { type: i3$2.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { type: i3$2.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { type: i3$2.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { type: i3$2.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { type: i3$2.MatCellDef, selector: "[matCellDef]" }, { type: i3$2.MatCell, selector: "mat-cell, td[mat-cell]" }, { type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i10.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }] });
9422
9440
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: NaturalRelationsComponent, decorators: [{
9423
9441
  type: Component,
9424
- args: [{ selector: 'natural-relations', template: "<div class=\"body\">\n <ng-template #defaultNameCell let-item=\"item\">\n {{ getDisplayFn()(item) }}\n </ng-template>\n\n <table *ngIf=\"dataSource\" [dataSource]=\"dataSource\" class=\"natural-row-click\" mat-table>\n <tr *matHeaderRowDef=\"displayedColumns\" mat-header-row style=\"display: none\"></tr>\n <tr *matRowDef=\"let row; columns: displayedColumns\" mat-row></tr>\n\n <ng-container matColumnDef=\"name\">\n <th *matHeaderCellDef i18n mat-header-cell>Titre</th>\n <td *matCellDef=\"let item\" mat-cell>\n <ng-template\n [ngTemplateOutletContext]=\"{item: item}\"\n [ngTemplateOutlet]=\"itemTemplate ? itemTemplate : defaultNameCell\"\n ></ng-template>\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"unlink\">\n <th *matHeaderCellDef mat-header-cell></th>\n <td *matCellDef=\"let element\" mat-cell>\n <button\n *ngIf=\"!disabled\"\n (click)=\"removeRelation(element)\"\n color=\"warn\"\n mat-icon-button\n i18n-matTooltip\n matTooltip=\"Dissocier\"\n >\n <natural-icon name=\"link_off\"></natural-icon>\n </button>\n </td>\n </ng-container>\n </table>\n\n <mat-paginator\n (page)=\"pagination($event)\"\n *ngIf=\"dataSource?.data && (dataSource?.data?.length || 0) > (dataSource?.data?.pageSize || 0)\"\n [length]=\"dataSource?.data?.length || 0\"\n [pageIndex]=\"dataSource?.data?.pageIndex || 0\"\n [pageSizeOptions]=\"pageSizeOptions\"\n [pageSize]=\"dataSource?.data?.pageSize || 0\"\n ></mat-paginator>\n\n <div *ngIf=\"!loading && dataSource?.data?.length === 0\" class=\"margin-v mat-body\">\n <span i18n>Aucun r\u00E9sultat</span>\n </div>\n\n <mat-progress-spinner *ngIf=\"loading\" [diameter]=\"40\" class=\"loading\" mode=\"indeterminate\"></mat-progress-spinner>\n</div>\n\n<natural-select\n #select\n (selectionChange)=\"addRelations([$any($event)])\"\n *ngIf=\"!hierarchicSelectorConfig && service && !disabled\"\n [displayWith]=\"getDisplayFn()\"\n [filter]=\"autocompleteSelectorFilter\"\n [placeholder]=\"placeholder\"\n [service]=\"service\"\n [showIcon]=\"false\"\n></natural-select>\n\n<div *ngIf=\"hierarchicSelectorConfig && !disabled\">\n <button (click)=\"openNaturalHierarchicSelector()\" color=\"primary\" mat-flat-button>{{ placeholder }}</button>\n</div>\n", styles: [":host{display:flex;flex-direction:column}:host>*:not(:last-child){margin-bottom:20px}:host .body{display:flex;flex-direction:column}:host .loading{margin:20px auto}:host .mat-column-unlink{width:2.5em}\n"] }]
9442
+ args: [{ selector: 'natural-relations', template: "<div class=\"body\">\n <ng-template #defaultNameCell let-item=\"item\">\n {{ getDisplayFn()(item) }}\n </ng-template>\n\n <table *ngIf=\"dataSource\" [dataSource]=\"dataSource\" class=\"natural-row-click\" mat-table>\n <tr *matHeaderRowDef=\"displayedColumns\" mat-header-row style=\"display: none\"></tr>\n <tr *matRowDef=\"let row; columns: displayedColumns\" mat-row></tr>\n\n <ng-container matColumnDef=\"name\">\n <th *matHeaderCellDef i18n mat-header-cell>Titre</th>\n <td *matCellDef=\"let item\" mat-cell>\n <ng-template\n [ngTemplateOutletContext]=\"{item: item}\"\n [ngTemplateOutlet]=\"itemTemplate ? itemTemplate : defaultNameCell\"\n ></ng-template>\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"unlink\">\n <th *matHeaderCellDef mat-header-cell></th>\n <td *matCellDef=\"let element\" mat-cell>\n <button\n *ngIf=\"!disabled\"\n (click)=\"removeRelation(element)\"\n [disabled]=\"removing.has(element)\"\n color=\"warn\"\n mat-icon-button\n i18n-matTooltip\n matTooltip=\"Dissocier\"\n >\n <natural-icon name=\"link_off\"></natural-icon>\n </button>\n </td>\n </ng-container>\n </table>\n\n <mat-paginator\n (page)=\"pagination($event)\"\n *ngIf=\"dataSource?.data && (dataSource?.data?.length || 0) > (dataSource?.data?.pageSize || 0)\"\n [length]=\"dataSource?.data?.length || 0\"\n [pageIndex]=\"dataSource?.data?.pageIndex || 0\"\n [pageSizeOptions]=\"pageSizeOptions\"\n [pageSize]=\"dataSource?.data?.pageSize || 0\"\n ></mat-paginator>\n\n <div *ngIf=\"!loading && dataSource?.data?.length === 0\" class=\"margin-v mat-body\">\n <span i18n>Aucun r\u00E9sultat</span>\n </div>\n\n <mat-progress-spinner *ngIf=\"loading\" [diameter]=\"40\" class=\"loading\" mode=\"indeterminate\"></mat-progress-spinner>\n</div>\n\n<natural-select\n #select\n (selectionChange)=\"addRelations([$any($event)])\"\n *ngIf=\"!hierarchicSelectorConfig && service && !disabled\"\n [displayWith]=\"getDisplayFn()\"\n [filter]=\"autocompleteSelectorFilter\"\n [placeholder]=\"placeholder\"\n [service]=\"service\"\n [showIcon]=\"false\"\n></natural-select>\n\n<div *ngIf=\"hierarchicSelectorConfig && !disabled\">\n <button (click)=\"openNaturalHierarchicSelector()\" color=\"primary\" mat-flat-button>{{ placeholder }}</button>\n</div>\n", styles: [":host{display:flex;flex-direction:column}:host>*:not(:last-child){margin-bottom:20px}:host .body{display:flex;flex-direction:column}:host .loading{margin:20px auto}:host .mat-column-unlink{width:2.5em}\n"] }]
9425
9443
  }], ctorParameters: function () { return [{ type: NaturalLinkMutationService }, { type: NaturalHierarchicSelectorDialogService }]; }, propDecorators: { select: [{
9426
9444
  type: ViewChild,
9427
9445
  args: [NaturalSelectComponent]
@@ -9801,9 +9819,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
9801
9819
  } });
9802
9820
 
9803
9821
  class NaturalSidenavContainerComponent {
9804
- constructor(sidenavService, element) {
9822
+ constructor(sidenavService) {
9805
9823
  this.sidenavService = sidenavService;
9806
- this.element = element;
9807
9824
  /**
9808
9825
  * The side that the drawer is attached to
9809
9826
  */
@@ -9854,12 +9871,12 @@ class NaturalSidenavContainerComponent {
9854
9871
  this.sidenavService.toggleMinimized();
9855
9872
  }
9856
9873
  }
9857
- NaturalSidenavContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: NaturalSidenavContainerComponent, deps: [{ token: NaturalSidenavService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
9874
+ NaturalSidenavContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: NaturalSidenavContainerComponent, deps: [{ token: NaturalSidenavService }], target: i0.ɵɵFactoryTarget.Component });
9858
9875
  NaturalSidenavContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.0", type: NaturalSidenavContainerComponent, selector: "natural-sidenav-container", inputs: { name: "name", position: "position", mobileAutoClose: "mobileAutoClose", minimizedWidth: "minimizedWidth", noScroll: "noScroll" }, host: { properties: { "attr.no-scroll": "this.noScroll" } }, providers: [NaturalSidenavService], viewQueries: [{ propertyName: "menuContainer", first: true, predicate: MatSidenavContainer, descendants: true, static: true }, { propertyName: "menuSidenav", first: true, predicate: MatSidenav, descendants: true, static: true }], ngImport: i0, template: "<mat-sidenav-container (backdropClick)=\"sidenavService.setOpened(false)\">\n <mat-sidenav\n [mode]=\"sidenavService.activeMode\"\n [ngClass]=\"sidenavService.isMinimized ? 'menuMinimized' : ''\"\n [opened]=\"sidenavService.isOpened\"\n [style.min-width.px]=\"sidenavService.isMinimized && minimizedWidth ? minimizedWidth : null\"\n [style.width.px]=\"sidenavService.isMinimized && minimizedWidth ? minimizedWidth : null\"\n [position]=\"position\"\n >\n <ng-content select=\"natural-sidenav\"></ng-content>\n </mat-sidenav>\n\n <mat-sidenav-content>\n <div>\n <ng-content select=\"natural-sidenav-content\"></ng-content>\n </div>\n </mat-sidenav-content>\n</mat-sidenav-container>\n", styles: [":host{display:flex;flex-direction:column}:host mat-sidenav-container{display:flex;flex-direction:column;flex:1}:host mat-sidenav-content>div{overflow:auto}:host .menuMinimized{overflow-x:hidden}:host .buttons{display:flex;flex-direction:row;justify-content:flex-end}\n"], components: [{ type: i2$6.MatSidenavContainer, selector: "mat-sidenav-container", exportAs: ["matSidenavContainer"] }, { type: i2$6.MatSidenav, selector: "mat-sidenav", inputs: ["fixedInViewport", "fixedTopGap", "fixedBottomGap"], exportAs: ["matSidenav"] }, { type: i2$6.MatSidenavContent, selector: "mat-sidenav-content" }], directives: [{ type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
9859
9876
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: NaturalSidenavContainerComponent, decorators: [{
9860
9877
  type: Component,
9861
9878
  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"] }]
9862
- }], ctorParameters: function () { return [{ type: NaturalSidenavService }, { type: i0.ElementRef }]; }, propDecorators: { name: [{
9879
+ }], ctorParameters: function () { return [{ type: NaturalSidenavService }]; }, propDecorators: { name: [{
9863
9880
  type: Input
9864
9881
  }], position: [{
9865
9882
  type: Input