@ecodev/natural 62.1.2 → 62.3.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 (188) hide show
  1. package/fesm2022/ecodev-natural-vanilla.mjs +1199 -0
  2. package/fesm2022/ecodev-natural-vanilla.mjs.map +1 -0
  3. package/fesm2022/ecodev-natural.mjs +625 -644
  4. package/fesm2022/ecodev-natural.mjs.map +1 -1
  5. package/lib/classes/abstract-editable-list.d.ts +3 -2
  6. package/lib/classes/network-activity.service.d.ts +54 -0
  7. package/lib/classes/validators.d.ts +1 -1
  8. package/lib/modules/avatar/component/avatar.component.d.ts +21 -36
  9. package/lib/modules/avatar/service/avatar.service.d.ts +3 -2
  10. package/lib/modules/columns-picker/columns-picker.component.d.ts +2 -2
  11. package/lib/modules/common/services/seo.provider.d.ts +2 -2
  12. package/lib/modules/dropdown-components/type-natural-select/type-natural-select.component.d.ts +1 -0
  13. package/lib/modules/dropdown-components/type-select/type-select.component.d.ts +1 -1
  14. package/lib/modules/file/abstract-file.d.ts +8 -5
  15. package/lib/modules/file/component/file.component.d.ts +9 -4
  16. package/lib/modules/file/file-drop.directive.d.ts +2 -3
  17. package/lib/modules/fixed-button-detail/fixed-button-detail.component.d.ts +2 -3
  18. package/lib/modules/hierarchic-selector/classes/model-node.d.ts +1 -1
  19. package/lib/modules/hierarchic-selector/hierarchic-selector/hierarchic-selector.component.d.ts +3 -3
  20. package/lib/modules/icon/icon.module.d.ts +2 -2
  21. package/lib/modules/panels/panels.service.d.ts +17 -2
  22. package/lib/modules/relations/relations.component.d.ts +4 -4
  23. package/lib/modules/search/dropdown-container/dropdown-container.component.d.ts +2 -3
  24. package/lib/modules/search/group/group.component.d.ts +2 -3
  25. package/lib/modules/search/input/input.component.d.ts +5 -5
  26. package/lib/modules/search/search/search.component.d.ts +5 -4
  27. package/lib/modules/select/abstract-select.component.d.ts +3 -3
  28. package/lib/modules/select/select/select.component.d.ts +4 -4
  29. package/lib/modules/sidenav/sidenav-container/sidenav-container.component.d.ts +1 -1
  30. package/lib/modules/table-button/table-button.component.d.ts +18 -18
  31. package/package.json +16 -14
  32. package/public-api.d.ts +1 -0
  33. package/src/lib/_natural.theme.scss +1 -2
  34. package/vanilla/index.d.ts +5 -0
  35. package/vanilla/package.json +3 -0
  36. package/vanilla/public-api.d.ts +11 -0
  37. package/vanilla/src/lib/classes/crypto.d.ts +8 -0
  38. package/vanilla/src/lib/classes/data-source.d.ts +32 -0
  39. package/vanilla/src/lib/classes/query-variable-manager-utils.d.ts +2 -0
  40. package/vanilla/src/lib/classes/query-variable-manager.d.ts +91 -0
  41. package/vanilla/src/lib/classes/signing.d.ts +7 -0
  42. package/vanilla/src/lib/classes/utility.d.ts +77 -0
  43. package/vanilla/src/lib/modules/search/classes/graphql-doctrine.types.d.ts +83 -0
  44. package/vanilla/src/lib/modules/search/classes/utils.d.ts +17 -0
  45. package/vanilla/src/lib/modules/search/types/dropdown-component.d.ts +20 -0
  46. package/vanilla/src/lib/modules/search/types/facet.d.ts +75 -0
  47. package/vanilla/src/lib/modules/search/types/values.d.ts +32 -0
  48. package/vanilla/src/lib/services/abstract-model.service.d.ts +244 -0
  49. package/vanilla/src/lib/services/debounce.service.d.ts +52 -0
  50. package/vanilla/src/lib/types/types.d.ts +100 -0
  51. package/esm2022/ecodev-natural.mjs +0 -5
  52. package/esm2022/lib/classes/abstract-detail.mjs +0 -229
  53. package/esm2022/lib/classes/abstract-editable-list.mjs +0 -99
  54. package/esm2022/lib/classes/abstract-list.mjs +0 -461
  55. package/esm2022/lib/classes/abstract-navigable-list.mjs +0 -133
  56. package/esm2022/lib/classes/apollo-utils.mjs +0 -59
  57. package/esm2022/lib/classes/crypto.mjs +0 -23
  58. package/esm2022/lib/classes/cumulative-changes.mjs +0 -50
  59. package/esm2022/lib/classes/data-source.mjs +0 -71
  60. package/esm2022/lib/classes/providers.mjs +0 -13
  61. package/esm2022/lib/classes/query-variable-manager-utils.mjs +0 -14
  62. package/esm2022/lib/classes/query-variable-manager.mjs +0 -172
  63. package/esm2022/lib/classes/rxjs.mjs +0 -54
  64. package/esm2022/lib/classes/signing.mjs +0 -38
  65. package/esm2022/lib/classes/tld.mjs +0 -1476
  66. package/esm2022/lib/classes/utility.mjs +0 -234
  67. package/esm2022/lib/classes/validators.mjs +0 -179
  68. package/esm2022/lib/directives/http-prefix.directive.mjs +0 -47
  69. package/esm2022/lib/modules/alert/alert.service.mjs +0 -53
  70. package/esm2022/lib/modules/alert/confirm.component.mjs +0 -16
  71. package/esm2022/lib/modules/alert/public-api.mjs +0 -6
  72. package/esm2022/lib/modules/avatar/component/avatar.component.mjs +0 -203
  73. package/esm2022/lib/modules/avatar/public-api.mjs +0 -6
  74. package/esm2022/lib/modules/avatar/service/avatar.service.mjs +0 -63
  75. package/esm2022/lib/modules/avatar/sources/gravatar.mjs +0 -29
  76. package/esm2022/lib/modules/avatar/sources/image.mjs +0 -13
  77. package/esm2022/lib/modules/avatar/sources/initials.mjs +0 -39
  78. package/esm2022/lib/modules/avatar/sources/source.mjs +0 -16
  79. package/esm2022/lib/modules/columns-picker/columns-picker.component.mjs +0 -145
  80. package/esm2022/lib/modules/columns-picker/public-api.mjs +0 -5
  81. package/esm2022/lib/modules/columns-picker/types.mjs +0 -2
  82. package/esm2022/lib/modules/common/directives/background-density.directive.mjs +0 -63
  83. package/esm2022/lib/modules/common/directives/linkable-tab.directive.mjs +0 -93
  84. package/esm2022/lib/modules/common/directives/src-density.directive.mjs +0 -72
  85. package/esm2022/lib/modules/common/pipes/capitalize.pipe.mjs +0 -24
  86. package/esm2022/lib/modules/common/pipes/ellipsis.pipe.mjs +0 -17
  87. package/esm2022/lib/modules/common/pipes/enum.pipe.mjs +0 -24
  88. package/esm2022/lib/modules/common/pipes/time-ago.pipe.mjs +0 -140
  89. package/esm2022/lib/modules/common/public-api.mjs +0 -14
  90. package/esm2022/lib/modules/common/services/memory-storage.mjs +0 -110
  91. package/esm2022/lib/modules/common/services/seo.provider.mjs +0 -23
  92. package/esm2022/lib/modules/common/services/seo.service.mjs +0 -235
  93. package/esm2022/lib/modules/detail-header/detail-header.component.mjs +0 -84
  94. package/esm2022/lib/modules/detail-header/public-api.mjs +0 -5
  95. package/esm2022/lib/modules/dialog-trigger/dialog-trigger.component.mjs +0 -72
  96. package/esm2022/lib/modules/dialog-trigger/public-api.mjs +0 -5
  97. package/esm2022/lib/modules/dropdown-components/abstract-association-select-component.directive.mjs +0 -100
  98. package/esm2022/lib/modules/dropdown-components/public-api.mjs +0 -14
  99. package/esm2022/lib/modules/dropdown-components/type-boolean/type-boolean.component.mjs +0 -39
  100. package/esm2022/lib/modules/dropdown-components/type-date/type-date.component.mjs +0 -173
  101. package/esm2022/lib/modules/dropdown-components/type-date-range/type-date-range.component.mjs +0 -134
  102. package/esm2022/lib/modules/dropdown-components/type-hierarchic-selector/type-hierarchic-selector.component.mjs +0 -80
  103. package/esm2022/lib/modules/dropdown-components/type-natural-select/type-natural-select.component.mjs +0 -48
  104. package/esm2022/lib/modules/dropdown-components/type-number/type-number.component.mjs +0 -110
  105. package/esm2022/lib/modules/dropdown-components/type-options/type-options.component.mjs +0 -64
  106. package/esm2022/lib/modules/dropdown-components/type-select/type-select.component.mjs +0 -175
  107. package/esm2022/lib/modules/dropdown-components/type-text/type-text.component.mjs +0 -62
  108. package/esm2022/lib/modules/dropdown-components/types.mjs +0 -41
  109. package/esm2022/lib/modules/dropdown-components/utils.mjs +0 -35
  110. package/esm2022/lib/modules/file/abstract-file.mjs +0 -230
  111. package/esm2022/lib/modules/file/component/file.component.mjs +0 -172
  112. package/esm2022/lib/modules/file/file-drop.directive.mjs +0 -111
  113. package/esm2022/lib/modules/file/file-select.directive.mjs +0 -26
  114. package/esm2022/lib/modules/file/file.service.mjs +0 -43
  115. package/esm2022/lib/modules/file/public-api.mjs +0 -9
  116. package/esm2022/lib/modules/file/types.mjs +0 -2
  117. package/esm2022/lib/modules/file/utils.mjs +0 -129
  118. package/esm2022/lib/modules/fixed-button/fixed-button.component.mjs +0 -30
  119. package/esm2022/lib/modules/fixed-button/public-api.mjs +0 -5
  120. package/esm2022/lib/modules/fixed-button-detail/fixed-button-detail.component.mjs +0 -56
  121. package/esm2022/lib/modules/fixed-button-detail/public-api.mjs +0 -5
  122. package/esm2022/lib/modules/hierarchic-selector/classes/flat-node.mjs +0 -18
  123. package/esm2022/lib/modules/hierarchic-selector/classes/hierarchic-configuration.mjs +0 -2
  124. package/esm2022/lib/modules/hierarchic-selector/classes/hierarchic-filters-configuration.mjs +0 -2
  125. package/esm2022/lib/modules/hierarchic-selector/classes/model-node.mjs +0 -14
  126. package/esm2022/lib/modules/hierarchic-selector/hierarchic-selector/hierarchic-selector.component.mjs +0 -398
  127. package/esm2022/lib/modules/hierarchic-selector/hierarchic-selector/hierarchic-selector.service.mjs +0 -243
  128. package/esm2022/lib/modules/hierarchic-selector/hierarchic-selector-dialog/hierarchic-selector-dialog.component.mjs +0 -38
  129. package/esm2022/lib/modules/hierarchic-selector/hierarchic-selector-dialog/hierarchic-selector-dialog.service.mjs +0 -22
  130. package/esm2022/lib/modules/hierarchic-selector/public-api.mjs +0 -10
  131. package/esm2022/lib/modules/icon/icon.directive.mjs +0 -96
  132. package/esm2022/lib/modules/icon/icon.module.mjs +0 -33
  133. package/esm2022/lib/modules/icon/public-api.mjs +0 -6
  134. package/esm2022/lib/modules/logger/error-handler.mjs +0 -87
  135. package/esm2022/lib/modules/logger/error.module.mjs +0 -22
  136. package/esm2022/lib/modules/logger/public-api.mjs +0 -6
  137. package/esm2022/lib/modules/matomo/matomo.service.mjs +0 -96
  138. package/esm2022/lib/modules/matomo/public-api.mjs +0 -5
  139. package/esm2022/lib/modules/panels/abstract-panel.mjs +0 -76
  140. package/esm2022/lib/modules/panels/fallback-if-no-opened-panels.urlmatcher.mjs +0 -12
  141. package/esm2022/lib/modules/panels/panels.component.mjs +0 -27
  142. package/esm2022/lib/modules/panels/panels.module.mjs +0 -10
  143. package/esm2022/lib/modules/panels/panels.service.mjs +0 -329
  144. package/esm2022/lib/modules/panels/panels.urlmatcher.mjs +0 -75
  145. package/esm2022/lib/modules/panels/public-api.mjs +0 -11
  146. package/esm2022/lib/modules/panels/types.mjs +0 -3
  147. package/esm2022/lib/modules/relations/public-api.mjs +0 -5
  148. package/esm2022/lib/modules/relations/relations.component.mjs +0 -254
  149. package/esm2022/lib/modules/search/classes/graphql-doctrine.mjs +0 -111
  150. package/esm2022/lib/modules/search/classes/graphql-doctrine.types.mjs +0 -14
  151. package/esm2022/lib/modules/search/classes/transformers.mjs +0 -142
  152. package/esm2022/lib/modules/search/classes/url.mjs +0 -53
  153. package/esm2022/lib/modules/search/classes/utils.mjs +0 -25
  154. package/esm2022/lib/modules/search/dropdown-container/dropdown-container-animations.mjs +0 -44
  155. package/esm2022/lib/modules/search/dropdown-container/dropdown-container.component.mjs +0 -87
  156. package/esm2022/lib/modules/search/dropdown-container/dropdown-ref.mjs +0 -24
  157. package/esm2022/lib/modules/search/dropdown-container/dropdown.service.mjs +0 -90
  158. package/esm2022/lib/modules/search/facet-selector/facet-selector.component.mjs +0 -45
  159. package/esm2022/lib/modules/search/group/group.component.mjs +0 -53
  160. package/esm2022/lib/modules/search/input/input.component.mjs +0 -365
  161. package/esm2022/lib/modules/search/public-api.mjs +0 -7
  162. package/esm2022/lib/modules/search/search/search.component.mjs +0 -102
  163. package/esm2022/lib/modules/search/types/dropdown-component.mjs +0 -2
  164. package/esm2022/lib/modules/search/types/facet.mjs +0 -2
  165. package/esm2022/lib/modules/search/types/values.mjs +0 -2
  166. package/esm2022/lib/modules/select/abstract-select.component.mjs +0 -232
  167. package/esm2022/lib/modules/select/public-api.mjs +0 -7
  168. package/esm2022/lib/modules/select/select/select.component.mjs +0 -310
  169. package/esm2022/lib/modules/select/select-enum/select-enum.component.mjs +0 -57
  170. package/esm2022/lib/modules/select/select-hierarchic/select-hierarchic.component.mjs +0 -155
  171. package/esm2022/lib/modules/sidenav/public-api.mjs +0 -9
  172. package/esm2022/lib/modules/sidenav/sidenav/sidenav.component.mjs +0 -15
  173. package/esm2022/lib/modules/sidenav/sidenav-container/sidenav-container.component.mjs +0 -90
  174. package/esm2022/lib/modules/sidenav/sidenav-content/sidenav-content.component.mjs +0 -11
  175. package/esm2022/lib/modules/sidenav/sidenav-stack.service.mjs +0 -50
  176. package/esm2022/lib/modules/sidenav/sidenav.service.mjs +0 -196
  177. package/esm2022/lib/modules/stamp/public-api.mjs +0 -5
  178. package/esm2022/lib/modules/stamp/stamp.component.mjs +0 -23
  179. package/esm2022/lib/modules/table-button/public-api.mjs +0 -5
  180. package/esm2022/lib/modules/table-button/table-button.component.mjs +0 -78
  181. package/esm2022/lib/services/abstract-model.service.mjs +0 -526
  182. package/esm2022/lib/services/debounce.service.mjs +0 -149
  183. package/esm2022/lib/services/enum.service.mjs +0 -64
  184. package/esm2022/lib/services/link-mutation.service.mjs +0 -154
  185. package/esm2022/lib/services/persistence.service.mjs +0 -115
  186. package/esm2022/lib/services/swiss-parsing-date-adapter.service.mjs +0 -63
  187. package/esm2022/lib/types/types.mjs +0 -2
  188. package/esm2022/public-api.mjs +0 -46
