@ecodev/natural 63.9.1 → 64.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 (160) hide show
  1. package/fesm2022/ecodev-natural-vanilla.mjs +3 -3
  2. package/fesm2022/ecodev-natural-vanilla.mjs.map +1 -1
  3. package/fesm2022/ecodev-natural.mjs +520 -650
  4. package/fesm2022/ecodev-natural.mjs.map +1 -1
  5. package/index.d.ts +4264 -3
  6. package/package.json +9 -9
  7. package/src/lib/modules/sidenav/_sidenav.theme.scss +1 -1
  8. package/vanilla/index.d.ts +418 -3
  9. package/lib/classes/abstract-detail.d.ts +0 -108
  10. package/lib/classes/abstract-editable-list.d.ts +0 -70
  11. package/lib/classes/abstract-list.d.ts +0 -191
  12. package/lib/classes/abstract-navigable-list.d.ts +0 -54
  13. package/lib/classes/apollo-utils.d.ts +0 -18
  14. package/lib/classes/crypto.d.ts +0 -8
  15. package/lib/classes/cumulative-changes.d.ts +0 -27
  16. package/lib/classes/data-source.d.ts +0 -32
  17. package/lib/classes/network-activity.service.d.ts +0 -54
  18. package/lib/classes/providers.d.ts +0 -5
  19. package/lib/classes/query-variable-manager-utils.d.ts +0 -2
  20. package/lib/classes/query-variable-manager.d.ts +0 -91
  21. package/lib/classes/rxjs.d.ts +0 -42
  22. package/lib/classes/signing.d.ts +0 -7
  23. package/lib/classes/tld.d.ts +0 -10
  24. package/lib/classes/utility.d.ts +0 -85
  25. package/lib/classes/validators.d.ts +0 -72
  26. package/lib/directives/http-prefix.directive.d.ts +0 -15
  27. package/lib/modules/alert/alert.service.d.ts +0 -21
  28. package/lib/modules/alert/confirm.component.d.ts +0 -12
  29. package/lib/modules/alert/public-api.d.ts +0 -2
  30. package/lib/modules/avatar/component/avatar.component.d.ts +0 -37
  31. package/lib/modules/avatar/public-api.d.ts +0 -2
  32. package/lib/modules/avatar/service/avatar.service.d.ts +0 -24
  33. package/lib/modules/avatar/sources/gravatar.d.ts +0 -8
  34. package/lib/modules/avatar/sources/image.d.ts +0 -8
  35. package/lib/modules/avatar/sources/initials.d.ts +0 -8
  36. package/lib/modules/avatar/sources/source.d.ts +0 -23
  37. package/lib/modules/columns-picker/columns-picker.component.d.ts +0 -45
  38. package/lib/modules/columns-picker/public-api.d.ts +0 -2
  39. package/lib/modules/columns-picker/types.d.ts +0 -84
  40. package/lib/modules/common/directives/background-density.directive.d.ts +0 -37
  41. package/lib/modules/common/directives/linkable-tab.directive.d.ts +0 -29
  42. package/lib/modules/common/directives/src-density.directive.d.ts +0 -33
  43. package/lib/modules/common/pipes/capitalize.pipe.d.ts +0 -10
  44. package/lib/modules/common/pipes/ellipsis.pipe.d.ts +0 -7
  45. package/lib/modules/common/pipes/enum.pipe.d.ts +0 -14
  46. package/lib/modules/common/pipes/time-ago.pipe.d.ts +0 -18
  47. package/lib/modules/common/public-api.d.ts +0 -11
  48. package/lib/modules/common/services/memory-storage.d.ts +0 -46
  49. package/lib/modules/common/services/seo.provider.d.ts +0 -6
  50. package/lib/modules/common/services/seo.service.d.ts +0 -148
  51. package/lib/modules/detail-header/detail-header.component.d.ts +0 -43
  52. package/lib/modules/detail-header/public-api.d.ts +0 -1
  53. package/lib/modules/dialog-trigger/dialog-trigger.component.d.ts +0 -37
  54. package/lib/modules/dialog-trigger/public-api.d.ts +0 -1
  55. package/lib/modules/dropdown-components/abstract-association-select-component.directive.d.ts +0 -34
  56. package/lib/modules/dropdown-components/public-api.d.ts +0 -10
  57. package/lib/modules/dropdown-components/type-boolean/type-boolean.component.d.ts +0 -12
  58. package/lib/modules/dropdown-components/type-date/type-date.component.d.ts +0 -36
  59. package/lib/modules/dropdown-components/type-date-range/type-date-range.component.d.ts +0 -43
  60. package/lib/modules/dropdown-components/type-hierarchic-selector/type-hierarchic-selector.component.d.ts +0 -31
  61. package/lib/modules/dropdown-components/type-natural-select/type-natural-select.component.d.ts +0 -18
  62. package/lib/modules/dropdown-components/type-number/type-number.component.d.ts +0 -36
  63. package/lib/modules/dropdown-components/type-options/type-options.component.d.ts +0 -29
  64. package/lib/modules/dropdown-components/type-select/type-select.component.d.ts +0 -59
  65. package/lib/modules/dropdown-components/type-text/type-text.component.d.ts +0 -26
  66. package/lib/modules/dropdown-components/types.d.ts +0 -13
  67. package/lib/modules/dropdown-components/utils.d.ts +0 -14
  68. package/lib/modules/file/abstract-file.d.ts +0 -95
  69. package/lib/modules/file/component/file.component.d.ts +0 -58
  70. package/lib/modules/file/file-drop.directive.d.ts +0 -32
  71. package/lib/modules/file/file-select.directive.d.ts +0 -15
  72. package/lib/modules/file/file.service.d.ts +0 -19
  73. package/lib/modules/file/public-api.d.ts +0 -6
  74. package/lib/modules/file/types.d.ts +0 -7
  75. package/lib/modules/file/utils.d.ts +0 -8
  76. package/lib/modules/fixed-button/fixed-button.component.d.ts +0 -11
  77. package/lib/modules/fixed-button/public-api.d.ts +0 -1
  78. package/lib/modules/fixed-button-detail/fixed-button-detail.component.d.ts +0 -24
  79. package/lib/modules/fixed-button-detail/public-api.d.ts +0 -1
  80. package/lib/modules/hierarchic-selector/classes/flat-node.d.ts +0 -11
  81. package/lib/modules/hierarchic-selector/classes/hierarchic-configuration.d.ts +0 -56
  82. package/lib/modules/hierarchic-selector/classes/hierarchic-filters-configuration.d.ts +0 -7
  83. package/lib/modules/hierarchic-selector/classes/model-node.d.ts +0 -13
  84. package/lib/modules/hierarchic-selector/hierarchic-selector/hierarchic-selector.component.d.ts +0 -161
  85. package/lib/modules/hierarchic-selector/hierarchic-selector/hierarchic-selector.service.d.ts +0 -76
  86. package/lib/modules/hierarchic-selector/hierarchic-selector-dialog/hierarchic-selector-dialog.component.d.ts +0 -59
  87. package/lib/modules/hierarchic-selector/hierarchic-selector-dialog/hierarchic-selector-dialog.service.d.ts +0 -9
  88. package/lib/modules/hierarchic-selector/public-api.d.ts +0 -6
  89. package/lib/modules/icon/icon.directive.d.ts +0 -39
  90. package/lib/modules/icon/icon.module.d.ts +0 -9
  91. package/lib/modules/icon/public-api.d.ts +0 -2
  92. package/lib/modules/logger/error-handler.d.ts +0 -52
  93. package/lib/modules/logger/error.module.d.ts +0 -3
  94. package/lib/modules/logger/public-api.d.ts +0 -3
  95. package/lib/modules/matomo/matomo.service.d.ts +0 -42
  96. package/lib/modules/matomo/public-api.d.ts +0 -1
  97. package/lib/modules/panels/abstract-panel.d.ts +0 -37
  98. package/lib/modules/panels/fallback-if-no-opened-panels.urlmatcher.d.ts +0 -6
  99. package/lib/modules/panels/panels.component.d.ts +0 -9
  100. package/lib/modules/panels/panels.module.d.ts +0 -3
  101. package/lib/modules/panels/panels.service.d.ts +0 -121
  102. package/lib/modules/panels/panels.urlmatcher.d.ts +0 -8
  103. package/lib/modules/panels/public-api.d.ts +0 -7
  104. package/lib/modules/panels/types.d.ts +0 -61
  105. package/lib/modules/relations/public-api.d.ts +0 -1
  106. package/lib/modules/relations/relations.component.d.ts +0 -123
  107. package/lib/modules/search/classes/graphql-doctrine.d.ts +0 -4
  108. package/lib/modules/search/classes/graphql-doctrine.types.d.ts +0 -83
  109. package/lib/modules/search/classes/transformers.d.ts +0 -78
  110. package/lib/modules/search/classes/url.d.ts +0 -18
  111. package/lib/modules/search/classes/utils.d.ts +0 -17
  112. package/lib/modules/search/dropdown-container/dropdown-container.component.d.ts +0 -31
  113. package/lib/modules/search/dropdown-container/dropdown-ref.d.ts +0 -13
  114. package/lib/modules/search/dropdown-container/dropdown.service.d.ts +0 -24
  115. package/lib/modules/search/facet-selector/facet-selector.component.d.ts +0 -32
  116. package/lib/modules/search/group/group.component.d.ts +0 -21
  117. package/lib/modules/search/input/input.component.d.ts +0 -110
  118. package/lib/modules/search/public-api.d.ts +0 -11
  119. package/lib/modules/search/search/search.component.d.ts +0 -44
  120. package/lib/modules/search/types/dropdown-component.d.ts +0 -20
  121. package/lib/modules/search/types/facet.d.ts +0 -75
  122. package/lib/modules/search/types/values.d.ts +0 -32
  123. package/lib/modules/select/abstract-select.component.d.ts +0 -127
  124. package/lib/modules/select/public-api.d.ts +0 -3
  125. package/lib/modules/select/select/select.component.d.ts +0 -135
  126. package/lib/modules/select/select-enum/select-enum.component.d.ts +0 -32
  127. package/lib/modules/select/select-hierarchic/select-hierarchic.component.d.ts +0 -65
  128. package/lib/modules/sidenav/public-api.d.ts +0 -5
  129. package/lib/modules/sidenav/sidenav/sidenav.component.d.ts +0 -5
  130. package/lib/modules/sidenav/sidenav-container/sidenav-container.component.d.ts +0 -45
  131. package/lib/modules/sidenav/sidenav-content/sidenav-content.component.d.ts +0 -5
  132. package/lib/modules/sidenav/sidenav-stack.service.d.ts +0 -28
  133. package/lib/modules/sidenav/sidenav.service.d.ts +0 -86
  134. package/lib/modules/stamp/public-api.d.ts +0 -1
  135. package/lib/modules/stamp/stamp.component.d.ts +0 -15
  136. package/lib/modules/table-button/public-api.d.ts +0 -1
  137. package/lib/modules/table-button/table-button.component.d.ts +0 -32
  138. package/lib/services/abstract-model.service.d.ts +0 -244
  139. package/lib/services/debounce.service.d.ts +0 -52
  140. package/lib/services/enum.service.d.ts +0 -19
  141. package/lib/services/link-mutation.service.d.ts +0 -51
  142. package/lib/services/persistence.service.d.ts +0 -50
  143. package/lib/services/swiss-parsing-date-adapter.service.d.ts +0 -16
  144. package/lib/types/types.d.ts +0 -100
  145. package/public-api.d.ts +0 -44
  146. package/vanilla/public-api.d.ts +0 -11
  147. package/vanilla/src/lib/classes/crypto.d.ts +0 -8
  148. package/vanilla/src/lib/classes/data-source.d.ts +0 -32
  149. package/vanilla/src/lib/classes/query-variable-manager-utils.d.ts +0 -2
  150. package/vanilla/src/lib/classes/query-variable-manager.d.ts +0 -91
  151. package/vanilla/src/lib/classes/signing.d.ts +0 -7
  152. package/vanilla/src/lib/classes/utility.d.ts +0 -85
  153. package/vanilla/src/lib/modules/search/classes/graphql-doctrine.types.d.ts +0 -83
  154. package/vanilla/src/lib/modules/search/classes/utils.d.ts +0 -17
  155. package/vanilla/src/lib/modules/search/types/dropdown-component.d.ts +0 -20
  156. package/vanilla/src/lib/modules/search/types/facet.d.ts +0 -75
  157. package/vanilla/src/lib/modules/search/types/values.d.ts +0 -32
  158. package/vanilla/src/lib/services/abstract-model.service.d.ts +0 -244
  159. package/vanilla/src/lib/services/debounce.service.d.ts +0 -52
  160. package/vanilla/src/lib/types/types.d.ts +0 -100
