@ecodev/natural 47.3.0 → 47.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -55,6 +55,8 @@ export declare class NaturalAbstractEditableList<TService extends NaturalAbstrac
55
55
  * - AbstractModelService.getPartialVariablesForCreation()
56
56
  * - AbstractModelService.getPartialVariablesForUpdate()
57
57
  * - some other required treatment.
58
+ *
59
+ * TODO return type is incorrect and should be closer to `Partial<T>[]` or an even looser type, because we don't really know what fields exists in the form. When we fix this, we should also remove type coercing in unit tests.
58
60
  */
59
61
  getItems(): T[];
60
62
  /**
@@ -7,9 +7,8 @@ import { HierarchicFiltersConfiguration } from '../../modules/hierarchic-selecto
7
7
  import { LinkableObject, NaturalLinkMutationService } from '../../services/link-mutation.service';
8
8
  import { NaturalHierarchicConfiguration } from '../hierarchic-selector/classes/hierarchic-configuration';
9
9
  import { NaturalHierarchicSelectorDialogService } from '../hierarchic-selector/hierarchic-selector-dialog/hierarchic-selector-dialog.service';
10
- import { Filter } from '../search/classes/graphql-doctrine.types';
11
10
  import { NaturalAbstractModelService } from '../../services/abstract-model.service';
12
- import { Literal } from '../../types/types';
11
+ import { ExtractTallOne, ExtractVall } from '../../types/types';
13
12
  import * as i0 from "@angular/core";
14
13
  /**
15
14
  * Custom template usage :
@@ -19,11 +18,11 @@ import * as i0 from "@angular/core";
19
18
  * </ng-template>
20
19
  * </natural-relations>
21
20
  */
22
- export declare class NaturalRelationsComponent<TService extends NaturalAbstractModelService<any, any, PaginatedData<Literal>, QueryVariables, any, any, any, any, any, any>> extends NaturalAbstractController implements OnInit, OnChanges, OnDestroy {
21
+ export declare class NaturalRelationsComponent<TService extends NaturalAbstractModelService<unknown, any, PaginatedData<LinkableObject>, QueryVariables, unknown, any, unknown, any, unknown, any>> extends NaturalAbstractController implements OnInit, OnChanges, OnDestroy {
23
22
  private readonly linkMutationService;
24
23
  private readonly hierarchicSelectorDialog;
25
24
  private select?;
26
- itemTemplate?: TemplateRef<any>;
25
+ itemTemplate?: TemplateRef<unknown>;
27
26
  service?: TService;
28
27
  /**
29
28
  * The placeholder used in the button to add a new relation
@@ -32,11 +31,11 @@ export declare class NaturalRelationsComponent<TService extends NaturalAbstractM
32
31
  /**
33
32
  * Filter for autocomplete selector
34
33
  */
35
- autocompleteSelectorFilter?: Filter;
34
+ autocompleteSelectorFilter?: ExtractVall<TService>['filter'] | null | undefined;
36
35
  /**
37
36
  * Function to customize the rendering of the selected item as text in input
38
37
  */
39
- displayWith?: (item: any) => string;
38
+ displayWith?: (item: ExtractTallOne<TService> | null) => string;
40
39
  /**
41
40
  * Whether the relations can be changed
42
41
  */
@@ -65,7 +64,7 @@ export declare class NaturalRelationsComponent<TService extends NaturalAbstractM
65
64
  /**
66
65
  * Listing service instance
67
66
  */
68
- dataSource?: NaturalDataSource;
67
+ dataSource?: NaturalDataSource<PaginatedData<LinkableObject>>;
69
68
  loading: boolean;
70
69
  /**
71
70
  * Table columns
@@ -88,7 +87,7 @@ export declare class NaturalRelationsComponent<TService extends NaturalAbstractM
88
87
  * So if the relations are from one action -> to many objectives, then the filter must filter
89
88
  * the objectives that have indeed a relation to the particular action.
90
89
  */
91
- set filter(filter: Filter);
90
+ set filter(filter: ExtractVall<TService>['filter']);
92
91
  ngOnInit(): void;
93
92
  ngOnChanges(): void;
94
93
  /**
@@ -101,9 +100,9 @@ export declare class NaturalRelationsComponent<TService extends NaturalAbstractM
101
100
  * Refetch result to display it in table
102
101
  * TODO : could maybe use "update" attribute of apollo.mutate function to update table faster (but hard to do it here)
103
102
  */
104
- addRelations(relations: LinkableObject[]): void;
103
+ addRelations(relations: (LinkableObject | ExtractTallOne<TService> | string | null)[]): void;
105
104
  pagination(event?: PageEvent): void;
106
- getDisplayFn(): (item: any) => string;
105
+ getDisplayFn(): (item: ExtractTallOne<TService> | null) => string;
107
106
  openNaturalHierarchicSelector(): void;
108
107
  /**
109
108
  * Get list from database
@@ -74,7 +74,7 @@ export declare class NaturalSelectComponent<TService extends NaturalAbstractMode
74
74
  */
75
75
  items: null | Observable<readonly any[]>;
76
76
  /**
77
- * Whether a we are searching something
77
+ * Whether we are searching something
78
78
  */
79
79
  loading: boolean;
80
80
  /**
@@ -108,6 +108,7 @@ export declare class NaturalSelectComponent<TService extends NaturalAbstractMode
108
108
  search(term: V<TService> | null): void;
109
109
  showClearButton(): boolean;
110
110
  private getSearchFilter;
111
+ getVariablesForDebug(): Readonly<QueryVariables> | undefined;
111
112
  static ɵfac: i0.ɵɵFactoryDeclaration<NaturalSelectComponent<any>, never>;
112
113
  static ɵcmp: i0.ɵɵComponentDeclaration<NaturalSelectComponent<any>, "natural-select", never, { "service": "service"; "optionRequired": "optionRequired"; "searchField": "searchField"; "searchOperator": "searchOperator"; "filter": "filter"; "disabled": "disabled"; }, {}, ["itemTemplate"], never, false, never>;
113
114
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecodev/natural",
3
- "version": "47.3.0",
3
+ "version": "47.3.2",
4
4
  "license": "MIT",
5
5
  "repository": "github:Ecodev/natural",
6
6
  "sideEffects": false,