@@ -1,6 +1,6 @@
1
- import { EventEmitter, OnChanges } from '@angular/core';
2
- import { Params, QueryParamsHandling, RouterLink } from '@angular/router';
1
+ import { Params, QueryParamsHandling, UrlTree } from '@angular/router';
3
2
  import { ThemePalette } from '@angular/material/core';
3
+ import { Subject } from 'rxjs';
4
4
  import * as i0 from "@angular/core";
5
5
  /**
6
6
  * Button that fits well in a `<mat-table>` and support either
@@ -12,21 +12,21 @@ import * as i0 from "@angular/core";
12
12
  *
13
13
  * External URL will always be opened in new tab.
14
14
  */
15
- export declare class NaturalTableButtonComponent implements OnChanges {
16
- queryParams: Params;
17
- queryParamsHandling: QueryParamsHandling;
18
- label?: string | null;
19
- icon?: string | null;
20
- href?: string | null;
21
- navigate: RouterLink['routerLink'];
22
- fragment?: string | undefined;
23
- preserveFragment: boolean;
24
- disabled: boolean;
25
- raised: boolean;
26
- color: ThemePalette;
27
- readonly buttonClick: EventEmitter<MouseEvent>;
28
- type: 'routerLink' | 'href' | 'click' | 'none';
29
- ngOnChanges(): void;
15
+ export declare class NaturalTableButtonComponent {
16
+ readonly queryParams: import("@angular/core").InputSignal<Params>;
17
+ readonly queryParamsHandling: import("@angular/core").InputSignal<QueryParamsHandling>;
18
+ readonly label: import("@angular/core").InputSignal<string | null | undefined>;
19
+ readonly icon: import("@angular/core").InputSignal<string | null | undefined>;
20
+ readonly href: import("@angular/core").InputSignal<string | null | undefined>;
21
+ readonly navigate: import("@angular/core").InputSignal<string | any[] | UrlTree | null | undefined>;
22
+ readonly fragment: import("@angular/core").InputSignal<string | undefined>;
23
+ readonly preserveFragment: import("@angular/core").InputSignal<boolean>;
24
+ readonly disabled: import("@angular/core").InputSignal<boolean>;
25
+ readonly raised: import("@angular/core").InputSignal<boolean>;
26
+ readonly color: import("@angular/core").InputSignal<ThemePalette>;
27
+ protected readonly buttonClick$: Subject<MouseEvent>;
28
+ readonly buttonClick: import("@angular/core").OutputRef<MouseEvent>;
29
+ protected readonly type: import("@angular/core").Signal<"click" | "routerLink" | "none" | "href">;
30
30
  static ɵfac: i0.ɵɵFactoryDeclaration<NaturalTableButtonComponent, never>;
31
- static ɵcmp: i0.ɵɵComponentDeclaration<NaturalTableButtonComponent, "natural-table-button", never, { "queryParams": { "alias": "queryParams"; "required": false; }; "queryParamsHandling": { "alias": "queryParamsHandling"; "required": false; }; "label": { "alias": "label"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "href": { "alias": "href"; "required": false; }; "navigate": { "alias": "navigate"; "required": false; }; "fragment": { "alias": "fragment"; "required": false; }; "preserveFragment": { "alias": "preserveFragment"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "raised": { "alias": "raised"; "required": false; }; "color": { "alias": "color"; "required": false; }; }, { "buttonClick": "buttonClick"; }, never, never, true, never>;
31
+ static ɵcmp: i0.ɵɵComponentDeclaration<NaturalTableButtonComponent, "natural-table-button", never, { "queryParams": { "alias": "queryParams"; "required": false; "isSignal": true; }; "queryParamsHandling": { "alias": "queryParamsHandling"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "href": { "alias": "href"; "required": false; "isSignal": true; }; "navigate": { "alias": "navigate"; "required": false; "isSignal": true; }; "fragment": { "alias": "fragment"; "required": false; "isSignal": true; }; "preserveFragment": { "alias": "preserveFragment"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "raised": { "alias": "raised"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; }, { "buttonClick": "buttonClick"; }, never, never, true, never>;
32
32
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecodev/natural",
3
- "version": "62.1.2",
3
+ "version": "62.3.0",
4
4
  "license": "MIT",
5
5
  "repository": "github:Ecodev/natural",
6
6
  "sideEffects": false,
@@ -8,31 +8,33 @@
8
8
  ".": {
9
9
  "sass": "./theming/_natural.theme.scss",
10
10
  "types": "./index.d.ts",
11
- "esm2022": "./esm2022/ecodev-natural.mjs",
12
- "esm": "./esm2022/ecodev-natural.mjs",
13
11
  "default": "./fesm2022/ecodev-natural.mjs"
14
12
  },
15
13
  "./package.json": {
16
14
  "default": "./package.json"
15
+ },
16
+ "./vanilla": {
17
+ "types": "./vanilla/index.d.ts",
18
+ "default": "./fesm2022/ecodev-natural-vanilla.mjs"
17
19
  }
18
20
  },
19
21
  "dependencies": {
20
22
  "extract-files": "^13.0.0",
21
- "tslib": "^2.5.3"
23
+ "tslib": "^2.8.1"
22
24
  },
23
25
  "peerDependencies": {
24
- "@angular/animations": "^18.1.0",
25
- "@angular/cdk": "^18.1.0",
26
- "@angular/common": "^18.1.0",
27
- "@angular/core": "^18.1.0",
28
- "@angular/forms": "^18.1.0",
29
- "@angular/localize": "^18.1.0",
30
- "@angular/material": "^18.1.0",
31
- "@angular/platform-browser": "^18.1.0",
32
- "@angular/router": "^18.1.0",
26
+ "@angular/animations": "^19.2.0",
27
+ "@angular/cdk": "^19.2.0",
28
+ "@angular/common": "^19.2.0",
29
+ "@angular/core": "^19.2.0",
30
+ "@angular/forms": "^19.2.0",
31
+ "@angular/localize": "^19.2.0",
32
+ "@angular/material": "^19.2.0",
33
+ "@angular/platform-browser": "^19.2.0",
34
+ "@angular/router": "^19.2.0",
33
35
  "apollo-angular": "^10.0.0",
34
36
  "lodash-es": "^4.17.21",
35
- "rxjs": "^7.8.1"
37
+ "rxjs": "^7.8.2"
36
38
  },
37
39
  "module": "fesm2022/ecodev-natural.mjs",
38
40
  "typings": "index.d.ts"
package/public-api.d.ts CHANGED
@@ -8,6 +8,7 @@ export * from './lib/classes/query-variable-manager';
8
8
  export { cancellableTimeout, debug } from './lib/classes/rxjs';
9
9
  export * from './lib/classes/utility';
10
10
  export * from './lib/classes/validators';
11
+ export { NetworkActivityService, activityInterceptor } from './lib/classes/network-activity.service';
11
12
  export { validTlds } from './lib/classes/tld';
12
13
  export * from './lib/services/abstract-model.service';
13
14
  export { NaturalDebounceService } from './lib/services/debounce.service';
@@ -58,8 +58,7 @@ $defaultConfig: mat.m2-define-typography-config();
58
58
 
59
59
  // This is the default Material typography, but with button with normal letter-spacing instead of wider letter-spacing.
60
60
  $typography: mat.m2-define-typography-config(
61
- $button:
62
- mat.m2-define-typography-level(
61
+ $button: mat.m2-define-typography-level(
63
62
  $font-family: mat.m2-font-family($defaultConfig, 'button'),
64
63
  $font-weight: mat.m2-font-weight($defaultConfig, 'button'),
65
64
  $font-size: mat.m2-font-size($defaultConfig, 'button'),
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@ecodev/natural/vanilla" />
5
+ export * from './public-api';
@@ -0,0 +1,3 @@
1
+ {
2
+ "module": "../fesm2022/ecodev-natural-vanilla.mjs"
3
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * **DO NOT MODIFY UNLESS STRICTLY REQUIRED FOR VANILLA**
3
+ *
4
+ * This is a minimal service specialized for Vanilla and any modification,
5
+ * including adding `import` in this file, might break https://navigations.ichtus.club.
6
+ */
7
+ export { NaturalQueryVariablesManager } from './src/lib/classes/query-variable-manager';
8
+ export type { Literal } from './src/lib/types/types';
9
+ export { graphqlQuerySigner } from './src/lib/classes/signing';
10
+ export { formatIsoDateTime } from './src/lib/classes/utility';
11
+ export { NaturalAbstractModelService, type FormValidators } from './src/lib/services/abstract-model.service';
@@ -0,0 +1,8 @@
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>;
@@ -0,0 +1,32 @@
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
+ }
@@ -0,0 +1,2 @@
1
+ import { Literal } from '../types/types';
2
+ export declare function hasMixedGroupLogic(groups: Literal[]): boolean;
@@ -0,0 +1,91 @@
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
+ }
@@ -0,0 +1,7 @@
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;
@@ -0,0 +1,77 @@
1
+ import { Literal } from '../types/types';
2
+ import type { ReadonlyDeep } from 'type-fest';
3
+ import { PaginationInput, Sorting } from './query-variable-manager';
4
+ /**
5
+ * Very basic formatting to get only date, without time and ignoring entirely the timezone
6
+ *
7
+ * So something like: "2021-09-23"
8
+ */
9
+ export declare function formatIsoDate(date: null): null;
10
+ export declare function formatIsoDate(date: Date): string;
11
+ export declare function formatIsoDate(date: Date | null): string | null;
12
+ /**
13
+ * Format a date and time in a way that will preserve the local time zone.
14
+ * This allows the server side to know the day (without time) that was selected on client side.
15
+ *
16
+ * So something like: "2021-09-23T17:57:16+09:00"
17
+ */
18
+ export declare function formatIsoDateTime(date: Date): string;
19
+ /**
20
+ * Relations to full objects are converted to their IDs only.
21
+ *
22
+ * So {user: {id: 123}} becomes {user: 123}
23
+ */
24
+ export declare function relationsToIds(object: Literal): Literal;
25
+ /**
26
+ * Returns the plural form of the given name
27
+ *
28
+ * This is **not** necessarily valid english grammar. Its only purpose is for internal usage, not for humans.
29
+ *
30
+ * This **MUST** be kept in sync with `\Ecodev\Felix\Api\Plural:make()`.
31
+ *
32
+ * This is a bit performance-sensitive, so we should keep it fast and only cover cases that we actually need.
33
+ */
34
+ export declare function makePlural(name: string): string;
35
+ /**
36
+ * Returns the string with the first letter as capital
37
+ */
38
+ export declare function upperCaseFirstLetter(term: string): string;
39
+ /**
40
+ * Replace all attributes of first object with the ones provided by the second, but keeps the reference
41
+ */
42
+ export declare function replaceObjectKeepingReference(obj: Literal | null, newObj: Literal | null): void;
43
+ /**
44
+ * Get contrasted color for text in the slider thumb
45
+ * @param hexBgColor string in hexadecimals representing the background color
46
+ */
47
+ export declare function getForegroundColor(hexBgColor: string): 'black' | 'white';
48
+ /**
49
+ * Convert RGB color to hexadecimal color
50
+ *
51
+ * ```ts
52
+ * rgbToHex('rgb(255, 00, 255)'); // '#FF00FF'
53
+ * ```
54
+ */
55
+ export declare function rgbToHex(rgb: string): string;
56
+ /**
57
+ * During lodash.mergeWith, overrides arrays
58
+ */
59
+ export declare function mergeOverrideArray(destValue: unknown, source: unknown): unknown;
60
+ /**
61
+ * Copy text to clipboard.
62
+ * Accepts line breaks `\n` as textarea do.
63
+ */
64
+ export declare function copyToClipboard(document: Document, text: string): void;
65
+ export declare function deepFreeze<T extends Literal>(o: T): ReadonlyDeep<T>;
66
+ /**
67
+ * Return a valid PaginationInput from whatever is available from data. Invalid properties/types will be dropped.
68
+ */
69
+ export declare function validatePagination(data: unknown): PaginationInput | null;
70
+ /**
71
+ * Return a valid Sortings from whatever is available from data. Invalid properties/types will be dropped.
72
+ */
73
+ export declare function validateSorting(data: unknown): Sorting[] | null;
74
+ /**
75
+ * Return valid columns from whatever is available from data. Invalid properties/types will be dropped.
76
+ */
77
+ export declare function validateColumns(data: unknown): string[] | null;
@@ -0,0 +1,83 @@
1
+ import { Literal } from '../../../types/types';
2
+ export type Filter = {
3
+ groups?: FilterGroup[] | null;
4
+ };
5
+ export type FilterGroup = {
6
+ groupLogic?: LogicalOperator | null;
7
+ conditionsLogic?: LogicalOperator | null;
8
+ joins?: FilterGroupJoin | null;
9
+ conditions?: FilterGroupCondition[] | null;
10
+ };
11
+ export type FilterGroupJoin = Record<string, JoinOn>;
12
+ export type JoinOn = {
13
+ type?: JoinType | null;
14
+ joins?: FilterGroupJoin | null;
15
+ conditions?: FilterGroupCondition[] | null;
16
+ };
17
+ export declare enum LogicalOperator {
18
+ AND = "AND",
19
+ OR = "OR"
20
+ }
21
+ export declare enum JoinType {
22
+ innerJoin = "innerJoin",
23
+ leftJoin = "leftJoin"
24
+ }
25
+ export type FilterGroupCondition = Record<string, FilterGroupConditionField>;
26
+ export type FilterGroupConditionField = {
27
+ between?: BetweenOperator | null;
28
+ equal?: EqualOperator | null;
29
+ greater?: GreaterOperator | null;
30
+ greaterOrEqual?: GreaterOrEqualOperator | null;
31
+ in?: InOperator | null;
32
+ less?: LessOperator | null;
33
+ lessOrEqual?: LessOrEqualOperator | null;
34
+ like?: LikeOperator | null;
35
+ null?: NullOperator | null;
36
+ have?: HaveOperator | null;
37
+ empty?: EmptyOperator | null;
38
+ [key: string]: Literal | undefined | null;
39
+ };
40
+ export type Scalar = number | string | boolean;
41
+ export type HaveOperator = {
42
+ values: string[];
43
+ not?: boolean | null;
44
+ };
45
+ export type EmptyOperator = {
46
+ not?: boolean | null;
47
+ };
48
+ export type BetweenOperator = {
49
+ from: Scalar;
50
+ to: Scalar;
51
+ not?: boolean | null;
52
+ };
53
+ export type EqualOperator = {
54
+ value: Scalar;
55
+ not?: boolean | null;
56
+ };
57
+ export type GreaterOperator = {
58
+ value: Scalar;
59
+ not?: boolean | null;
60
+ };
61
+ export type GreaterOrEqualOperator = {
62
+ value: Scalar;
63
+ not?: boolean | null;
64
+ };
65
+ export type InOperator = {
66
+ values: Scalar[];
67
+ not?: boolean | null;
68
+ };
69
+ export type LessOperator = {
70
+ value: Scalar;
71
+ not?: boolean | null;
72
+ };
73
+ export type LessOrEqualOperator = {
74
+ value: Scalar;
75
+ not?: boolean | null;
76
+ };
77
+ export type LikeOperator = {
78
+ value: Scalar;
79
+ not?: boolean | null;
80
+ };
81
+ export type NullOperator = {
82
+ not?: boolean | null;
83
+ };
@@ -0,0 +1,17 @@
1
+ import { Facet, NaturalSearchFacets } from '../types/facet';
2
+ import { NaturalSearchSelection } from '../types/values';
3
+ /**
4
+ * Lookup a facet by its `name` and then by its `field`, or return null if not found
5
+ */
6
+ export declare function getFacetFromSelection(facets: NaturalSearchFacets | null, selection: NaturalSearchSelection): Facet | null;
7
+ /**
8
+ * Deep clone a literal via JSON serializing/unserializing
9
+ *
10
+ * It will **not** work with:
11
+ *
12
+ * - functions (will be removed)
13
+ * - `undefined` (will be removed)
14
+ * - cyclic references (will crash)
15
+ * - objects (will be converted to `{}`)
16
+ */
17
+ export declare function deepClone<T>(obj: T extends undefined ? never : T): T;
@@ -0,0 +1,20 @@
1
+ import { BehaviorSubject } from 'rxjs';
2
+ import { FilterGroupConditionField } from '../classes/graphql-doctrine.types';
3
+ export type DropdownComponent = {
4
+ /**
5
+ * Observable of current value as string
6
+ */
7
+ readonly renderedValue: BehaviorSubject<string>;
8
+ /**
9
+ * Get condition, including rich object types
10
+ */
11
+ getCondition(): FilterGroupConditionField;
12
+ /**
13
+ * Returns true if dropdown value is valid
14
+ */
15
+ isValid(): boolean;
16
+ /**
17
+ * Returns true if the dropdown value has change
18
+ */
19
+ isDirty(): boolean;
20
+ };
@@ -0,0 +1,75 @@
1
+ import { Type } from '@angular/core';
2
+ import { DropdownComponent } from './dropdown-component';
3
+ import { NaturalSearchSelection } from './values';
4
+ type BasicFacet = {
5
+ /**
6
+ * The label to be used in the GUI
7
+ */
8
+ display: string;
9
+ /**
10
+ * The field this facet should apply to.
11
+ *
12
+ * In most cases it should be the property name of the model. Something like:
13
+ *
14
+ * - name
15
+ * - description
16
+ * - artist.name
17
+ */
18
+ field: string;
19
+ /**
20
+ * This is required only if there are duplicated `field` in all facets.
21
+ *
22
+ * If `name` exists it will be used as an alternative identifier for facet, instead of `field`, to match
23
+ * a selection with its facet (in `getFacetFromSelection()`). So a selection must be given with the `name`,
24
+ * instead of `field`. And it will also be present in the URL. But it will never appear in the GraphQL selection.
25
+ *
26
+ * https://github.com/Ecodev/natural-search/issues/16
27
+ */
28
+ name?: string;
29
+ /**
30
+ * A function to transform the selection before it is applied onto the filter.
31
+ *
32
+ * This would typically be useful to do unit conversion so the GUI has some user
33
+ * friendly values, but the API works with a "low-level" unit.
34
+ */
35
+ transform?: (s: NaturalSearchSelection) => NaturalSearchSelection;
36
+ };
37
+ /**
38
+ * Facet that is only a flag (set or unset)
39
+ */
40
+ export type FlagFacet<Condition> = {
41
+ /**
42
+ * The value to be returned when the flag is set
43
+ */
44
+ condition: Condition;
45
+ /**
46
+ * If true the value is set when the flag does NOT exist and the
47
+ * value is unset when the flag exists.
48
+ *
49
+ * Defaults to `false`.
50
+ */
51
+ inversed?: boolean;
52
+ } & BasicFacet;
53
+ /**
54
+ * Facet that uses a component in a dropdown
55
+ */
56
+ export type DropdownFacet<C> = {
57
+ component: Type<DropdownComponent>;
58
+ /**
59
+ * Show a button into the dropdown container to validate value. Gives alternative to "click out" and incoming "tab/esc" key.
60
+ */
61
+ showValidateButton?: boolean;
62
+ /**
63
+ * Anything that could be useful for the dropdown component
64
+ */
65
+ configuration?: C;
66
+ } & BasicFacet;
67
+ /**
68
+ * A facet
69
+ */
70
+ export type Facet = DropdownFacet<any> | FlagFacet<any>;
71
+ /**
72
+ * Exhaustive list of facets
73
+ */
74
+ export type NaturalSearchFacets = Facet[];
75
+ export {};
@@ -0,0 +1,32 @@
1
+ import { FilterGroupConditionField } from '../classes/graphql-doctrine.types';
2
+ import { Facet } from './facet';
3
+ /**
4
+ * Type for a search selection
5
+ */
6
+ export type NaturalSearchSelection = {
7
+ field: string;
8
+ /**
9
+ * This is required if the facet also have a `name`.
10
+ *
11
+ * See BasicFacet.name
12
+ */
13
+ name?: string;
14
+ condition: FilterGroupConditionField;
15
+ };
16
+ /**
17
+ * Groups are a list of values, that should be interpreted with AND condition
18
+ */
19
+ export type GroupSelections = NaturalSearchSelection[];
20
+ /**
21
+ * List of groups, that should be interpreted with OR condition
22
+ * Final input / output format
23
+ */
24
+ export type NaturalSearchSelections = GroupSelections[];
25
+ /**
26
+ * Consolidated type for a selection and it's matching facet
27
+ * Used internally for dropdown
28
+ */
29
+ export type DropdownResult = {
30
+ condition: FilterGroupConditionField;
31
+ facet?: Facet;
32
+ };