@@ -1,191 +0,0 @@
1
- import { SelectionModel } from '@angular/cdk/collections';
2
- import { OnInit } from '@angular/core';
3
- import { PageEvent } from '@angular/material/paginator';
4
- import { Sort } from '@angular/material/sort';
5
- import { ActivatedRoute, Data, NavigationExtras, Router } from '@angular/router';
6
- import { Observable } from 'rxjs';
7
- import { NaturalAlertService } from '../modules/alert/alert.service';
8
- import { AvailableColumn } from '../modules/columns-picker/types';
9
- import { NaturalAbstractPanel } from '../modules/panels/abstract-panel';
10
- import { NaturalSearchFacets } from '../modules/search/types/facet';
11
- import { NaturalSearchSelections } from '../modules/search/types/values';
12
- import { NaturalAbstractModelService } from '../services/abstract-model.service';
13
- import { NaturalPersistenceService } from '../services/persistence.service';
14
- import { ExtractTall, ExtractVall, Literal } from '../types/types';
15
- import { NavigableItem } from './abstract-navigable-list';
16
- import { NaturalDataSource, PaginatedData } from './data-source';
17
- import { NaturalQueryVariablesManager, PaginationInput, QueryVariables, Sorting } from './query-variable-manager';
18
- import * as i0 from "@angular/core";
19
- type MaybeNavigable = Literal | NavigableItem<Literal>;
20
- /**
21
- * This class helps managing a list of paginated items that can be filtered,
22
- * selected, and then bulk actions can be performed on selection.
23
- *
24
- * Components inheriting from this class can be used as standalone with input attributes.
25
- *
26
- * Usage :
27
- *
28
- * ```html
29
- * <natural-my-listing [forcedVariables]="{filter:...}" [selectedColumns]="['col1']" [persistSearch]="false">
30
- * ```
31
- */
32
- export declare class NaturalAbstractList<TService extends NaturalAbstractModelService<any, any, PaginatedData<Literal>, QueryVariables, any, any, any, any, any, any>, Tall extends PaginatedData<MaybeNavigable> = ExtractTall<TService>> extends NaturalAbstractPanel implements OnInit {
33
- readonly service: TService;
34
- /**
35
- * Whether search should be loaded from url/storage and persisted in it too.
36
- */
37
- persistSearch: boolean;
38
- /**
39
- * List of columns that are available to the end-user to select from, via `<natural-columns-picker>`
40
- */
41
- availableColumns: AvailableColumn[];
42
- /**
43
- * Columns list after interaction with `<natural-columns-picker>`
44
- */
45
- columnsForTable: string[];
46
- /**
47
- * The default column selection that automatically happened after `<natural-columns-picker>` initialization
48
- */
49
- private defaultSelectedColumns;
50
- /**
51
- * Visible (checked) columns
52
- *
53
- * Instead of using this, you should consider correctly configuring `AvailableColumn.checked`.
54
- */
55
- selectedColumns?: string[];
56
- /**
57
- * Source of the list
58
- */
59
- dataSource: NaturalDataSource<Tall> | undefined;
60
- /**
61
- * Selection for bulk actions
62
- */
63
- readonly selection: SelectionModel<ExtractTall<TService>["items"][0]>;
64
- /**
65
- * Next executed action from bulk menu
66
- */
67
- bulkActionSelected: string | null;
68
- /**
69
- * Centralisation of query variables
70
- */
71
- variablesManager: NaturalQueryVariablesManager<ExtractVall<TService>>;
72
- /**
73
- * Configuration for natural-search facets
74
- */
75
- naturalSearchFacets: NaturalSearchFacets;
76
- /**
77
- * Result of a search (can be provided as input for initialisation)
78
- */
79
- naturalSearchSelections: NaturalSearchSelections;
80
- /**
81
- * Data attribute provided by activated route snapshot
82
- */
83
- routeData?: Data;
84
- /**
85
- * List of page sizes
86
- */
87
- readonly pageSizeOptions: number[];
88
- /**
89
- * Initial pagination setup
90
- */
91
- protected defaultPagination: Required<PaginationInput>;
92
- /**
93
- * Initial sorting
94
- */
95
- protected defaultSorting?: Sorting[];
96
- protected readonly router: Router;
97
- protected readonly route: ActivatedRoute;
98
- protected readonly alertService: NaturalAlertService;
99
- protected readonly persistenceService: NaturalPersistenceService;
100
- constructor(service: TService);
101
- /**
102
- * Variables that are always forced on a list, in addition to whatever the end-user might select
103
- */
104
- set forcedVariables(variables: QueryVariables | null | undefined);
105
- /**
106
- * If change, check DocumentsComponent that overrides this function without calling super.ngOnInit().
107
- */
108
- ngOnInit(): void;
109
- protected handleHistoryNavigation(): void;
110
- /**
111
- * Persist search and then launch whatever is required to refresh the list
112
- */
113
- search(naturalSearchSelections: NaturalSearchSelections, navigationExtras?: NavigationExtras, resetPagination?: boolean): void;
114
- /**
115
- * Change sorting variables for query and persist the new value in url and local storage
116
- * The default value is not persisted
117
- * @param sortingEvents List of material sorting events
118
- */
119
- sorting(sortingEvents: (Sort & Partial<Pick<Sorting, 'nullAsHighest' | 'emptyStringAsHighest'>>)[]): void;
120
- /**
121
- * Return current pagination, either the user defined one, or the default one
122
- */
123
- protected getPagination(): PaginationInput;
124
- /**
125
- * Change pagination variables for query and persist in url and local storage the new value
126
- * The default value not persisted
127
- *
128
- * @param event Natural or Paginator PageEvent
129
- * @param defer Promise (usually a route promise) that defers the redirection from this call to prevent route navigation collision
130
- * @param navigationExtras Angular router navigation options. Is relevant only if persistSearch is true
131
- */
132
- pagination(event: PaginationInput | PageEvent, defer?: Promise<unknown>, navigationExtras?: NavigationExtras): void;
133
- protected persistPagination(pagination: PaginationInput | null, defer?: Promise<unknown>, navigationExtras?: NavigationExtras): void;
134
- /**
135
- * Selects all rows if they are not all selected; otherwise clear selection
136
- */
137
- masterToggle(): void;
138
- /**
139
- * Whether the number of selected elements matches the total number of rows
140
- */
141
- isAllSelected(): boolean;
142
- /**
143
- * Called when a bulk action is selected
144
- */
145
- bulkAction(): void;
146
- /**
147
- * In non-panel context, header is always visible.
148
- * In panel context, header is hidden when no results.
149
- */
150
- showHeader(): boolean;
151
- /**
152
- * Search is visible in most cases, but hidden on a panel
153
- */
154
- showSearch(): boolean;
155
- /**
156
- * Table should be shown only when there is data
157
- */
158
- showTable(): boolean;
159
- /**
160
- * No results is shown when there is no items, but only in non-panel context only.
161
- * In panels we want discrete mode, there is no search and no "no-results"
162
- */
163
- showNoResults(): boolean;
164
- /**
165
- * Initialize from route.
166
- *
167
- * Uses data provided by router such as:
168
- *
169
- * - `route.data.forcedVariables`
170
- * - `route.data.availableColumns`
171
- * - `route.data.selectedColumns`
172
- */
173
- protected initFromRoute(): void;
174
- protected getDataObservable(): Observable<Tall>;
175
- protected initFromPersisted(): void;
176
- protected translateSearchAndRefreshList(naturalSearchSelections: NaturalSearchSelections, ignoreEmptyFilter?: boolean): void;
177
- /**
178
- * Return current url excluding last route parameters;
179
- */
180
- protected getStorageKey(): string;
181
- protected bulkdDeleteConfirmation(): Observable<boolean | undefined>;
182
- /**
183
- * Delete multiple items at once
184
- */
185
- protected bulkDelete(): Observable<void>;
186
- private applyForcedVariables;
187
- selectColumns(columns: string[]): void;
188
- static ɵfac: i0.ɵɵFactoryDeclaration<NaturalAbstractList<any, any>, never>;
189
- static ɵdir: i0.ɵɵDirectiveDeclaration<NaturalAbstractList<any, any>, never, never, { "persistSearch": { "alias": "persistSearch"; "required": false; }; "availableColumns": { "alias": "availableColumns"; "required": false; }; "selectedColumns": { "alias": "selectedColumns"; "required": false; }; "forcedVariables": { "alias": "forcedVariables"; "required": false; }; }, {}, never, never, true, never>;
190
- }
191
- export {};
@@ -1,54 +0,0 @@
1
- import { OnInit } from '@angular/core';
2
- import { NavigationExtras, RouterLink } from '@angular/router';
3
- import { NaturalSearchSelections } from '../modules/search/types/values';
4
- import { NaturalAbstractModelService } from '../services/abstract-model.service';
5
- import { NaturalAbstractList } from './abstract-list';
6
- import { PaginatedData } from './data-source';
7
- import { QueryVariables } from './query-variable-manager';
8
- import { ExtractTall, ExtractTallOne, Literal } from '../types/types';
9
- import { Observable } from 'rxjs';
10
- import * as i0 from "@angular/core";
11
- type BreadcrumbItem = {
12
- id: string;
13
- name: string;
14
- } & Literal;
15
- export type NavigableItem<T> = {
16
- item: T;
17
- hasNavigation: boolean;
18
- };
19
- /**
20
- * This class helps managing a list of paginated items that can be filtered,
21
- * selected, and then bulk actions can be performed on selection.
22
- *
23
- * @dynamic
24
- */
25
- export declare class NaturalAbstractNavigableList<TService extends NaturalAbstractModelService<any, any, PaginatedData<{
26
- id: string;
27
- }>, QueryVariables, any, any, any, any, any, any>> extends NaturalAbstractList<TService, PaginatedData<NavigableItem<ExtractTall<TService>['items'][0]>>> implements OnInit {
28
- /**
29
- * Name of filter for child items to access ancestor item
30
- */
31
- ancestorRelationName: string;
32
- private oldAncertorId;
33
- breadcrumbs: BreadcrumbItem[];
34
- constructor(service: TService);
35
- ngOnInit(): void;
36
- protected getDataObservable(): Observable<PaginatedData<NavigableItem<ExtractTallOne<TService>>>>;
37
- protected translateSearchAndRefreshList(naturalSearchSelections: NaturalSearchSelections): void;
38
- clearSearch(resetPagination?: boolean): void;
39
- search(naturalSearchSelections: NaturalSearchSelections, navigationExtras?: NavigationExtras, resetPagination?: boolean): void;
40
- /**
41
- * Return an array for router link usage
42
- */
43
- getChildLink(ancestor: {
44
- id: string;
45
- } | null): RouterLink['routerLink'];
46
- /**
47
- * Depth is limited by queries
48
- * @param item with an ancestor relation (must match ancestorRelationName attribute)
49
- */
50
- protected getBreadcrumb(item: BreadcrumbItem): BreadcrumbItem[];
51
- static ɵfac: i0.ɵɵFactoryDeclaration<NaturalAbstractNavigableList<any>, never>;
52
- static ɵdir: i0.ɵɵDirectiveDeclaration<NaturalAbstractNavigableList<any>, never, never, { "ancestorRelationName": { "alias": "ancestorRelationName"; "required": false; }; }, {}, never, never, true, never>;
53
- }
54
- export {};
@@ -1,18 +0,0 @@
1
- import { ApolloLink, DocumentNode } from '@apollo/client/core';
2
- import { HttpBatchLink, HttpLink, Options } from 'apollo-angular/http';
3
- /**
4
- * Detect if the given variables have a file to be uploaded or not, and
5
- * also convert date to be serialized with their timezone.
6
- */
7
- export declare function hasFilesAndProcessDate(variables: unknown): boolean;
8
- /**
9
- * Whether the given GraphQL document contains at least one mutation
10
- */
11
- export declare function isMutation(query: DocumentNode): boolean;
12
- export declare const naturalExtractFiles: NonNullable<Options['extractFiles']>;
13
- /**
14
- * Create an Apollo link that supports batched queries and file uploads.
15
- *
16
- * File uploads and mutations are never batched.
17
- */
18
- export declare function createHttpLink(httpLink: HttpLink, httpBatchLink: HttpBatchLink, options: Options): ApolloLink;
@@ -1,8 +0,0 @@
1
- /**
2
- * Thin wrapper around browsers' native SubtleCrypto for convenience of use
3
- */
4
- export declare function sha256(message: string): Promise<string>;
5
- /**
6
- * Thin wrapper around browsers' native SubtleCrypto for convenience of use
7
- */
8
- export declare function hmacSha256(secret: string, payload: string): Promise<string>;
@@ -1,27 +0,0 @@
1
- import { Literal } from '../types/types';
2
- /**
3
- * Cumulate all changes made to an object over time
4
- */
5
- export declare class CumulativeChanges<T extends Literal> {
6
- private original;
7
- private diff;
8
- /**
9
- * Initialize the original values, should be called exactly one time per instance
10
- */
11
- initialize(originalValues: Readonly<T>): void;
12
- /**
13
- * Returns a literal that contains only the keys whose values have been changed by this call or any previous calls.
14
- *
15
- * Eg:
16
- *
17
- * ```ts
18
- * changes.initialize({a: 1, b: 2});
19
- * changes.differences({a: 1, b: 3}); // => {b: 3}
20
- * ```
21
- */
22
- differences(newValues: Readonly<T>): Partial<T> | null;
23
- /**
24
- * Commit the given new values, so they are not treated as differences anymore.
25
- */
26
- commit(newValues: Readonly<T>): void;
27
- }
@@ -1,32 +0,0 @@
1
- import { DataSource } from '@angular/cdk/collections';
2
- import { Observable } from 'rxjs';
3
- import { Literal } from '../types/types';
4
- export type PaginatedData<T> = {
5
- readonly items: readonly T[];
6
- readonly offset?: number | null;
7
- readonly pageSize: number;
8
- readonly pageIndex: number;
9
- readonly length: number;
10
- };
11
- /**
12
- * A NaturalDataSource will connect immediately, in order to know as soon as possible if
13
- * we need to show a template at all (as seen in my-ichtus)
14
- *
15
- * It also allow some extra data manipulation
16
- */
17
- export declare class NaturalDataSource<T extends PaginatedData<Literal> = PaginatedData<Literal>> extends DataSource<T['items'][0]> {
18
- private readonly ngUnsubscribe;
19
- private readonly internalData;
20
- constructor(value: Observable<T> | T);
21
- get internalDataObservable(): Observable<T | null>;
22
- /**
23
- * Array of data that should be rendered by the table, where each object represents one row.
24
- */
25
- get data(): T | null;
26
- set data(data: T | null);
27
- connect(): Observable<T['items']>;
28
- disconnect(): void;
29
- push(item: T['items'][0]): void;
30
- pop(): T['items'][0] | undefined;
31
- remove(item: T['items'][0]): void;
32
- }
@@ -1,54 +0,0 @@
1
- import { GraphQLFormattedError } from 'graphql';
2
- import { HttpInterceptorFn } from '@angular/common/http';
3
- import * as i0 from "@angular/core";
4
- type ProgressBar = {
5
- start: () => void;
6
- complete: () => void;
7
- };
8
- /**
9
- * Intercept HTTP request from Angular to show them as activity
10
- */
11
- export declare const activityInterceptor: HttpInterceptorFn;
12
- /**
13
- * Singleton to track pending XHR and XHR errors in the whole application.
14
- *
15
- * You must:
16
- *
17
- * - start the tracking by calling `setProgressRef()`
18
- * - provide the HTTP interceptor `activityInterceptor`
19
- *
20
- * The tracking will be entirely disabled for SSR.
21
- */
22
- export declare class NetworkActivityService {
23
- private progress;
24
- private readonly isBrowser;
25
- /**
26
- * Count pending requests
27
- */
28
- private pending;
29
- private readonly writableErrors;
30
- /**
31
- * GraphQL errors that happened recently
32
- */
33
- readonly errors: import("@angular/core").Signal<GraphQLFormattedError[]>;
34
- setProgressRef(progressBar: ProgressBar): void;
35
- /**
36
- * Notify an XHR started
37
- */
38
- increase(): void;
39
- /**
40
- * Notify an XHR ended (even if unsuccessful)
41
- */
42
- decrease(): void;
43
- /**
44
- * Add new GraphQL errors
45
- */
46
- addErrors(errors: readonly GraphQLFormattedError[]): void;
47
- /**
48
- * Clear all GraphQL errors
49
- */
50
- clearErrors(): void;
51
- static ɵfac: i0.ɵɵFactoryDeclaration<NetworkActivityService, never>;
52
- static ɵprov: i0.ɵɵInjectableDeclaration<NetworkActivityService>;
53
- }
54
- export {};
@@ -1,5 +0,0 @@
1
- import { ApplicationConfig } from '@angular/core';
2
- /**
3
- * Minimal, global providers for Natural to work
4
- */
5
- export declare const naturalProviders: ApplicationConfig['providers'];
@@ -1,2 +0,0 @@
1
- import { Literal } from '../types/types';
2
- export declare function hasMixedGroupLogic(groups: Literal[]): boolean;
@@ -1,91 +0,0 @@
1
- import { BehaviorSubject } from 'rxjs';
2
- export type QueryVariables = {
3
- filter?: any | null;
4
- pagination?: PaginationInput | null;
5
- sorting?: Sorting[] | null;
6
- };
7
- export type PaginationInput = {
8
- offset?: number | null;
9
- pageIndex?: number | null;
10
- pageSize?: number | null;
11
- };
12
- export type Sorting = {
13
- field: any;
14
- order?: SortingOrder | null;
15
- nullAsHighest?: boolean | null;
16
- emptyStringAsHighest?: boolean | null;
17
- };
18
- export declare enum SortingOrder {
19
- ASC = "ASC",
20
- DESC = "DESC"
21
- }
22
- /**
23
- * Filter manager stores a set of channels that contain a variable object and exposes an observable "variables" that updates with the result
24
- * of all channels merged together.
25
- *
26
- * A channel is supposed to be used by a given aspect of the GUI (pagination, sorting, search, others ?).
27
- *
28
- * ```ts
29
- * const fm = new QueryVariablesManager();
30
- * fm.merge('componentA-variables', {a : [1, 2, 3]});
31
- * ```
32
- *
33
- * Variables attributes is a BehaviorSubject. That mean it's not mandatory to subscribe, we can just call getValue or value attributes on
34
- * it :
35
- *
36
- * ```ts
37
- * console.log(fm.variables.value); // {a : [1, 2, 3]}
38
- * ```
39
- *
40
- * Set new variables for 'componentA-variables':
41
- *
42
- * ```ts
43
- * fm.merge('componentA-variables', {a : [1, 2]});
44
- * console.log(fm.variables.value); // {a : [1, 2, 3]}
45
- * ```
46
- *
47
- * Set new variables for new channel:
48
- *
49
- * ```ts
50
- * fm.merge('componentB-variables', {a : [3, 4]});
51
- * console.log(fm.variables.value); // {a : [1, 2, 3, 4]}
52
- * ```
53
- */
54
- export declare class NaturalQueryVariablesManager<T extends QueryVariables = QueryVariables> {
55
- readonly variables: BehaviorSubject<T | undefined>;
56
- private readonly channels;
57
- constructor(queryVariablesManager?: NaturalQueryVariablesManager<T>);
58
- /**
59
- * Set or override all the variables that may exist in the given channel
60
- */
61
- set(channelName: string, variables: Partial<T> | null | undefined): void;
62
- /**
63
- * Return a deep clone of the variables for the given channel name.
64
- *
65
- * Avoid returning the same reference to prevent an attribute change, then another channel update that would
66
- * used this changed attribute without having explicitly asked QueryVariablesManager to update it.
67
- */
68
- get(channelName: string): Partial<T> | undefined;
69
- /**
70
- * Merge variable into a channel, overriding arrays in same channel / key
71
- */
72
- merge(channelName: string, newVariables: Partial<T>): void;
73
- /**
74
- * Apply default values to a channel
75
- * Note : lodash defaults only defines values on destinations keys that are undefined
76
- */
77
- defaults(channelName: string, newVariables: Partial<T>): void;
78
- private getChannelsCopy;
79
- /**
80
- * Merge channels in a single object
81
- * Arrays are concatenated
82
- * Filter groups are combined smartly (see mergeGroupList)
83
- */
84
- private updateVariables;
85
- /**
86
- * Cross merge two filters
87
- * Only accepts groups with same groupLogic (ignores the first one, because there is no groupLogic in this one)
88
- * @throws In case two non-empty lists of groups are given and at one of them mix groupLogic value, throws an error
89
- */
90
- private mergeGroupList;
91
- }
@@ -1,42 +0,0 @@
1
- import { MonoTypeOperatorFunction, Observable } from 'rxjs';
2
- import { DestroyRef } from '@angular/core';
3
- /**
4
- * Behave like setTimeout(), but with a mandatory cancel mechanism.
5
- *
6
- * This is typically useful to replace setTimeout() in components where the callback
7
- * would crash if executed after the component destruction. That can easily happen
8
- * when the user navigates quickly between pages.
9
- *
10
- * Typical usage in a component would be:
11
- *
12
- * ```ts
13
- * cancellableTimeout(inject(DestroyRef)).subscribe(myCallback);
14
- * ```
15
- *
16
- * or
17
- *
18
- * ```ts
19
- * cancellableTimeout(this.ngUnsubscribe).subscribe(myCallback);
20
- * ```
21
- *
22
- * Instead of the more error-prone:
23
- *
24
- * ```ts
25
- * public foo(): void {
26
- * this.timeout = setTimeout(myCallBack);
27
- * }
28
- *
29
- * public ngOnDestroy(): void {
30
- * if (this.timeout) {
31
- * clearTimeout(this.timeout);
32
- * this.timeout = null;
33
- * }
34
- * }
35
- * ```
36
- */
37
- export declare function cancellableTimeout(canceller: Observable<unknown> | DestroyRef, milliSeconds?: number): Observable<void>;
38
- /**
39
- * For debugging purpose only, will dump in console everything that happen to
40
- * the observable
41
- */
42
- export declare function debug<T>(debugName: string): MonoTypeOperatorFunction<T>;
@@ -1,7 +0,0 @@
1
- import { HttpInterceptorFn } from '@angular/common/http';
2
- /**
3
- * Sign all HTTP POST requests that are GraphQL queries against `/graphql` endpoint with a custom signature.
4
- *
5
- * The server will validate the signature before executing the GraphQL query.
6
- */
7
- export declare function graphqlQuerySigner(key: string): HttpInterceptorFn;
@@ -1,10 +0,0 @@
1
- /**
2
- * Array of valid top-level-domains
3
- * IanaVersion 2020033100
4
- *
5
- * This should ideally be kept in sync with \Laminas\Validator\Hostname
6
- *
7
- * See ftp://data.iana.org/TLD/tlds-alpha-by-domain.txt List of all TLDs by domain
8
- * See http://www.iana.org/domains/root/db/ Official list of supported TLDs
9
- */
10
- export declare const validTlds: readonly string[];
@@ -1,85 +0,0 @@
1
- import { NavigationEnd, Router } from '@angular/router';
2
- import { Observable } from 'rxjs';
3
- import type { ReadonlyDeep } from 'type-fest';
4
- import { Literal } from '../types/types';
5
- import { PaginationInput, Sorting } from './query-variable-manager';
6
- /**
7
- * Very basic formatting to get only date, without time and ignoring entirely the timezone
8
- *
9
- * So something like: "2021-09-23"
10
- */
11
- export declare function formatIsoDate(date: null): null;
12
- export declare function formatIsoDate(date: Date): string;
13
- export declare function formatIsoDate(date: Date | null): string | null;
14
- /**
15
- * Format a date and time in a way that will preserve the local time zone.
16
- * This allows the server side to know the day (without time) that was selected on client side.
17
- *
18
- * So something like: "2021-09-23T17:57:16+09:00"
19
- */
20
- export declare function formatIsoDateTime(date: Date): string;
21
- /**
22
- * Relations to full objects are converted to their IDs only.
23
- *
24
- * So {user: {id: 123}} becomes {user: 123}
25
- */
26
- export declare function relationsToIds(object: Literal): Literal;
27
- /**
28
- * Returns the plural form of the given name
29
- *
30
- * This is **not** necessarily valid english grammar. Its only purpose is for internal usage, not for humans.
31
- *
32
- * This **MUST** be kept in sync with `\Ecodev\Felix\Api\Plural:make()`.
33
- *
34
- * This is a bit performance-sensitive, so we should keep it fast and only cover cases that we actually need.
35
- */
36
- export declare function makePlural(name: string): string;
37
- /**
38
- * Returns the string with the first letter as capital
39
- */
40
- export declare function upperCaseFirstLetter(term: string): string;
41
- /**
42
- * Replace all attributes of first object with the ones provided by the second, but keeps the reference
43
- */
44
- export declare function replaceObjectKeepingReference(obj: Literal | null, newObj: Literal | null): void;
45
- /**
46
- * Get contrasted color for text in the slider thumb
47
- * @param hexBgColor string in hexadecimals representing the background color
48
- */
49
- export declare function getForegroundColor(hexBgColor: string): 'black' | 'white';
50
- /**
51
- * Convert RGB color to hexadecimal color
52
- *
53
- * ```ts
54
- * rgbToHex('rgb(255, 00, 255)'); // '#FF00FF'
55
- * ```
56
- */
57
- export declare function rgbToHex(rgb: string): string;
58
- /**
59
- * Deep clone given values except for `File` that will be referencing the original value
60
- */
61
- export declare function cloneDeepButSkipFile<T>(value: T): T;
62
- export declare function isFile(value: unknown): boolean;
63
- /**
64
- * During lodash.mergeWith, overrides arrays
65
- */
66
- export declare function mergeOverrideArray(destValue: unknown, source: unknown): unknown;
67
- /**
68
- * Copy text to clipboard.
69
- * Accepts line breaks `\n` as textarea do.
70
- */
71
- export declare function copyToClipboard(document: Document, text: string): void;
72
- export declare function deepFreeze<T extends Literal>(o: T): ReadonlyDeep<T>;
73
- /**
74
- * Return a valid PaginationInput from whatever is available from data. Invalid properties/types will be dropped.
75
- */
76
- export declare function validatePagination(data: unknown): PaginationInput | null;
77
- /**
78
- * Return a valid Sortings from whatever is available from data. Invalid properties/types will be dropped.
79
- */
80
- export declare function validateSorting(data: unknown): Sorting[] | null;
81
- /**
82
- * Return valid columns from whatever is available from data. Invalid properties/types will be dropped.
83
- */
84
- export declare function validateColumns(data: unknown): string[] | null;
85
- export declare function onHistoryEvent(router: Router): Observable<NavigationEnd>;