@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';
@@ -522,7 +522,7 @@ class NaturalQueryVariablesManager {
522
522
  */
523
523
  updateVariables() {
524
524
  const merged = {};
525
- this.channels.forEach((channelVariables) => {
525
+ this.channels.forEach(channelVariables => {
526
526
  if (channelVariables.filter) {
527
527
  // Merge filter's groups first
528
528
  const groups = this.mergeGroupList(merged.filter && merged.filter.groups ? merged.filter.groups : [], channelVariables.filter.groups || []);
@@ -3672,13 +3672,15 @@ class NaturalAbstractModelService {
3672
3672
  getOne(id) {
3673
3673
  this.throwIfObservable(id);
3674
3674
  this.throwIfNotQuery(this.oneQuery);
3675
- const queryRef = this.apollo.watchQuery({
3676
- query: this.oneQuery,
3677
- variables: this.getVariablesForOne(id),
3678
- fetchPolicy: 'cache-and-network',
3679
- nextFetchPolicy: 'cache-only',
3680
- });
3681
- return queryRef.valueChanges.pipe(filter(result => !!result.data), takeWhile(result => result.networkStatus !== NetworkStatus.ready, true), map(result => result.data[this.name]));
3675
+ return this.getVariablesForOne(id).pipe(switchMap(variables => {
3676
+ this.throwIfNotQuery(this.oneQuery);
3677
+ return this.apollo.watchQuery({
3678
+ query: this.oneQuery,
3679
+ variables: variables,
3680
+ fetchPolicy: 'cache-and-network',
3681
+ nextFetchPolicy: 'cache-only',
3682
+ }).valueChanges;
3683
+ }), filter(result => !!result.data), takeWhile(result => result.networkStatus !== NetworkStatus.ready, true), map(result => result.data[this.name]));
3682
3684
  }
3683
3685
  /**
3684
3686
  * Get a collection of objects
@@ -3688,16 +3690,17 @@ class NaturalAbstractModelService {
3688
3690
  */
3689
3691
  getAll(queryVariablesManager) {
3690
3692
  this.throwIfNotQuery(this.allQuery);
3691
- // Copy manager to prevent to apply internal variables to external QueryVariablesManager
3692
- const manager = new NaturalQueryVariablesManager(queryVariablesManager);
3693
- manager.merge('partial-variables', this.getPartialVariablesForAll());
3694
- return this.apollo
3695
- .query({
3696
- query: this.allQuery,
3697
- variables: manager.variables.value,
3698
- fetchPolicy: 'network-only',
3699
- })
3700
- .pipe(this.mapAll());
3693
+ return this.getPartialVariablesForAll().pipe(first$1(), switchMap(partialVariables => {
3694
+ this.throwIfNotQuery(this.allQuery);
3695
+ // Copy manager to prevent to apply internal variables to external QueryVariablesManager
3696
+ const manager = new NaturalQueryVariablesManager(queryVariablesManager);
3697
+ manager.merge('partial-variables', partialVariables);
3698
+ return this.apollo.query({
3699
+ query: this.allQuery,
3700
+ variables: manager.variables.value,
3701
+ fetchPolicy: 'network-only',
3702
+ });
3703
+ }), this.mapAll());
3701
3704
  }
3702
3705
  /**
3703
3706
  * Get a collection of objects
@@ -3711,16 +3714,19 @@ class NaturalAbstractModelService {
3711
3714
  */
3712
3715
  watchAll(queryVariablesManager, fetchPolicy = 'cache-and-network') {
3713
3716
  this.throwIfNotQuery(this.allQuery);
3714
- return queryVariablesManager.variables.pipe(
3715
- // Ignore very fast variable changes
3716
- debounceTime(20),
3717
- // Wait for variables to be defined to prevent duplicate query: with and without variables
3718
- // Null is accepted value for "no variables"
3719
- filter(variables => typeof variables !== 'undefined'), switchMap(() => {
3717
+ return combineLatest({
3718
+ variables: queryVariablesManager.variables.pipe(
3719
+ // Ignore very fast variable changes
3720
+ debounceTime(20),
3721
+ // Wait for variables to be defined to prevent duplicate query: with and without variables
3722
+ // Null is accepted value for "no variables"
3723
+ filter(variables => typeof variables !== 'undefined')),
3724
+ partialVariables: this.getPartialVariablesForAll(),
3725
+ }).pipe(switchMap(result => {
3720
3726
  // Apply partial variables from service
3721
3727
  // Copy manager to prevent to apply internal variables to external QueryVariablesManager
3722
3728
  const manager = new NaturalQueryVariablesManager(queryVariablesManager);
3723
- manager.merge('partial-variables', this.getPartialVariablesForAll());
3729
+ manager.merge('partial-variables', result.partialVariables);
3724
3730
  this.throwIfNotQuery(this.allQuery);
3725
3731
  return this.apollo
3726
3732
  .watchQuery({
@@ -3937,22 +3943,22 @@ class NaturalAbstractModelService {
3937
3943
  const plural = makePlural(this.name);
3938
3944
  const queryName = 'Count' + upperCaseFirstLetter(plural);
3939
3945
  const filterType = upperCaseFirstLetter(this.name) + 'Filter';
3940
- // Copy manager to prevent to apply internal variables to external QueryVariablesManager
3941
- const manager = new NaturalQueryVariablesManager(queryVariablesManager);
3942
- manager.merge('partial-variables', this.getPartialVariablesForAll());
3943
3946
  const query = gql `
3944
3947
  query ${queryName} ($filter: ${filterType}) {
3945
3948
  count: ${plural} (filter: $filter, pagination: {pageSize: 0, pageIndex: 0}) {
3946
3949
  length
3947
3950
  }
3948
3951
  }`;
3949
- return this.apollo
3950
- .query({
3951
- query: query,
3952
- variables: manager.variables.value,
3953
- fetchPolicy: 'network-only',
3954
- })
3955
- .pipe(map(result => result.data.count.length));
3952
+ return this.getPartialVariablesForAll().pipe(switchMap(partialVariables => {
3953
+ // Copy manager to prevent to apply internal variables to external QueryVariablesManager
3954
+ const manager = new NaturalQueryVariablesManager(queryVariablesManager);
3955
+ manager.merge('partial-variables', partialVariables);
3956
+ return this.apollo.query({
3957
+ query: query,
3958
+ variables: manager.variables.value,
3959
+ fetchPolicy: 'network-only',
3960
+ });
3961
+ }), map(result => result.data.count.length));
3956
3962
  }
3957
3963
  /**
3958
3964
  * Return empty object with some default values from server perspective
@@ -4004,7 +4010,7 @@ class NaturalAbstractModelService {
4004
4010
  * This is typically a site or state ID, and is needed to get appropriate access rights
4005
4011
  */
4006
4012
  getPartialVariablesForOne() {
4007
- return {};
4013
+ return of({});
4008
4014
  }
4009
4015
  /**
4010
4016
  * Returns additional variables to be used when getting multiple objects
@@ -4012,7 +4018,7 @@ class NaturalAbstractModelService {
4012
4018
  * This is typically a site or state ID, but it could be something else to further filter the query
4013
4019
  */
4014
4020
  getPartialVariablesForAll() {
4015
- return {};
4021
+ return of({});
4016
4022
  }
4017
4023
  /**
4018
4024
  * Returns additional variables to be used when creating an object
@@ -4050,7 +4056,7 @@ class NaturalAbstractModelService {
4050
4056
  * Merge given ID with additional partial variables if there is any
4051
4057
  */
4052
4058
  getVariablesForOne(id) {
4053
- return merge({}, { id: id }, this.getPartialVariablesForOne());
4059
+ return this.getPartialVariablesForOne().pipe(map(partialVariables => merge({}, { id: id }, partialVariables)));
4054
4060
  }
4055
4061
  /**
4056
4062
  * Throw exception to prevent executing null queries
@@ -4349,6 +4355,10 @@ class NaturalColumnsPickerColumnDirective {
4349
4355
  * Initial visibility state
4350
4356
  */
4351
4357
  this.hidden = false;
4358
+ /**
4359
+ * Localized label of column, if absent default to key
4360
+ */
4361
+ this.label = '';
4352
4362
  }
4353
4363
  /**
4354
4364
  * This must be the column key as defined in matColumnDef
@@ -4361,7 +4371,7 @@ class NaturalColumnsPickerColumnDirective {
4361
4371
  this.label = this.key;
4362
4372
  }
4363
4373
  ngAfterViewInit() {
4364
- this.label = this.elementRef.nativeElement.textContent;
4374
+ this.label = this.elementRef.nativeElement.textContent ?? '';
4365
4375
  }
4366
4376
  }
4367
4377
  NaturalColumnsPickerColumnDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: NaturalColumnsPickerColumnDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
@@ -4691,7 +4701,7 @@ class NaturalLinkableTabDirective extends NaturalAbstractController {
4691
4701
  }
4692
4702
  });
4693
4703
  // When mat-tab-groups selected tab change, update url
4694
- this.component.selectedTabChange.pipe(takeUntil(this.ngUnsubscribe)).subscribe((event) => {
4704
+ this.component.selectedTabChange.pipe(takeUntil(this.ngUnsubscribe)).subscribe(event => {
4695
4705
  const activatedTabName = getTabId(event.tab);
4696
4706
  const segments = this.route.snapshot.url;
4697
4707
  if (!segments.length) {
@@ -6631,6 +6641,8 @@ class NaturalInputComponent {
6631
6641
  configuration: facet.configuration,
6632
6642
  };
6633
6643
  const injector = Injector.create({ providers: this.createProviders(data), parent: this.injector });
6644
+ // TODO replace by this when https://github.com/angular/angular/commit/d1e83e1b30f2cea9f2ed16bff2d3b969335072ab is released
6645
+ // this.dropdownComponentRef = createComponent(facet.component, {environmentInjector: injector});
6634
6646
  const factory = this.componentFactoryResolver.resolveComponentFactory(facet.component);
6635
6647
  this.dropdownComponentRef = factory.create(injector);
6636
6648
  return this.dropdownComponentRef.instance;
@@ -9241,6 +9253,7 @@ class NaturalRelationsComponent extends NaturalAbstractController {
9241
9253
  * Observable variables/options for listing service usage and apollo watchQuery
9242
9254
  */
9243
9255
  this.variablesManager = new NaturalQueryVariablesManager();
9256
+ this.removing = new Set();
9244
9257
  }
9245
9258
  /**
9246
9259
  * The filter used to filter relations
@@ -9274,7 +9287,11 @@ class NaturalRelationsComponent extends NaturalAbstractController {
9274
9287
  * Refetch result to display it in table
9275
9288
  */
9276
9289
  removeRelation(relation) {
9277
- this.linkMutationService.unlink(this.main, relation, this.otherName).subscribe();
9290
+ this.removing.add(relation);
9291
+ this.linkMutationService
9292
+ .unlink(this.main, relation, this.otherName)
9293
+ .pipe(finalize(() => this.removing.delete(relation)))
9294
+ .subscribe(() => this.dataSource?.remove(relation));
9278
9295
  }
9279
9296
  /**
9280
9297
  * Link action
@@ -9351,10 +9368,10 @@ class NaturalRelationsComponent extends NaturalAbstractController {
9351
9368
  }
9352
9369
  }
9353
9370
  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 });
9354
- 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"] }] });
9371
+ 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"] }] });
9355
9372
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: NaturalRelationsComponent, decorators: [{
9356
9373
  type: Component,
9357
- 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"] }]
9374
+ 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"] }]
9358
9375
  }], ctorParameters: function () { return [{ type: NaturalLinkMutationService }, { type: NaturalHierarchicSelectorDialogService }]; }, propDecorators: { select: [{
9359
9376
  type: ViewChild,
9360
9377
  args: [NaturalSelectComponent]
@@ -9732,9 +9749,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
9732
9749
  }] }, { type: NaturalSidenavStackService }]; } });
9733
9750
 
9734
9751
  class NaturalSidenavContainerComponent {
9735
- constructor(sidenavService, element) {
9752
+ constructor(sidenavService) {
9736
9753
  this.sidenavService = sidenavService;
9737
- this.element = element;
9738
9754
  /**
9739
9755
  * The side that the drawer is attached to
9740
9756
  */
@@ -9785,12 +9801,12 @@ class NaturalSidenavContainerComponent {
9785
9801
  this.sidenavService.toggleMinimized();
9786
9802
  }
9787
9803
  }
9788
- 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 });
9804
+ NaturalSidenavContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: NaturalSidenavContainerComponent, deps: [{ token: NaturalSidenavService }], target: i0.ɵɵFactoryTarget.Component });
9789
9805
  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"] }] });
9790
9806
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: NaturalSidenavContainerComponent, decorators: [{
9791
9807
  type: Component,
9792
9808
  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"] }]
9793
- }], ctorParameters: function () { return [{ type: NaturalSidenavService }, { type: i0.ElementRef }]; }, propDecorators: { name: [{
9809
+ }], ctorParameters: function () { return [{ type: NaturalSidenavService }]; }, propDecorators: { name: [{
9794
9810
  type: Input
9795
9811
  }], position: [{
9796
9812
  type: Input