@ecodev/natural 63.2.0 → 63.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.
@@ -1,52 +1,37 @@
1
- import { OnChanges, SimpleChanges } from '@angular/core';
1
+ import { Source } from '../sources/source';
2
2
  import * as i0 from "@angular/core";
3
- type Style = Partial<CSSStyleDeclaration>;
4
3
  /**
5
4
  * Show an avatar from different sources
6
5
  */
7
- export declare class NaturalAvatarComponent implements OnChanges {
6
+ export declare class NaturalAvatarComponent {
8
7
  private readonly avatarService;
9
- image?: string | null;
10
- initials?: string | null;
11
- gravatar?: string | null;
12
- size: number;
13
- decorated: boolean;
14
- textSizeRatio: number;
15
- bgColor: string | undefined;
16
- fgColor: string;
17
- borderRadius: string;
18
- textMaximumLength: number;
19
- avatarSrc: string | null;
20
- avatarText: string | null;
21
- avatarStyle: Style;
22
- hostStyle: Style;
23
- private currentIndex;
24
- private sources;
8
+ readonly image: import("@angular/core").InputSignal<string | null | undefined>;
9
+ readonly initials: import("@angular/core").InputSignal<string | null | undefined>;
10
+ readonly gravatar: import("@angular/core").InputSignal<string | null | undefined>;
11
+ readonly size: import("@angular/core").InputSignal<number>;
12
+ readonly decorated: import("@angular/core").InputSignal<boolean>;
13
+ readonly textSizeRatio: import("@angular/core").InputSignal<number>;
14
+ readonly bgColor: import("@angular/core").InputSignal<string | undefined>;
15
+ readonly fgColor: import("@angular/core").InputSignal<string>;
16
+ readonly borderRadius: import("@angular/core").InputSignal<string>;
17
+ readonly textMaximumLength: import("@angular/core").InputSignal<number>;
18
+ private readonly sources;
19
+ protected readonly currentSource: import("@angular/core").Signal<Source | undefined>;
20
+ protected readonly imageAvatar: import("@angular/core").Signal<Promise<string> | undefined>;
21
+ protected readonly textAvatar: import("@angular/core").Signal<Promise<string> | undefined>;
25
22
  /**
26
- * Detect inputs change
27
- */
28
- ngOnChanges(changes: SimpleChanges): void;
29
- /**
30
- * Fetch avatar source
23
+ * Try to use the next available avatar source that has not already failed in the past
31
24
  */
32
25
  tryNextSource(): void;
33
- private findNextSource;
34
- /**
35
- * Initialize the avatar component and its fallback system
36
- */
37
- private initializeAvatar;
38
- private clearAvatar;
39
- private buildTextAvatar;
40
- private buildImageAvatar;
26
+ private findNextNonFailingIndex;
41
27
  /**
42
28
  * Returns initials style
43
29
  */
44
- private getTextualStyle;
30
+ protected readonly textualStyle: import("@angular/core").Signal<Partial<CSSStyleDeclaration>>;
45
31
  /**
46
32
  * Returns image style
47
33
  */
48
- private getImageStyle;
34
+ protected readonly imageStyle: import("@angular/core").Signal<Partial<CSSStyleDeclaration>>;
49
35
  static ɵfac: i0.ɵɵFactoryDeclaration<NaturalAvatarComponent, never>;
50
- static ɵcmp: i0.ɵɵComponentDeclaration<NaturalAvatarComponent, "natural-avatar", never, { "image": { "alias": "image"; "required": false; }; "initials": { "alias": "initials"; "required": false; }; "gravatar": { "alias": "gravatar"; "required": false; }; "size": { "alias": "size"; "required": false; }; "decorated": { "alias": "decorated"; "required": false; }; "textSizeRatio": { "alias": "textSizeRatio"; "required": false; }; "bgColor": { "alias": "bgColor"; "required": false; }; "fgColor": { "alias": "fgColor"; "required": false; }; "borderRadius": { "alias": "borderRadius"; "required": false; }; "textMaximumLength": { "alias": "textMaximumLength"; "required": false; }; }, {}, never, never, true, never>;
36
+ static ɵcmp: i0.ɵɵComponentDeclaration<NaturalAvatarComponent, "natural-avatar", never, { "image": { "alias": "image"; "required": false; "isSignal": true; }; "initials": { "alias": "initials"; "required": false; "isSignal": true; }; "gravatar": { "alias": "gravatar"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "decorated": { "alias": "decorated"; "required": false; "isSignal": true; }; "textSizeRatio": { "alias": "textSizeRatio"; "required": false; "isSignal": true; }; "bgColor": { "alias": "bgColor"; "required": false; "isSignal": true; }; "fgColor": { "alias": "fgColor"; "required": false; "isSignal": true; }; "borderRadius": { "alias": "borderRadius"; "required": false; "isSignal": true; }; "textMaximumLength": { "alias": "textMaximumLength"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
51
37
  }
52
- export {};
@@ -1,6 +1,6 @@
1
1
  import { Source, SourceCreator } from '../sources/source';
2
- import { NaturalAvatarComponent } from '../component/avatar.component';
3
2
  import * as i0 from "@angular/core";
3
+ type SourceType = 'gravatar' | 'image' | 'initials';
4
4
  /**
5
5
  * Provides utilities methods related to Avatar component
6
6
  */
@@ -13,7 +13,7 @@ export declare class AvatarService {
13
13
  private readonly avatarColors;
14
14
  private readonly failedSources;
15
15
  getRandomColor(avatarText: string): string;
16
- getCreators(): IterableIterator<[keyof NaturalAvatarComponent, SourceCreator]>;
16
+ getCreators(): IterableIterator<[SourceType, SourceCreator]>;
17
17
  private getSourceKey;
18
18
  sourceHasFailedBefore(source: Source): boolean;
19
19
  markSourceAsFailed(source: Source): void;
@@ -21,3 +21,4 @@ export declare class AvatarService {
21
21
  static ɵfac: i0.ɵɵFactoryDeclaration<AvatarService, never>;
22
22
  static ɵprov: i0.ɵɵInjectableDeclaration<AvatarService>;
23
23
  }
24
+ export {};
@@ -34,7 +34,7 @@ export declare abstract class NaturalAbstractFile implements OnInit, OnDestroy,
34
34
  */
35
35
  multiple: boolean;
36
36
  /**
37
- * Comma-separated list of unique file type specifiers. Like the native element
37
+ * Comma-separated list of unique file type specifiers. Like the native element,
38
38
  * it can be a mix of mime-type and file extensions.
39
39
  *
40
40
  * See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept
@@ -58,7 +58,7 @@ export declare abstract class NaturalAbstractFile implements OnInit, OnDestroy,
58
58
  /**
59
59
  * If true, the file selection will be broadcast through `NaturalFileService.filesChanged`.
60
60
  *
61
- * It is useful to set this to false if there is two upload on a page with different purpose
61
+ * It is useful to set this to false if there are two uploads on a page with different purposes,
62
62
  * and the second upload should not be confused with the first one.
63
63
  */
64
64
  broadcast: boolean;
@@ -12,6 +12,11 @@ export declare class NaturalFileComponent implements OnInit, OnChanges {
12
12
  readonly fontSize: import("@angular/core").Signal<number>;
13
13
  action: 'upload' | 'download' | null;
14
14
  backgroundSize: string;
15
+ /**
16
+ * Overrides the default download link by passing a function that received the
17
+ * file object and returns the download link
18
+ */
19
+ private downloadLinkFn?;
15
20
  /**
16
21
  * Comma-separated list of unique file type specifiers. Like the native element,
17
22
  * it can be a mix of mime-type and file extensions.
@@ -54,5 +59,5 @@ export declare class NaturalFileComponent implements OnInit, OnChanges {
54
59
  private updateImage;
55
60
  private getBase64;
56
61
  static ɵfac: i0.ɵɵFactoryDeclaration<NaturalFileComponent, never>;
57
- static ɵcmp: i0.ɵɵComponentDeclaration<NaturalFileComponent, "natural-file", never, { "height": { "alias": "height"; "required": false; "isSignal": true; }; "action": { "alias": "action"; "required": false; }; "backgroundSize": { "alias": "backgroundSize"; "required": false; }; "accept": { "alias": "accept"; "required": false; }; "uploader": { "alias": "uploader"; "required": false; }; "model": { "alias": "model"; "required": false; }; "formCtrl": { "alias": "formCtrl"; "required": false; }; }, { "modelChange": "modelChange"; }, never, never, true, never>;
62
+ static ɵcmp: i0.ɵɵComponentDeclaration<NaturalFileComponent, "natural-file", never, { "height": { "alias": "height"; "required": false; "isSignal": true; }; "action": { "alias": "action"; "required": false; }; "backgroundSize": { "alias": "backgroundSize"; "required": false; }; "downloadLinkFn": { "alias": "downloadLinkFn"; "required": false; }; "accept": { "alias": "accept"; "required": false; }; "uploader": { "alias": "uploader"; "required": false; }; "model": { "alias": "model"; "required": false; }; "formCtrl": { "alias": "formCtrl"; "required": false; }; }, { "modelChange": "modelChange"; }, never, never, true, never>;
58
63
  }
@@ -59,14 +59,26 @@ export declare class NaturalPanelsService {
59
59
  */
60
60
  private isVertical;
61
61
  constructor();
62
+ /**
63
+ * Notify the service to start listening to route changes to open panels
64
+ *
65
+ * @internal
66
+ */
62
67
  start(route: ActivatedRoute): void;
63
68
  /**
64
69
  * Uses given configuration to add at the end of current url
65
70
  */
66
71
  private appendConfigToCurrentUrl;
72
+ /**
73
+ * Notify the service that all panels were closed
74
+ *
75
+ * @internal
76
+ */
67
77
  stop(): void;
68
78
  /**
69
79
  * Go to panel matching given component. Causes an url change.
80
+ *
81
+ * @internal
70
82
  */
71
83
  goToPanelByComponent(component: NaturalAbstractPanel): void;
72
84
  /**
@@ -96,6 +108,10 @@ export declare class NaturalPanelsService {
96
108
  * Return panel position (index) by searching matching component
97
109
  */
98
110
  private getPanelIndex;
111
+ /**
112
+ * Whether the given panel is currently the top, visible, panel. If there are no panels opened at all, then any panel given is considered top, visible, panel.
113
+ */
114
+ isTopPanel(component: NaturalAbstractPanel): boolean;
99
115
  /**
100
116
  * Repositions panels from start until given index
101
117
  */
@@ -1,5 +1,4 @@
1
- import { 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';
4
3
  import { Subject } from 'rxjs';
5
4
  import * as i0 from "@angular/core";
@@ -13,22 +12,21 @@ import * as i0 from "@angular/core";
13
12
  *
14
13
  * External URL will always be opened in new tab.
15
14
  */
16
- export declare class NaturalTableButtonComponent implements OnChanges {
17
- queryParams: Params;
18
- queryParamsHandling: QueryParamsHandling;
19
- label?: string | null;
20
- icon?: string | null;
21
- href?: string | null;
22
- navigate: RouterLink['routerLink'];
23
- fragment?: string | undefined;
24
- preserveFragment: boolean;
25
- disabled: boolean;
26
- raised: boolean;
27
- color: ThemePalette;
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>;
28
27
  protected readonly buttonClick$: Subject<MouseEvent>;
29
28
  readonly buttonClick: import("@angular/core").OutputRef<MouseEvent>;
30
- type: 'routerLink' | 'href' | 'click' | 'none';
31
- ngOnChanges(): void;
29
+ protected readonly type: import("@angular/core").Signal<"click" | "routerLink" | "none" | "href">;
32
30
  static ɵfac: i0.ɵɵFactoryDeclaration<NaturalTableButtonComponent, never>;
33
- 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>;
34
32
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecodev/natural",
3
- "version": "63.2.0",
3
+ "version": "63.3.0",
4
4
  "license": "MIT",
5
5
  "repository": "github:Ecodev/natural",
6
6
  "sideEffects": false,