ng-hub-ui-avatar 22.1.1 → 22.2.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.
- package/LICENSE +21 -0
- package/README.md +40 -0
- package/fesm2022/ng-hub-ui-avatar.mjs +96 -41
- package/fesm2022/ng-hub-ui-avatar.mjs.map +1 -1
- package/ng-hub-ui-avatar-22.2.0.tgz +0 -0
- package/package.json +2 -2
- package/types/ng-hub-ui-avatar.d.ts +27 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Carlos Morcillo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -79,6 +79,7 @@ Fallback uses a source priority order. By default, the component tries the suppo
|
|
|
79
79
|
## Features
|
|
80
80
|
|
|
81
81
|
- **Multiple Sources**: Gravatar, GitHub, Facebook, custom images, initials and plain text.
|
|
82
|
+
- **Projected Custom Content**: Drop any icon (FontAwesome, Material…), inline SVG, image or emoji inside `<hub-avatar>` and it is sized, centered and padded agnostically.
|
|
82
83
|
- **Automatic Fallback**: Configurable source priority order with graceful fallback when a source fails.
|
|
83
84
|
- **Initials Generation**: Builds initials avatars from a name with auto-generated background colors.
|
|
84
85
|
- **Async Remote Sources**: Resolves remote avatars (for example Gravatar) over HTTP with caching support.
|
|
@@ -173,6 +174,28 @@ export class ProfileComponent {}
|
|
|
173
174
|
></hub-avatar>
|
|
174
175
|
```
|
|
175
176
|
|
|
177
|
+
### Custom content (icons, SVG, images)
|
|
178
|
+
|
|
179
|
+
Project any content directly inside `<hub-avatar>` — an icon from any library, an inline `<svg>`, an `<img>` or even an emoji — and the avatar handles it agnostically: it centers the content, applies decent padding and clips it to the avatar shape (round or square). Font icons inherit a size and colour; inline SVG/images fill the avatar. Everything scales with `size`.
|
|
180
|
+
|
|
181
|
+
```html
|
|
182
|
+
<!-- FontAwesome (or any icon font) -->
|
|
183
|
+
<hub-avatar><i class="fa-solid fa-user"></i></hub-avatar>
|
|
184
|
+
|
|
185
|
+
<!-- Material Symbols -->
|
|
186
|
+
<hub-avatar size="72"><span class="material-symbols-outlined">rocket_launch</span></hub-avatar>
|
|
187
|
+
|
|
188
|
+
<!-- Inline SVG -->
|
|
189
|
+
<hub-avatar size="64">
|
|
190
|
+
<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 2 2 7l10 5 10-5-10-5Z" /></svg>
|
|
191
|
+
</hub-avatar>
|
|
192
|
+
|
|
193
|
+
<!-- Emoji -->
|
|
194
|
+
<hub-avatar>🚀</hub-avatar>
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
It activates automatically whenever content is projected and takes precedence over the image/initials sources. The circle uses the avatar's own background (`--hub-avatar-bg-color`, the design-system accent by default) with a white foreground, so it reads as a coloured circle out of the box. Theme it with the regular `bgColor` / `fgColor` / `borderColor` inputs, and tune the sizing with the `--hub-avatar-content-*` tokens (see [Styling](#styling)).
|
|
198
|
+
|
|
176
199
|
### Module configuration (`forRoot`)
|
|
177
200
|
|
|
178
201
|
`AvatarModule.forRoot()` allows overriding module-level behavior.
|
|
@@ -278,6 +301,23 @@ hub-avatar {
|
|
|
278
301
|
}
|
|
279
302
|
```
|
|
280
303
|
|
|
304
|
+
### Custom content
|
|
305
|
+
|
|
306
|
+
When you project content into `<hub-avatar>` (see [Custom content](#custom-content-icons-svg-images)), the **background is the avatar's own** (`--hub-avatar-bg-color`, the **accent colour by default**) and the icon uses the **avatar foreground** (`--hub-avatar-fg-color`, white) — so it reads as a coloured circle out of the box. Theme it with the regular `bgColor` / `fgColor` inputs (or `--hub-avatar-bg-color` / `--hub-avatar-fg-color`) just like any other avatar. Two extra tokens control the projected content's **sizing**, both relative to `--hub-avatar-size`:
|
|
307
|
+
|
|
308
|
+
| Token | Default | Description |
|
|
309
|
+
| -------------------------------- | ------------------------------------- | ------------------------------------------------------------------- |
|
|
310
|
+
| `--hub-avatar-content-padding` | `calc(var(--hub-avatar-size) * 0.2)` | Breathing room between the projected content and the avatar edge. |
|
|
311
|
+
| `--hub-avatar-content-icon-size` | `calc(var(--hub-avatar-size) * 0.55)` | Font size for icon fonts / emoji (inherited by the projected glyph). |
|
|
312
|
+
|
|
313
|
+
```scss
|
|
314
|
+
hub-avatar {
|
|
315
|
+
--hub-avatar-bg-color: #e7f1ff; // the avatar's own background — also the content circle
|
|
316
|
+
--hub-avatar-fg-color: #0d6efd; // icon colour (or set the `fgColor` input)
|
|
317
|
+
--hub-avatar-content-icon-size: calc(var(--hub-avatar-size) * 0.6);
|
|
318
|
+
}
|
|
319
|
+
```
|
|
320
|
+
|
|
281
321
|
### Presence status
|
|
282
322
|
|
|
283
323
|
Set the `status` input to render a small dot at the bottom-end corner. The dot scales with the avatar (the component exposes the live size on the host as `--hub-avatar-size`).
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, Optional, Inject, Injectable, input, output, SecurityContext, Component, NgModule } from '@angular/core';
|
|
2
|
+
import { InjectionToken, Optional, Inject, Injectable, input, output, SecurityContext, ViewChild, Component, NgModule } from '@angular/core';
|
|
3
3
|
import * as i3 from '@angular/platform-browser';
|
|
4
4
|
import { takeWhile, map } from 'rxjs/operators';
|
|
5
5
|
import * as i1 from '@angular/common/http';
|
|
@@ -416,6 +416,12 @@ class AvatarComponent {
|
|
|
416
416
|
status = input(null, /* @ts-ignore */
|
|
417
417
|
...(ngDevMode ? [{ debugName: "status" }] : /* istanbul ignore next */ []));
|
|
418
418
|
clickOnAvatar = output();
|
|
419
|
+
/** Wrapper around the projected content (`<ng-content>`), used to detect whether the consumer projected anything. */
|
|
420
|
+
customContentRef;
|
|
421
|
+
/** True when the consumer projected custom content (an icon, SVG, image, …) into the avatar. */
|
|
422
|
+
hasCustomContent = false;
|
|
423
|
+
/** Inline style applied to the projected-content slot (honours `bgColor` / `fgColor` / `borderColor` / `style`). */
|
|
424
|
+
customContentStyle = {};
|
|
419
425
|
isAlive = true;
|
|
420
426
|
avatarSrc = null;
|
|
421
427
|
avatarAlt = null;
|
|
@@ -432,6 +438,43 @@ class AvatarComponent {
|
|
|
432
438
|
onAvatarClicked() {
|
|
433
439
|
this.clickOnAvatar.emit(this.sources[this.currentIndex]);
|
|
434
440
|
}
|
|
441
|
+
/**
|
|
442
|
+
* Detects projected content once it is available and, when present, computes its style.
|
|
443
|
+
* Runs after content init so `<ng-content>` nodes are already in place.
|
|
444
|
+
*/
|
|
445
|
+
ngAfterContentInit() {
|
|
446
|
+
const host = this.customContentRef?.nativeElement;
|
|
447
|
+
this.hasCustomContent = !!host && this.hasMeaningfulProjectedContent(host);
|
|
448
|
+
if (this.hasCustomContent) {
|
|
449
|
+
this.customContentStyle = this.getCustomContentStyle();
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* Returns true when the projected slot holds a real element or non-whitespace text,
|
|
454
|
+
* so whitespace-only projection does not flip the avatar into custom-content mode.
|
|
455
|
+
*
|
|
456
|
+
* @param host The element wrapping the projected content.
|
|
457
|
+
*/
|
|
458
|
+
hasMeaningfulProjectedContent(host) {
|
|
459
|
+
return Array.from(host.childNodes).some((node) => node.nodeType === Node.ELEMENT_NODE ||
|
|
460
|
+
(node.nodeType === Node.TEXT_NODE && (node.textContent ?? '').trim().length > 0));
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* Builds the inline style for the projected-content slot. Sensible visible defaults
|
|
464
|
+
* (a themed background circle and a readable foreground colour) come from CSS tokens;
|
|
465
|
+
* the `bgColor` / `fgColor` / `borderColor` / `style` inputs override them when set.
|
|
466
|
+
*/
|
|
467
|
+
getCustomContentStyle() {
|
|
468
|
+
const borderColor = this.borderColor();
|
|
469
|
+
const bgColor = this.bgColor();
|
|
470
|
+
const hasCustomFgColor = this.fgColor() !== '#FFF';
|
|
471
|
+
return {
|
|
472
|
+
backgroundColor: bgColor ? bgColor : undefined,
|
|
473
|
+
color: hasCustomFgColor ? this.fgColor() : undefined,
|
|
474
|
+
border: borderColor ? '1px solid ' + borderColor : undefined,
|
|
475
|
+
...this.getCustomStyleObject()
|
|
476
|
+
};
|
|
477
|
+
}
|
|
435
478
|
/**
|
|
436
479
|
* The avatar size as a px string. Exposed on the host as `--hub-avatar-size`
|
|
437
480
|
* so the status dot (and any token-driven child) scales with the avatar.
|
|
@@ -467,6 +510,9 @@ class AvatarComponent {
|
|
|
467
510
|
}
|
|
468
511
|
// Reinitialize when any source input changes so fallback order is recalculated.
|
|
469
512
|
this.initializeAvatar();
|
|
513
|
+
if (this.hasCustomContent) {
|
|
514
|
+
this.customContentStyle = this.getCustomContentStyle();
|
|
515
|
+
}
|
|
470
516
|
}
|
|
471
517
|
/**
|
|
472
518
|
* Fetch avatar source
|
|
@@ -651,54 +697,60 @@ class AvatarComponent {
|
|
|
651
697
|
this.sources = this.sources.filter((source) => source.sourceType !== sourceType);
|
|
652
698
|
}
|
|
653
699
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: AvatarComponent, deps: [{ token: SourceFactory }, { token: AvatarService }, { token: i3.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
|
|
654
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.1", type: AvatarComponent, isStandalone: false, selector: "hub-avatar", inputs: { round: { classPropertyName: "round", publicName: "round", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, textSizeRatio: { classPropertyName: "textSizeRatio", publicName: "textSizeRatio", isSignal: true, isRequired: false, transformFunction: null }, bgColor: { classPropertyName: "bgColor", publicName: "bgColor", isSignal: true, isRequired: false, transformFunction: null }, fgColor: { classPropertyName: "fgColor", publicName: "fgColor", isSignal: true, isRequired: false, transformFunction: null }, borderColor: { classPropertyName: "borderColor", publicName: "borderColor", isSignal: true, isRequired: false, transformFunction: null }, style: { classPropertyName: "style", publicName: "style", isSignal: true, isRequired: false, transformFunction: null }, cornerRadius: { classPropertyName: "cornerRadius", publicName: "cornerRadius", isSignal: true, isRequired: false, transformFunction: null }, facebook: { classPropertyName: "facebook", publicName: "facebookId", isSignal: true, isRequired: false, transformFunction: null }, gravatar: { classPropertyName: "gravatar", publicName: "gravatarId", isSignal: true, isRequired: false, transformFunction: null }, github: { classPropertyName: "github", publicName: "githubId", isSignal: true, isRequired: false, transformFunction: null }, custom: { classPropertyName: "custom", publicName: "src", isSignal: true, isRequired: false, transformFunction: null }, customAlt: { classPropertyName: "customAlt", publicName: "alt", isSignal: true, isRequired: false, transformFunction: null }, initials: { classPropertyName: "initials", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, referrerpolicy: { classPropertyName: "referrerpolicy", publicName: "referrerpolicy", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, initialsSize: { classPropertyName: "initialsSize", publicName: "initialsSize", isSignal: true, isRequired: false, transformFunction: null }, status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clickOnAvatar: "clickOnAvatar" }, host: { properties: { "attr.data-status": "status() || null", "style.--hub-avatar-size": "avatarSizePx" } }, usesOnChanges: true, ngImport: i0, template: `
|
|
655
|
-
<div (click)="onAvatarClicked()" class="avatar-container" [style]="hostStyle">
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
700
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.1", type: AvatarComponent, isStandalone: false, selector: "hub-avatar", inputs: { round: { classPropertyName: "round", publicName: "round", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, textSizeRatio: { classPropertyName: "textSizeRatio", publicName: "textSizeRatio", isSignal: true, isRequired: false, transformFunction: null }, bgColor: { classPropertyName: "bgColor", publicName: "bgColor", isSignal: true, isRequired: false, transformFunction: null }, fgColor: { classPropertyName: "fgColor", publicName: "fgColor", isSignal: true, isRequired: false, transformFunction: null }, borderColor: { classPropertyName: "borderColor", publicName: "borderColor", isSignal: true, isRequired: false, transformFunction: null }, style: { classPropertyName: "style", publicName: "style", isSignal: true, isRequired: false, transformFunction: null }, cornerRadius: { classPropertyName: "cornerRadius", publicName: "cornerRadius", isSignal: true, isRequired: false, transformFunction: null }, facebook: { classPropertyName: "facebook", publicName: "facebookId", isSignal: true, isRequired: false, transformFunction: null }, gravatar: { classPropertyName: "gravatar", publicName: "gravatarId", isSignal: true, isRequired: false, transformFunction: null }, github: { classPropertyName: "github", publicName: "githubId", isSignal: true, isRequired: false, transformFunction: null }, custom: { classPropertyName: "custom", publicName: "src", isSignal: true, isRequired: false, transformFunction: null }, customAlt: { classPropertyName: "customAlt", publicName: "alt", isSignal: true, isRequired: false, transformFunction: null }, initials: { classPropertyName: "initials", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, referrerpolicy: { classPropertyName: "referrerpolicy", publicName: "referrerpolicy", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, initialsSize: { classPropertyName: "initialsSize", publicName: "initialsSize", isSignal: true, isRequired: false, transformFunction: null }, status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clickOnAvatar: "clickOnAvatar" }, host: { properties: { "attr.data-status": "status() || null", "style.--hub-avatar-size": "avatarSizePx" } }, viewQueries: [{ propertyName: "customContentRef", first: true, predicate: ["customContent"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: `
|
|
701
|
+
<div (click)="onAvatarClicked()" class="avatar-container" [class.hub-avatar--custom]="hasCustomContent" [style]="hostStyle">
|
|
702
|
+
<span #customContent class="hub-avatar__custom" [style]="customContentStyle"><ng-content></ng-content></span>
|
|
703
|
+
@if (!hasCustomContent) {
|
|
704
|
+
@if (avatarSrc) {
|
|
705
|
+
<img
|
|
706
|
+
[src]="avatarSrc"
|
|
707
|
+
[alt]="customAlt() ? customAlt() : avatarAlt"
|
|
708
|
+
[width]="size()"
|
|
709
|
+
[height]="size()"
|
|
710
|
+
[style]="avatarStyle"
|
|
711
|
+
[referrerPolicy]="referrerpolicy()"
|
|
712
|
+
(error)="fetchAvatarSource()"
|
|
713
|
+
class="avatar-content"
|
|
714
|
+
loading="lazy"
|
|
715
|
+
/>
|
|
716
|
+
} @else {
|
|
717
|
+
@if (avatarText) {
|
|
718
|
+
<div class="avatar-content" [style]="avatarStyle">
|
|
719
|
+
{{ avatarText }}
|
|
720
|
+
</div>
|
|
721
|
+
}
|
|
673
722
|
}
|
|
674
723
|
}
|
|
675
724
|
</div>
|
|
676
725
|
@if (status()) {
|
|
677
726
|
<span class="hub-avatar__status" aria-hidden="true"></span>
|
|
678
727
|
}
|
|
679
|
-
`, isInline: true, styles: [":root,:host{--hub-avatar-size: 50px;--hub-avatar-overflow: hidden;--hub-avatar-border-radius-round: 50%;--hub-avatar-border-radius-square: var(--hub-ref-radius-sm, .25rem);--hub-avatar-border-radius: var( --hub-avatar-border-radius-round, var(--hub-avatar-border-radius-square, .25rem) );--hub-avatar-border-width-default: var(--hub-ref-border-width, 1px);--hub-avatar-border-width: 0;--hub-avatar-border-color: transparent;--hub-avatar-fg-color: var(--hub-ref-color-white, #fff);--hub-avatar-bg-color: var(--hub-sys-
|
|
728
|
+
`, isInline: true, styles: [":root,:host{--hub-avatar-size: 50px;--hub-avatar-overflow: hidden;--hub-avatar-border-radius-round: 50%;--hub-avatar-border-radius-square: var(--hub-ref-radius-sm, .25rem);--hub-avatar-border-radius: var( --hub-avatar-border-radius-round, var(--hub-avatar-border-radius-square, .25rem) );--hub-avatar-border-width-default: var(--hub-ref-border-width, 1px);--hub-avatar-border-width: 0;--hub-avatar-border-color: transparent;--hub-avatar-fg-color: var(--hub-ref-color-white, #fff);--hub-avatar-bg-color: var(--hub-sys-color-primary, #0d6efd);--hub-avatar-font-family: var( --hub-ref-font-family-base, Helvetica, Arial, sans-serif );--hub-avatar-font-weight: var(--hub-ref-font-weight-base, 400);--hub-avatar-font-size: calc(var(--hub-avatar-size, 50px) / 3);--hub-avatar-line-height: var(--hub-avatar-size, 50px);--hub-avatar-text-transform: uppercase;--hub-avatar-text-align: center;--hub-avatar-object-fit: cover;--hub-avatar-content-padding: calc(var(--hub-avatar-size, 50px) * .2);--hub-avatar-content-icon-size: calc(var(--hub-avatar-size, 50px) * .55);--hub-avatar-status-size: calc(var(--hub-avatar-size, 50px) * .28);--hub-avatar-status-offset: 0px;--hub-avatar-status-ring-width: max(2px, calc(var(--hub-avatar-size, 50px) * .05));--hub-avatar-status-ring-color: var(--hub-sys-surface-page, #fff);--hub-avatar-status-color: var(--hub-sys-text-muted, #6c757d);--hub-avatar-group-overlap: calc(var(--hub-avatar-size, 50px) * .3);--hub-avatar-group-ring-width: max(2px, calc(var(--hub-avatar-size, 50px) * .04));--hub-avatar-group-ring-color: var(--hub-sys-surface-page, #fff)}:host{display:inline-block;position:relative;border-radius:var(--hub-avatar-border-radius, 50%)}.avatar-container{width:var(--hub-avatar-size, 50px);height:var(--hub-avatar-size, 50px);border-radius:var(--hub-avatar-border-radius, 50%);overflow:var(--hub-avatar-overflow, hidden)}.avatar-content{width:100%;height:100%;max-width:100%;box-sizing:border-box;border-radius:var(--hub-avatar-border-radius, 50%);border:var(--hub-avatar-border-width, 0) solid var(--hub-avatar-border-color, transparent);color:var(--hub-avatar-fg-color, var(--hub-ref-color-white, #fff));background-color:var(--hub-avatar-bg-color, var(--hub-sys-surface-page, #fff));font-family:var(--hub-avatar-font-family, Helvetica, Arial, sans-serif);font-size:var(--hub-avatar-font-size, calc(var(--hub-avatar-size, 50px) / 3));font-weight:var(--hub-avatar-font-weight, var(--hub-ref-font-weight-base, 400));line-height:var(--hub-avatar-line-height, var(--hub-avatar-size, 50px));text-transform:var(--hub-avatar-text-transform, uppercase);text-align:var(--hub-avatar-text-align, center)}div.avatar-content{display:flex;align-items:center;justify-content:center}img.avatar-content{display:block;object-fit:var(--hub-avatar-object-fit, cover);background-color:transparent}.hub-avatar__custom{display:none}.hub-avatar--custom .hub-avatar__custom{display:flex;align-items:center;justify-content:center;width:100%;height:100%;box-sizing:border-box;padding:var(--hub-avatar-content-padding, calc(var(--hub-avatar-size, 50px) * .2));border-radius:inherit;overflow:hidden;background-color:var(--hub-avatar-bg-color, var(--hub-sys-color-primary, #0d6efd));color:var(--hub-avatar-fg-color, var(--hub-ref-color-white, #fff));font-size:var(--hub-avatar-content-icon-size, calc(var(--hub-avatar-size, 50px) * .55));line-height:1}.hub-avatar--custom .hub-avatar__custom>*{line-height:1}.hub-avatar--custom .hub-avatar__custom ::ng-deep svg,.hub-avatar--custom .hub-avatar__custom ::ng-deep img{display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain}.hub-avatar__status{position:absolute;inset-block-end:var(--hub-avatar-status-offset, 0px);inset-inline-end:var(--hub-avatar-status-offset, 0px);width:var(--hub-avatar-status-size, calc(var(--hub-avatar-size, 50px) * .28));height:var(--hub-avatar-status-size, calc(var(--hub-avatar-size, 50px) * .28));box-sizing:border-box;border-radius:50%;background:var(--hub-avatar-status-color, var(--hub-sys-text-muted, #6c757d));box-shadow:0 0 0 var(--hub-avatar-status-ring-width, 2px) var(--hub-avatar-status-ring-color, var(--hub-sys-surface-page, #fff))}:host([data-status=online]){--hub-avatar-status-color: var(--hub-sys-color-success)}:host([data-status=away]){--hub-avatar-status-color: var(--hub-sys-color-warning)}:host([data-status=busy]){--hub-avatar-status-color: var(--hub-sys-color-danger)}:host([data-status=offline]){--hub-avatar-status-color: var(--hub-sys-text-muted, #6c757d)}.hub-avatar-group{display:inline-flex;align-items:center}.hub-avatar-group hub-avatar{box-shadow:0 0 0 var(--hub-avatar-group-ring-width, 2px) var(--hub-avatar-group-ring-color, var(--hub-sys-surface-page, #fff))}.hub-avatar-group hub-avatar+hub-avatar{margin-inline-start:calc(-1 * var(--hub-avatar-group-overlap, 15px))}\n"] });
|
|
680
729
|
}
|
|
681
730
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: AvatarComponent, decorators: [{
|
|
682
731
|
type: Component,
|
|
683
732
|
args: [{ selector: 'hub-avatar', standalone: false, template: `
|
|
684
|
-
<div (click)="onAvatarClicked()" class="avatar-container" [style]="hostStyle">
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
733
|
+
<div (click)="onAvatarClicked()" class="avatar-container" [class.hub-avatar--custom]="hasCustomContent" [style]="hostStyle">
|
|
734
|
+
<span #customContent class="hub-avatar__custom" [style]="customContentStyle"><ng-content></ng-content></span>
|
|
735
|
+
@if (!hasCustomContent) {
|
|
736
|
+
@if (avatarSrc) {
|
|
737
|
+
<img
|
|
738
|
+
[src]="avatarSrc"
|
|
739
|
+
[alt]="customAlt() ? customAlt() : avatarAlt"
|
|
740
|
+
[width]="size()"
|
|
741
|
+
[height]="size()"
|
|
742
|
+
[style]="avatarStyle"
|
|
743
|
+
[referrerPolicy]="referrerpolicy()"
|
|
744
|
+
(error)="fetchAvatarSource()"
|
|
745
|
+
class="avatar-content"
|
|
746
|
+
loading="lazy"
|
|
747
|
+
/>
|
|
748
|
+
} @else {
|
|
749
|
+
@if (avatarText) {
|
|
750
|
+
<div class="avatar-content" [style]="avatarStyle">
|
|
751
|
+
{{ avatarText }}
|
|
752
|
+
</div>
|
|
753
|
+
}
|
|
702
754
|
}
|
|
703
755
|
}
|
|
704
756
|
</div>
|
|
@@ -708,8 +760,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImpor
|
|
|
708
760
|
`, host: {
|
|
709
761
|
'[attr.data-status]': 'status() || null',
|
|
710
762
|
'[style.--hub-avatar-size]': 'avatarSizePx'
|
|
711
|
-
}, styles: [":root,:host{--hub-avatar-size: 50px;--hub-avatar-overflow: hidden;--hub-avatar-border-radius-round: 50%;--hub-avatar-border-radius-square: var(--hub-ref-radius-sm, .25rem);--hub-avatar-border-radius: var( --hub-avatar-border-radius-round, var(--hub-avatar-border-radius-square, .25rem) );--hub-avatar-border-width-default: var(--hub-ref-border-width, 1px);--hub-avatar-border-width: 0;--hub-avatar-border-color: transparent;--hub-avatar-fg-color: var(--hub-ref-color-white, #fff);--hub-avatar-bg-color: var(--hub-sys-
|
|
712
|
-
}], ctorParameters: () => [{ type: SourceFactory }, { type: AvatarService }, { type: i3.DomSanitizer }], propDecorators: { round: [{ type: i0.Input, args: [{ isSignal: true, alias: "round", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], textSizeRatio: [{ type: i0.Input, args: [{ isSignal: true, alias: "textSizeRatio", required: false }] }], bgColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "bgColor", required: false }] }], fgColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "fgColor", required: false }] }], borderColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "borderColor", required: false }] }], style: [{ type: i0.Input, args: [{ isSignal: true, alias: "style", required: false }] }], cornerRadius: [{ type: i0.Input, args: [{ isSignal: true, alias: "cornerRadius", required: false }] }], facebook: [{ type: i0.Input, args: [{ isSignal: true, alias: "facebookId", required: false }] }], gravatar: [{ type: i0.Input, args: [{ isSignal: true, alias: "gravatarId", required: false }] }], github: [{ type: i0.Input, args: [{ isSignal: true, alias: "githubId", required: false }] }], custom: [{ type: i0.Input, args: [{ isSignal: true, alias: "src", required: false }] }], customAlt: [{ type: i0.Input, args: [{ isSignal: true, alias: "alt", required: false }] }], initials: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], referrerpolicy: [{ type: i0.Input, args: [{ isSignal: true, alias: "referrerpolicy", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], initialsSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialsSize", required: false }] }], status: [{ type: i0.Input, args: [{ isSignal: true, alias: "status", required: false }] }], clickOnAvatar: [{ type: i0.Output, args: ["clickOnAvatar"] }]
|
|
763
|
+
}, styles: [":root,:host{--hub-avatar-size: 50px;--hub-avatar-overflow: hidden;--hub-avatar-border-radius-round: 50%;--hub-avatar-border-radius-square: var(--hub-ref-radius-sm, .25rem);--hub-avatar-border-radius: var( --hub-avatar-border-radius-round, var(--hub-avatar-border-radius-square, .25rem) );--hub-avatar-border-width-default: var(--hub-ref-border-width, 1px);--hub-avatar-border-width: 0;--hub-avatar-border-color: transparent;--hub-avatar-fg-color: var(--hub-ref-color-white, #fff);--hub-avatar-bg-color: var(--hub-sys-color-primary, #0d6efd);--hub-avatar-font-family: var( --hub-ref-font-family-base, Helvetica, Arial, sans-serif );--hub-avatar-font-weight: var(--hub-ref-font-weight-base, 400);--hub-avatar-font-size: calc(var(--hub-avatar-size, 50px) / 3);--hub-avatar-line-height: var(--hub-avatar-size, 50px);--hub-avatar-text-transform: uppercase;--hub-avatar-text-align: center;--hub-avatar-object-fit: cover;--hub-avatar-content-padding: calc(var(--hub-avatar-size, 50px) * .2);--hub-avatar-content-icon-size: calc(var(--hub-avatar-size, 50px) * .55);--hub-avatar-status-size: calc(var(--hub-avatar-size, 50px) * .28);--hub-avatar-status-offset: 0px;--hub-avatar-status-ring-width: max(2px, calc(var(--hub-avatar-size, 50px) * .05));--hub-avatar-status-ring-color: var(--hub-sys-surface-page, #fff);--hub-avatar-status-color: var(--hub-sys-text-muted, #6c757d);--hub-avatar-group-overlap: calc(var(--hub-avatar-size, 50px) * .3);--hub-avatar-group-ring-width: max(2px, calc(var(--hub-avatar-size, 50px) * .04));--hub-avatar-group-ring-color: var(--hub-sys-surface-page, #fff)}:host{display:inline-block;position:relative;border-radius:var(--hub-avatar-border-radius, 50%)}.avatar-container{width:var(--hub-avatar-size, 50px);height:var(--hub-avatar-size, 50px);border-radius:var(--hub-avatar-border-radius, 50%);overflow:var(--hub-avatar-overflow, hidden)}.avatar-content{width:100%;height:100%;max-width:100%;box-sizing:border-box;border-radius:var(--hub-avatar-border-radius, 50%);border:var(--hub-avatar-border-width, 0) solid var(--hub-avatar-border-color, transparent);color:var(--hub-avatar-fg-color, var(--hub-ref-color-white, #fff));background-color:var(--hub-avatar-bg-color, var(--hub-sys-surface-page, #fff));font-family:var(--hub-avatar-font-family, Helvetica, Arial, sans-serif);font-size:var(--hub-avatar-font-size, calc(var(--hub-avatar-size, 50px) / 3));font-weight:var(--hub-avatar-font-weight, var(--hub-ref-font-weight-base, 400));line-height:var(--hub-avatar-line-height, var(--hub-avatar-size, 50px));text-transform:var(--hub-avatar-text-transform, uppercase);text-align:var(--hub-avatar-text-align, center)}div.avatar-content{display:flex;align-items:center;justify-content:center}img.avatar-content{display:block;object-fit:var(--hub-avatar-object-fit, cover);background-color:transparent}.hub-avatar__custom{display:none}.hub-avatar--custom .hub-avatar__custom{display:flex;align-items:center;justify-content:center;width:100%;height:100%;box-sizing:border-box;padding:var(--hub-avatar-content-padding, calc(var(--hub-avatar-size, 50px) * .2));border-radius:inherit;overflow:hidden;background-color:var(--hub-avatar-bg-color, var(--hub-sys-color-primary, #0d6efd));color:var(--hub-avatar-fg-color, var(--hub-ref-color-white, #fff));font-size:var(--hub-avatar-content-icon-size, calc(var(--hub-avatar-size, 50px) * .55));line-height:1}.hub-avatar--custom .hub-avatar__custom>*{line-height:1}.hub-avatar--custom .hub-avatar__custom ::ng-deep svg,.hub-avatar--custom .hub-avatar__custom ::ng-deep img{display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain}.hub-avatar__status{position:absolute;inset-block-end:var(--hub-avatar-status-offset, 0px);inset-inline-end:var(--hub-avatar-status-offset, 0px);width:var(--hub-avatar-status-size, calc(var(--hub-avatar-size, 50px) * .28));height:var(--hub-avatar-status-size, calc(var(--hub-avatar-size, 50px) * .28));box-sizing:border-box;border-radius:50%;background:var(--hub-avatar-status-color, var(--hub-sys-text-muted, #6c757d));box-shadow:0 0 0 var(--hub-avatar-status-ring-width, 2px) var(--hub-avatar-status-ring-color, var(--hub-sys-surface-page, #fff))}:host([data-status=online]){--hub-avatar-status-color: var(--hub-sys-color-success)}:host([data-status=away]){--hub-avatar-status-color: var(--hub-sys-color-warning)}:host([data-status=busy]){--hub-avatar-status-color: var(--hub-sys-color-danger)}:host([data-status=offline]){--hub-avatar-status-color: var(--hub-sys-text-muted, #6c757d)}.hub-avatar-group{display:inline-flex;align-items:center}.hub-avatar-group hub-avatar{box-shadow:0 0 0 var(--hub-avatar-group-ring-width, 2px) var(--hub-avatar-group-ring-color, var(--hub-sys-surface-page, #fff))}.hub-avatar-group hub-avatar+hub-avatar{margin-inline-start:calc(-1 * var(--hub-avatar-group-overlap, 15px))}\n"] }]
|
|
764
|
+
}], ctorParameters: () => [{ type: SourceFactory }, { type: AvatarService }, { type: i3.DomSanitizer }], propDecorators: { round: [{ type: i0.Input, args: [{ isSignal: true, alias: "round", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], textSizeRatio: [{ type: i0.Input, args: [{ isSignal: true, alias: "textSizeRatio", required: false }] }], bgColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "bgColor", required: false }] }], fgColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "fgColor", required: false }] }], borderColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "borderColor", required: false }] }], style: [{ type: i0.Input, args: [{ isSignal: true, alias: "style", required: false }] }], cornerRadius: [{ type: i0.Input, args: [{ isSignal: true, alias: "cornerRadius", required: false }] }], facebook: [{ type: i0.Input, args: [{ isSignal: true, alias: "facebookId", required: false }] }], gravatar: [{ type: i0.Input, args: [{ isSignal: true, alias: "gravatarId", required: false }] }], github: [{ type: i0.Input, args: [{ isSignal: true, alias: "githubId", required: false }] }], custom: [{ type: i0.Input, args: [{ isSignal: true, alias: "src", required: false }] }], customAlt: [{ type: i0.Input, args: [{ isSignal: true, alias: "alt", required: false }] }], initials: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], referrerpolicy: [{ type: i0.Input, args: [{ isSignal: true, alias: "referrerpolicy", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], initialsSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialsSize", required: false }] }], status: [{ type: i0.Input, args: [{ isSignal: true, alias: "status", required: false }] }], clickOnAvatar: [{ type: i0.Output, args: ["clickOnAvatar"] }], customContentRef: [{
|
|
765
|
+
type: ViewChild,
|
|
766
|
+
args: ['customContent', { static: true }]
|
|
767
|
+
}] } });
|
|
713
768
|
|
|
714
769
|
class AvatarModule {
|
|
715
770
|
static forRoot(avatarConfig) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-hub-ui-avatar.mjs","sources":["../../../projects/avatar/src/lib/avatar-config.token.ts","../../../projects/avatar/src/lib/avatar-config.service.ts","../../../projects/avatar/src/lib/sources/avatar-source.enum.ts","../../../projects/avatar/src/lib/avatar.service.ts","../../../projects/avatar/src/lib/sources/async-source.ts","../../../projects/avatar/src/lib/sources/facebook.ts","../../../projects/avatar/src/lib/sources/custom.ts","../../../projects/avatar/src/lib/sources/initials.ts","../../../projects/avatar/src/lib/sources/gravatar.ts","../../../projects/avatar/src/lib/sources/value.ts","../../../projects/avatar/src/lib/sources/github.ts","../../../projects/avatar/src/lib/sources/custom-no-cache.ts","../../../projects/avatar/src/lib/sources/source.factory.ts","../../../projects/avatar/src/lib/avatar.component.ts","../../../projects/avatar/src/lib/avatar.module.ts","../../../projects/avatar/src/public_api.ts","../../../projects/avatar/src/ng-hub-ui-avatar.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nimport { AvatarConfig } from './avatar-config';\n/**\n * Token used to inject the AvatarConfig object\n */\nexport const AVATAR_CONFIG = new InjectionToken<AvatarConfig>('avatar.config');\n","import { Inject, Injectable, Optional } from '@angular/core';\n\nimport type { AvatarConfig } from './avatar-config';\nimport { AVATAR_CONFIG } from './avatar-config.token';\nimport { AvatarSource } from './sources/avatar-source.enum';\n\n@Injectable({ providedIn: 'root' })\nexport class AvatarConfigService {\n\tconstructor(\n\t\t@Optional()\n\t\t@Inject(AVATAR_CONFIG)\n\t\tpublic userConfig: AvatarConfig\n\t) {}\n\n\tpublic getAvatarSources(defaultSources: AvatarSource[]): AvatarSource[] {\n\t\tif (\n\t\t\tthis.userConfig &&\n\t\t\tthis.userConfig.sourcePriorityOrder &&\n\t\t\tthis.userConfig.sourcePriorityOrder.length\n\t\t) {\n\t\t\tconst uniqueSources = [\n\t\t\t\t...new Set(this.userConfig.sourcePriorityOrder)\n\t\t\t];\n\t\t\tconst validSources = uniqueSources.filter((source) =>\n\t\t\t\tdefaultSources.includes(source)\n\t\t\t);\n\t\t\treturn [\n\t\t\t\t...validSources,\n\t\t\t\t...defaultSources.filter(\n\t\t\t\t\t(source) => !validSources.includes(source)\n\t\t\t\t)\n\t\t\t];\n\t\t}\n\t\treturn defaultSources;\n\t}\n\n\tpublic getAvatarColors(defaultColors: string[]): string[] {\n\t\treturn (\n\t\t\t(this.userConfig &&\n\t\t\t\tthis.userConfig.colors &&\n\t\t\t\tthis.userConfig.colors.length &&\n\t\t\t\tthis.userConfig.colors) ||\n\t\t\tdefaultColors\n\t\t);\n\t}\n\n\tpublic getDisableSrcCache(defaultDisableSrcCache: boolean): boolean {\n\t\tif (\n\t\t\tthis.userConfig == null ||\n\t\t\tthis.userConfig.disableSrcCache == null\n\t\t) {\n\t\t\treturn defaultDisableSrcCache;\n\t\t} else {\n\t\t\treturn this.userConfig.disableSrcCache;\n\t\t}\n\t}\n}\n","export enum AvatarSource {\n FACEBOOK = 'facebook',\n GRAVATAR = 'gravatar',\n GITHUB = 'github',\n CUSTOM = 'custom',\n INITIALS = 'initials',\n VALUE = 'value'\n}\n","import { Injectable } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\n\nimport { Observable } from 'rxjs';\n\nimport { AvatarConfigService } from './avatar-config.service';\nimport { AvatarSource } from './sources/avatar-source.enum';\nimport { Source } from './sources/source';\n\n/**\n * list of Supported avatar sources\n */\nexport const defaultSources = [\n AvatarSource.FACEBOOK,\n AvatarSource.GRAVATAR,\n AvatarSource.GITHUB,\n AvatarSource.CUSTOM,\n AvatarSource.INITIALS,\n AvatarSource.VALUE\n];\n\n/**\n * list of default colors\n */\nexport const defaultColors = [\n '#1abc9c',\n '#3498db',\n '#f1c40f',\n '#8e44ad',\n '#e74c3c',\n '#d35400',\n '#2c3e50',\n '#7f8c8d'\n];\n\n/**\n * Default disable custom source cache settings\n */\nexport const defaultDisableSrcCache = false;\n\n/**\n * Provides utilities methods related to Avatar component\n */\n@Injectable({providedIn: 'root'})\nexport class AvatarService {\n public avatarSources: AvatarSource[] = defaultSources;\n public avatarColors: string[] = defaultColors;\n\n private readonly failedSources = new Map<string, Source>();\n\n constructor(\n private http: HttpClient,\n private avatarConfigService: AvatarConfigService\n ) {\n this.overrideAvatarSources();\n this.overrideAvatarColors();\n }\n\n public fetchAvatar(avatarUrl: string): Observable<unknown> {\n return this.http.get(avatarUrl);\n }\n\n public getRandomColor(avatarText: string): string {\n if (!avatarText) {\n return 'transparent';\n }\n const asciiCodeSum = this.calculateAsciiCode(avatarText);\n return this.avatarColors[asciiCodeSum % this.avatarColors.length];\n }\n\n public compareSources(\n sourceType1: AvatarSource,\n sourceType2: AvatarSource\n ): number {\n return (\n this.getSourcePriority(sourceType1) - this.getSourcePriority(sourceType2)\n );\n }\n\n public isSource(source: string): boolean {\n return this.avatarSources.includes(source as AvatarSource);\n }\n\n public isTextAvatar(sourceType: AvatarSource): boolean {\n return [AvatarSource.INITIALS, AvatarSource.VALUE].includes(sourceType);\n }\n\n private buildSourceKey(source: Source): string {\n return source.sourceType + '-' + source.sourceId;\n }\n\n public sourceHasFailedBefore(source: Source): boolean {\n return this.failedSources.has(this.buildSourceKey(source));\n }\n\n public markSourceAsFailed(source: Source): void {\n this.failedSources.set(this.buildSourceKey(source), source);\n }\n\n private overrideAvatarSources(): void {\n this.avatarSources = this.avatarConfigService.getAvatarSources(\n defaultSources\n );\n }\n\n private overrideAvatarColors(): void {\n this.avatarColors = this.avatarConfigService.getAvatarColors(defaultColors);\n }\n\n private calculateAsciiCode(value: string): number {\n return value\n .split('')\n .map(letter => letter.charCodeAt(0))\n .reduce((previous: number, current: number) => previous + current);\n }\n\n private getSourcePriority(sourceType: AvatarSource) {\n return this.avatarSources.indexOf(sourceType);\n }\n}\n","import { Source } from './source';\nimport { AvatarSource } from './avatar-source.enum';\n\n/**\n * Contract of all async sources.\n * Every async source must implement the processResponse method that extracts the avatar url from the data\n */\nexport abstract class AsyncSource implements Source {\n readonly abstract sourceType: AvatarSource;\n\n constructor(public sourceId: string) {}\n\n abstract getAvatar(size: number): string;\n abstract processResponse(data: unknown, size?: number): string | null;\n}\n","import { Source } from './source';\nimport { AvatarSource } from './avatar-source.enum';\n/**\n * Facebook source implementation.\n * Fetch avatar source based on facebook identifier\n * and image size\n */\nexport class Facebook implements Source {\n readonly sourceType: AvatarSource = AvatarSource.FACEBOOK;\n\n constructor(public sourceId: string) {}\n\n public getAvatar(size: number): string {\n return (\n 'https://graph.facebook.com/' +\n `${this.sourceId}/picture?width=${size}&height=${size}`\n );\n }\n}\n","import { Source } from './source';\nimport { AvatarSource } from './avatar-source.enum';\n/**\n * Custom source implementation.\n * return custom image as an avatar\n *\n */\nexport class Custom implements Source {\n readonly sourceType: AvatarSource = AvatarSource.CUSTOM;\n\n constructor(public sourceId: string) {}\n\n public getAvatar(): string {\n return this.sourceId;\n }\n}\n","import { Source } from './source';\nimport { AvatarSource } from './avatar-source.enum';\n\n/**\n * Initials source implementation.\n * return the initials of the given value\n */\nexport class Initials implements Source {\n readonly sourceType: AvatarSource = AvatarSource.INITIALS;\n\n constructor(public sourceId: string) {}\n\n public getAvatar(size: number): string {\n return this.getInitials(this.sourceId, size);\n }\n\n /**\n * Returns the initial letters of a name in a string.\n */\n private getInitials(name: string, size: number): string {\n name = name.trim();\n\n if (!name) {\n return '';\n }\n\n const initials = name.split(' ');\n\n if (size && size < initials.length) {\n return this.constructInitials(initials.slice(0, size));\n } else {\n return this.constructInitials(initials);\n }\n }\n\n /**\n * Iterates a person's name string to get the initials of each word in uppercase.\n */\n private constructInitials(elements: string[]): string {\n if (!elements || !elements.length) {\n return '';\n }\n\n return elements\n .filter(element => element && element.length > 0)\n .map(element => element[0].toUpperCase())\n .join('');\n }\n}\n","import { Md5 } from 'ts-md5';\nimport { Source } from './source';\nimport { AvatarSource } from './avatar-source.enum';\n\nfunction isRetina(): boolean {\n if (typeof window !== 'undefined' && window !== null) {\n if (window.devicePixelRatio > 1.25) {\n return true;\n }\n\n const mediaQuery = '(-webkit-min-device-pixel-ratio: 1.25), (min--moz-device-pixel-ratio: 1.25), (-o-min-device-pixel-ratio: 5/4), (min-resolution: 1.25dppx)';\n if (window.matchMedia && window.matchMedia(mediaQuery).matches) {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * Gravatar source implementation.\n * Fetch avatar source based on gravatar email\n */\nexport class Gravatar implements Source {\n readonly sourceType: AvatarSource = AvatarSource.GRAVATAR;\n public sourceId: string;\n\n constructor(public value: string) {\n this.sourceId = value.match('^[a-f0-9]{32}$')\n ? value\n : Md5.hashStr(value).toString();\n }\n\n public getAvatar(size: number): string {\n const avatarSize = isRetina() ? size * 2 : size;\n return `https://secure.gravatar.com/avatar/${\n this.sourceId\n }?s=${avatarSize}&d=404`;\n }\n}\n","import { Source } from './source';\nimport { AvatarSource } from './avatar-source.enum';\n\n/**\n * Value source implementation.\n * return the value as avatar\n */\nexport class Value implements Source {\n readonly sourceType: AvatarSource = AvatarSource.VALUE;\n\n constructor(public sourceId: string) {}\n\n public getAvatar(): string {\n return this.sourceId;\n }\n}\n","import { AsyncSource } from './async-source';\nimport { AvatarSource } from './avatar-source.enum';\n\n/**\n * GitHub source implementation.\n * Fetch avatar source based on github identifier\n */\nexport class Github extends AsyncSource {\n readonly sourceType: AvatarSource = AvatarSource.GITHUB;\n\n constructor(sourceId: string) {\n super(sourceId);\n }\n\n public getAvatar(): string {\n return `https://api.github.com/users/${this.sourceId}`;\n }\n\n /**\n * extract github avatar from json data\n */\n public processResponse(data: { avatar_url: string }, size?: number): string {\n if (size) {\n return `${data.avatar_url}&s=${size}`;\n }\n return data.avatar_url;\n }\n}\n","import {Source} from './source';\nimport {AvatarSource} from './avatar-source.enum';\n\n/**\n * Custom source implementation (with no cache).\n * return custom image as an avatar\n *\n */\nexport class CustomNoCache implements Source {\n readonly sourceType: AvatarSource = AvatarSource.CUSTOM;\n\n constructor(public sourceId: string) {}\n\n public getAvatar(): string {\n const urlSuffix = Math.random();\n return `${this.sourceId}${this.sourceId.indexOf('?') > -1 ? '&' : '?'}_=${urlSuffix}`;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Source } from './source';\nimport { Facebook } from './facebook';\nimport { Custom } from './custom';\nimport { Initials } from './initials';\nimport { Gravatar } from './gravatar';\nimport { Value } from './value';\nimport { Github } from './github';\nimport { SourceCreator } from './source.creator';\nimport { AvatarSource } from './avatar-source.enum';\nimport { AvatarConfigService } from '../avatar-config.service';\nimport { defaultDisableSrcCache } from '../avatar.service';\nimport { CustomNoCache } from './custom-no-cache';\n\n/**\n * Factory class that implements factory method pattern.\n * Used to create Source implementation class based\n * on the source Type\n */\n@Injectable({providedIn: 'root'})\nexport class SourceFactory {\n private sources: { [key: string]: SourceCreator } = {};\n\n constructor(avatarConfigService: AvatarConfigService) {\n const disableSrcCache = avatarConfigService.getDisableSrcCache(defaultDisableSrcCache);\n this.sources[AvatarSource.FACEBOOK] = Facebook;\n this.sources[AvatarSource.GRAVATAR] = Gravatar;\n this.sources[AvatarSource.CUSTOM] = disableSrcCache ? CustomNoCache : Custom;\n this.sources[AvatarSource.INITIALS] = Initials;\n this.sources[AvatarSource.VALUE] = Value;\n this.sources[AvatarSource.GITHUB] = Github;\n }\n\n public newInstance(sourceType: AvatarSource, sourceValue: string): Source {\n return new this.sources[sourceType](sourceValue);\n }\n}\n","import { Component, OnChanges, OnDestroy, SecurityContext, SimpleChanges, input, output } from '@angular/core';\n\nimport { DomSanitizer, SafeUrl } from '@angular/platform-browser';\nimport { map, takeWhile } from 'rxjs/operators';\nimport { AvatarService } from './avatar.service';\nimport { AsyncSource } from './sources/async-source';\nimport { AvatarSource } from './sources/avatar-source.enum';\nimport { Source } from './sources/source';\nimport { SourceFactory } from './sources/source.factory';\n\ntype StyleObject = Record<string, string | number | null | undefined>;\ntype Style = StyleObject | string;\n\n/**\n * Built-in semantic presence statuses for the avatar indicator dot.\n * `online` → success · `away` → warning · `busy` → danger · `offline` → neutral.\n */\nexport type HubAvatarStatus = 'online' | 'away' | 'busy' | 'offline';\n\n/**\n * Universal avatar component that\n * generates avatar from different sources\n *\n * export\n * class AvatarComponent\n * implements {OnChanges}\n */\n\n@Component({\n\t// tslint:disable-next-line:component-selector\n\tselector: 'hub-avatar',\n\tstandalone: false,\n\tstyleUrl: './avatar.component.scss',\n\ttemplate: `\n\t\t<div (click)=\"onAvatarClicked()\" class=\"avatar-container\" [style]=\"hostStyle\">\n\t\t\t@if (avatarSrc) {\n\t\t\t\t<img\n\t\t\t\t\t[src]=\"avatarSrc\"\n\t\t\t\t\t[alt]=\"customAlt() ? customAlt() : avatarAlt\"\n\t\t\t\t\t[width]=\"size()\"\n\t\t\t\t\t[height]=\"size()\"\n\t\t\t\t\t[style]=\"avatarStyle\"\n\t\t\t\t\t[referrerPolicy]=\"referrerpolicy()\"\n\t\t\t\t\t(error)=\"fetchAvatarSource()\"\n\t\t\t\t\tclass=\"avatar-content\"\n\t\t\t\t\tloading=\"lazy\"\n\t\t\t\t/>\n\t\t\t} @else {\n\t\t\t\t@if (avatarText) {\n\t\t\t\t\t<div class=\"avatar-content\" [style]=\"avatarStyle\">\n\t\t\t\t\t\t{{ avatarText }}\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t}\n\t\t</div>\n\t\t@if (status()) {\n\t\t\t<span class=\"hub-avatar__status\" aria-hidden=\"true\"></span>\n\t\t}\n\t`,\n\thost: {\n\t\t'[attr.data-status]': 'status() || null',\n\t\t'[style.--hub-avatar-size]': 'avatarSizePx'\n\t}\n})\nexport class AvatarComponent implements OnChanges, OnDestroy {\n\treadonly round = input(true);\n\treadonly size = input<string | number>(50);\n\treadonly textSizeRatio = input(3);\n\treadonly bgColor = input<string>();\n\treadonly fgColor = input('#FFF');\n\treadonly borderColor = input<string>();\n\treadonly style = input<Style>({});\n\treadonly cornerRadius = input<string | number>(0);\n\treadonly facebook = input<string | null>(undefined, { alias: 'facebookId' });\n\treadonly gravatar = input<string | null>(undefined, { alias: 'gravatarId' });\n\treadonly github = input<string | null>(undefined, { alias: 'githubId' });\n\treadonly custom = input<string | SafeUrl | null>(undefined, { alias: 'src' });\n\treadonly customAlt = input<string | null>(undefined, { alias: 'alt' });\n\treadonly initials = input<string | null>(undefined, { alias: 'name' });\n\treadonly value = input<string | null>();\n\treadonly referrerpolicy = input<string | null>();\n\treadonly placeholder = input<string>();\n\treadonly initialsSize = input<string | number>(0);\n\t/**\n\t * Semantic presence indicator shown as a small dot at the bottom-end corner.\n\t * Built-ins: `online` (success) · `away` (warning) · `busy` (danger) · `offline`\n\t * (neutral). Any custom string is accepted — set `--hub-avatar-status-color`\n\t * to colour it. When unset (default) no dot is rendered.\n\t */\n\treadonly status = input<HubAvatarStatus | (string & {}) | null>(null);\n\n\treadonly clickOnAvatar = output<Source>();\n\n\tisAlive = true;\n\tavatarSrc: SafeUrl | null = null;\n\tavatarAlt: SafeUrl | null = null;\n\tavatarText: string | null = null;\n\tavatarStyle: StyleObject = {};\n\thostStyle: StyleObject = {};\n\n\tprivate currentIndex = -1;\n\tprivate sources: Source[] = [];\n\n\tconstructor(\n\t\tprivate sourceFactory: SourceFactory,\n\t\tprivate avatarService: AvatarService,\n\t\tprivate sanitizer: DomSanitizer\n\t) {}\n\n\tonAvatarClicked(): void {\n\t\tthis.clickOnAvatar.emit(this.sources[this.currentIndex]);\n\t}\n\n\t/**\n\t * The avatar size as a px string. Exposed on the host as `--hub-avatar-size`\n\t * so the status dot (and any token-driven child) scales with the avatar.\n\t */\n\tget avatarSizePx(): string {\n\t\treturn (parseFloat(String(this.size())) || 50) + 'px';\n\t}\n\n\t/**\n\t * Detect inputs change\n\t *\n\t * param {{ [propKey: string]: SimpleChange }} changes\n\t *\n\t * memberof AvatarComponent\n\t */\n\tngOnChanges(changes: SimpleChanges): void {\n\t\tfor (const propName in changes) {\n\t\t\tif (this.avatarService.isSource(propName)) {\n\t\t\t\tconst sourceType: AvatarSource = AvatarSource[propName.toUpperCase() as keyof typeof AvatarSource];\n\t\t\t\tconst currentValue = changes[propName].currentValue;\n\t\t\t\tif (currentValue && typeof currentValue === 'string') {\n\t\t\t\t\tthis.addSource(sourceType, currentValue);\n\t\t\t\t} else {\n\t\t\t\t\tconst sanitized = this.sanitizer.sanitize(SecurityContext.URL, currentValue);\n\t\t\t\t\tif (sanitized) {\n\t\t\t\t\t\tthis.addSource(sourceType, sanitized);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.removeSource(sourceType);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Reinitialize when any source input changes so fallback order is recalculated.\n\t\tthis.initializeAvatar();\n\t}\n\n\t/**\n\t * Fetch avatar source\n\t *\n\t * memberOf AvatarComponent\n\t */\n\tfetchAvatarSource(): void {\n\t\tconst previousSource = this.sources[this.currentIndex];\n\t\tif (previousSource) {\n\t\t\tthis.avatarService.markSourceAsFailed(previousSource);\n\t\t}\n\n\t\tconst source = this.findNextSource();\n\t\tif (!source) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.avatarService.isTextAvatar(source.sourceType)) {\n\t\t\tthis.buildTextAvatar(source);\n\t\t\tthis.avatarSrc = null;\n\t\t} else {\n\t\t\tthis.buildImageAvatar(source);\n\t\t}\n\t}\n\n\tprivate findNextSource(): Source | null {\n\t\twhile (++this.currentIndex < this.sources.length) {\n\t\t\tconst source = this.sources[this.currentIndex];\n\t\t\tif (source && !this.avatarService.sourceHasFailedBefore(source)) {\n\t\t\t\treturn source;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis.isAlive = false;\n\t}\n\n\t/**\n\t * Initialize the avatar component and its fallback system\n\t */\n\tprivate initializeAvatar(): void {\n\t\tconst computedBorderRadius = this.round()\n\t\t\t? '50%'\n\t\t\t: this.cornerRadius() + 'px';\n\t\tthis.hostStyle = {\n\t\t\twidth: this.size() + 'px',\n\t\t\theight: this.size() + 'px',\n\t\t\tborderRadius: computedBorderRadius\n\t\t};\n\n\t\tthis.currentIndex = -1;\n\t\tif (this.sources.length > 0) {\n\t\t\tthis.sortAvatarSources();\n\t\t\tthis.fetchAvatarSource();\n\t\t}\n\t}\n\n\tprivate sortAvatarSources(): void {\n\t\tthis.sources.sort((source1: Source, source2: Source) =>\n\t\t\tthis.avatarService.compareSources(source1.sourceType, source2.sourceType)\n\t\t);\n\t}\n\n\tprivate buildTextAvatar(avatarSource: Source): void {\n\t\tthis.avatarText = avatarSource.getAvatar(+this.initialsSize());\n\t\tthis.avatarStyle = this.getInitialsStyle(avatarSource.sourceId);\n\t}\n\n\tprivate buildImageAvatar(avatarSource: Source): void {\n\t\tthis.avatarStyle = this.getImageStyle();\n\t\tif (avatarSource instanceof AsyncSource) {\n\t\t\tthis.fetchAndProcessAsyncAvatar(avatarSource);\n\t\t} else {\n\t\t\tthis.avatarSrc = this.sanitizer.bypassSecurityTrustUrl(avatarSource.getAvatar(+this.size()));\n\t\t\tthis.avatarAlt = avatarSource.getAvatar(+this.size());\n\t\t}\n\t}\n\n\t/**\n\t *\n\t * returns initials style\n\t *\n\t * memberOf AvatarComponent\n\t */\n\tprivate getInitialsStyle(avatarValue: string): StyleObject {\n\t\tconst borderColor = this.borderColor();\n\t\tconst bgColor = this.bgColor();\n\t\tconst hasCornerRadius = !this.round() || +this.cornerRadius() > 0;\n\t\tconst hasCustomFgColor = this.fgColor() !== '#FFF';\n\t\treturn {\n\t\t\ttextAlign: 'center',\n\t\t\tborderRadius: hasCornerRadius ? (this.round() ? '100%' : this.cornerRadius() + 'px') : undefined,\n\t\t\tborder: borderColor ? '1px solid ' + borderColor : undefined,\n\t\t\ttextTransform: 'uppercase',\n\t\t\tcolor: hasCustomFgColor ? this.fgColor() : undefined,\n\t\t\tbackgroundColor: bgColor ? bgColor : this.avatarService.getRandomColor(avatarValue),\n\t\t\tfont: Math.floor(+this.size() / this.textSizeRatio()) + 'px Helvetica, Arial, sans-serif',\n\t\t\tlineHeight: this.size() + 'px',\n\t\t\t...this.getCustomStyleObject()\n\t\t};\n\t}\n\n\t/**\n\t *\n\t * returns image style\n\t *\n\t * memberOf AvatarComponent\n\t */\n\tprivate getImageStyle(): StyleObject {\n\t\tconst borderColor = this.borderColor();\n\t\tconst hasCornerRadius = !this.round() || +this.cornerRadius() > 0;\n\t\treturn {\n\t\t\tmaxWidth: '100%',\n\t\t\tborderRadius: hasCornerRadius ? (this.round() ? '50%' : this.cornerRadius() + 'px') : undefined,\n\t\t\tborder: borderColor ? '1px solid ' + borderColor : undefined,\n\t\t\twidth: this.size() + 'px',\n\t\t\theight: this.size() + 'px',\n\t\t\t...this.getCustomStyleObject()\n\t\t};\n\t}\n\n\tprivate getCustomStyleObject(): StyleObject {\n\t\tconst customStyle = this.style();\n\t\tif (!customStyle) {\n\t\t\treturn {};\n\t\t}\n\n\t\tif (typeof customStyle === 'string') {\n\t\t\treturn this.parseInlineStyleString(customStyle);\n\t\t}\n\n\t\treturn customStyle;\n\t}\n\n\tprivate parseInlineStyleString(styleString: string): StyleObject {\n\t\tconst styleObject: StyleObject = {};\n\t\tstyleString\n\t\t\t.split(';')\n\t\t\t.map((declaration) => declaration.trim())\n\t\t\t.filter((declaration) => declaration.length > 0)\n\t\t\t.forEach((declaration) => {\n\t\t\t\tconst separatorIndex = declaration.indexOf(':');\n\t\t\t\tif (separatorIndex <= 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst property = declaration.slice(0, separatorIndex).trim();\n\t\t\t\tconst value = declaration.slice(separatorIndex + 1).trim();\n\t\t\t\tif (property && value) {\n\t\t\t\t\tstyleObject[property] = value;\n\t\t\t\t}\n\t\t\t});\n\t\treturn styleObject;\n\t}\n\n\t/**\n\t * Fetch avatar image asynchronously.\n\t *\n\t * param {Source} source represents avatar source\n\t * memberof AvatarComponent\n\t */\n\tprivate fetchAndProcessAsyncAvatar(source: AsyncSource): void {\n\t\tif (this.avatarService.sourceHasFailedBefore(source)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.avatarService\n\t\t\t.fetchAvatar(source.getAvatar(+this.size()))\n\t\t\t.pipe(\n\t\t\t\ttakeWhile(() => this.isAlive),\n\t\t\t\tmap((response) => source.processResponse(response, +this.size()))\n\t\t\t)\n\t\t\t.subscribe({\n\t\t\t\tnext: (avatarSrc) => (this.avatarSrc = avatarSrc),\n\t\t\t\terror: () => {\n\t\t\t\t\tthis.fetchAvatarSource();\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\t/**\n\t * Add avatar source\n\t *\n\t * param sourceType avatar source type e.g facebook,twitter, etc.\n\t * param sourceValue source value e.g facebookId value, etc.\n\t */\n\tprivate addSource(sourceType: AvatarSource, sourceValue: string): void {\n\t\tconst source = this.sources.find((s) => s.sourceType === sourceType);\n\t\tif (source) {\n\t\t\tsource.sourceId = sourceValue;\n\t\t} else {\n\t\t\tthis.sources.push(this.sourceFactory.newInstance(sourceType, sourceValue));\n\t\t}\n\t}\n\n\t/**\n\t * Remove avatar source\n\t *\n\t * param sourceType avatar source type e.g facebook,twitter, etc.\n\t */\n\tprivate removeSource(sourceType: AvatarSource): void {\n\t\tthis.sources = this.sources.filter((source) => source.sourceType !== sourceType);\n\t}\n}\n","import { CommonModule } from '@angular/common';\nimport { ModuleWithProviders, NgModule } from '@angular/core';\n\nimport { AvatarConfig } from './avatar-config';\nimport { AvatarConfigService } from './avatar-config.service';\nimport { AVATAR_CONFIG } from './avatar-config.token';\nimport { AvatarComponent } from './avatar.component';\nimport { AvatarService } from './avatar.service';\nimport { SourceFactory } from './sources/source.factory';\n\n@NgModule({\n\timports: [CommonModule],\n\tdeclarations: [AvatarComponent],\n\tproviders: [SourceFactory, AvatarService, AvatarConfigService],\n\texports: [AvatarComponent]\n})\nexport class AvatarModule {\n\tstatic forRoot(\n\t\tavatarConfig?: AvatarConfig\n\t): ModuleWithProviders<AvatarModule> {\n\t\treturn {\n\t\t\tngModule: AvatarModule,\n\t\t\tproviders: [\n\t\t\t\t{\n\t\t\t\t\tprovide: AVATAR_CONFIG,\n\t\t\t\t\tuseValue: avatarConfig ? avatarConfig : {}\n\t\t\t\t}\n\t\t\t]\n\t\t};\n\t}\n}\n","/*\n * Public API Surface of ng-hub-ui-avatar\n */\nexport * from './lib/avatar-config';\nexport * from './lib/avatar.component';\nexport * from './lib/avatar.module';\nexport * from './lib/avatar.service';\nexport * from './lib/sources/avatar-source.enum';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i2.AvatarConfigService","i1.AvatarConfigService","i1.SourceFactory","i2.AvatarService"],"mappings":";;;;;;;;AAGA;;AAEG;AACI,MAAM,aAAa,GAAG,IAAI,cAAc,CAAe,eAAe,CAAC;;MCCjE,mBAAmB,CAAA;AAIvB,IAAA,UAAA;AAHR,IAAA,WAAA,CAGQ,UAAwB,EAAA;QAAxB,IAAA,CAAA,UAAU,GAAV,UAAU;IACf;AAEI,IAAA,gBAAgB,CAAC,cAA8B,EAAA;QACrD,IACC,IAAI,CAAC,UAAU;YACf,IAAI,CAAC,UAAU,CAAC,mBAAmB;AACnC,YAAA,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,MAAM,EACzC;AACD,YAAA,MAAM,aAAa,GAAG;gBACrB,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,UAAU,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,EAAA,MAAA,EAAA,CAAA,4yHAAA,CAAA,EAAA;;;MC9CW,YAAY,CAAA;IACxB,OAAO,OAAO,CACb,YAA2B,EAAA;QAE3B,OAAO;AACN,YAAA,QAAQ,EAAE,YAAY;AACtB,YAAA,SAAS,EAAE;AACV,gBAAA;AACC,oBAAA,OAAO,EAAE,aAAa;oBACtB,QAAQ,EAAE,YAAY,GAAG,YAAY,GAAG;AACxC;AACD;SACD;IACF;uGAbY,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;AAAZ,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,EAAA,YAAA,EAAA,CAJT,eAAe,CAAA,EAAA,OAAA,EAAA,CADpB,YAAY,aAGZ,eAAe,CAAA,EAAA,CAAA;wGAEb,YAAY,EAAA,SAAA,EAHb,CAAC,aAAa,EAAE,aAAa,EAAE,mBAAmB,CAAC,EAAA,OAAA,EAAA,CAFpD,YAAY,CAAA,EAAA,CAAA;;2FAKV,YAAY,EAAA,UAAA,EAAA,CAAA;kBANxB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACT,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,YAAY,EAAE,CAAC,eAAe,CAAC;AAC/B,oBAAA,SAAS,EAAE,CAAC,aAAa,EAAE,aAAa,EAAE,mBAAmB,CAAC;oBAC9D,OAAO,EAAE,CAAC,eAAe;AACzB,iBAAA;;;ACfD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-hub-ui-avatar.mjs","sources":["../../../projects/avatar/src/lib/avatar-config.token.ts","../../../projects/avatar/src/lib/avatar-config.service.ts","../../../projects/avatar/src/lib/sources/avatar-source.enum.ts","../../../projects/avatar/src/lib/avatar.service.ts","../../../projects/avatar/src/lib/sources/async-source.ts","../../../projects/avatar/src/lib/sources/facebook.ts","../../../projects/avatar/src/lib/sources/custom.ts","../../../projects/avatar/src/lib/sources/initials.ts","../../../projects/avatar/src/lib/sources/gravatar.ts","../../../projects/avatar/src/lib/sources/value.ts","../../../projects/avatar/src/lib/sources/github.ts","../../../projects/avatar/src/lib/sources/custom-no-cache.ts","../../../projects/avatar/src/lib/sources/source.factory.ts","../../../projects/avatar/src/lib/avatar.component.ts","../../../projects/avatar/src/lib/avatar.module.ts","../../../projects/avatar/src/public_api.ts","../../../projects/avatar/src/ng-hub-ui-avatar.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nimport { AvatarConfig } from './avatar-config';\n/**\n * Token used to inject the AvatarConfig object\n */\nexport const AVATAR_CONFIG = new InjectionToken<AvatarConfig>('avatar.config');\n","import { Inject, Injectable, Optional } from '@angular/core';\n\nimport type { AvatarConfig } from './avatar-config';\nimport { AVATAR_CONFIG } from './avatar-config.token';\nimport { AvatarSource } from './sources/avatar-source.enum';\n\n@Injectable({ providedIn: 'root' })\nexport class AvatarConfigService {\n\tconstructor(\n\t\t@Optional()\n\t\t@Inject(AVATAR_CONFIG)\n\t\tpublic userConfig: AvatarConfig\n\t) {}\n\n\tpublic getAvatarSources(defaultSources: AvatarSource[]): AvatarSource[] {\n\t\tif (\n\t\t\tthis.userConfig &&\n\t\t\tthis.userConfig.sourcePriorityOrder &&\n\t\t\tthis.userConfig.sourcePriorityOrder.length\n\t\t) {\n\t\t\tconst uniqueSources = [\n\t\t\t\t...new Set(this.userConfig.sourcePriorityOrder)\n\t\t\t];\n\t\t\tconst validSources = uniqueSources.filter((source) =>\n\t\t\t\tdefaultSources.includes(source)\n\t\t\t);\n\t\t\treturn [\n\t\t\t\t...validSources,\n\t\t\t\t...defaultSources.filter(\n\t\t\t\t\t(source) => !validSources.includes(source)\n\t\t\t\t)\n\t\t\t];\n\t\t}\n\t\treturn defaultSources;\n\t}\n\n\tpublic getAvatarColors(defaultColors: string[]): string[] {\n\t\treturn (\n\t\t\t(this.userConfig &&\n\t\t\t\tthis.userConfig.colors &&\n\t\t\t\tthis.userConfig.colors.length &&\n\t\t\t\tthis.userConfig.colors) ||\n\t\t\tdefaultColors\n\t\t);\n\t}\n\n\tpublic getDisableSrcCache(defaultDisableSrcCache: boolean): boolean {\n\t\tif (\n\t\t\tthis.userConfig == null ||\n\t\t\tthis.userConfig.disableSrcCache == null\n\t\t) {\n\t\t\treturn defaultDisableSrcCache;\n\t\t} else {\n\t\t\treturn this.userConfig.disableSrcCache;\n\t\t}\n\t}\n}\n","export enum AvatarSource {\n FACEBOOK = 'facebook',\n GRAVATAR = 'gravatar',\n GITHUB = 'github',\n CUSTOM = 'custom',\n INITIALS = 'initials',\n VALUE = 'value'\n}\n","import { Injectable } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\n\nimport { Observable } from 'rxjs';\n\nimport { AvatarConfigService } from './avatar-config.service';\nimport { AvatarSource } from './sources/avatar-source.enum';\nimport { Source } from './sources/source';\n\n/**\n * list of Supported avatar sources\n */\nexport const defaultSources = [\n AvatarSource.FACEBOOK,\n AvatarSource.GRAVATAR,\n AvatarSource.GITHUB,\n AvatarSource.CUSTOM,\n AvatarSource.INITIALS,\n AvatarSource.VALUE\n];\n\n/**\n * list of default colors\n */\nexport const defaultColors = [\n '#1abc9c',\n '#3498db',\n '#f1c40f',\n '#8e44ad',\n '#e74c3c',\n '#d35400',\n '#2c3e50',\n '#7f8c8d'\n];\n\n/**\n * Default disable custom source cache settings\n */\nexport const defaultDisableSrcCache = false;\n\n/**\n * Provides utilities methods related to Avatar component\n */\n@Injectable({providedIn: 'root'})\nexport class AvatarService {\n public avatarSources: AvatarSource[] = defaultSources;\n public avatarColors: string[] = defaultColors;\n\n private readonly failedSources = new Map<string, Source>();\n\n constructor(\n private http: HttpClient,\n private avatarConfigService: AvatarConfigService\n ) {\n this.overrideAvatarSources();\n this.overrideAvatarColors();\n }\n\n public fetchAvatar(avatarUrl: string): Observable<unknown> {\n return this.http.get(avatarUrl);\n }\n\n public getRandomColor(avatarText: string): string {\n if (!avatarText) {\n return 'transparent';\n }\n const asciiCodeSum = this.calculateAsciiCode(avatarText);\n return this.avatarColors[asciiCodeSum % this.avatarColors.length];\n }\n\n public compareSources(\n sourceType1: AvatarSource,\n sourceType2: AvatarSource\n ): number {\n return (\n this.getSourcePriority(sourceType1) - this.getSourcePriority(sourceType2)\n );\n }\n\n public isSource(source: string): boolean {\n return this.avatarSources.includes(source as AvatarSource);\n }\n\n public isTextAvatar(sourceType: AvatarSource): boolean {\n return [AvatarSource.INITIALS, AvatarSource.VALUE].includes(sourceType);\n }\n\n private buildSourceKey(source: Source): string {\n return source.sourceType + '-' + source.sourceId;\n }\n\n public sourceHasFailedBefore(source: Source): boolean {\n return this.failedSources.has(this.buildSourceKey(source));\n }\n\n public markSourceAsFailed(source: Source): void {\n this.failedSources.set(this.buildSourceKey(source), source);\n }\n\n private overrideAvatarSources(): void {\n this.avatarSources = this.avatarConfigService.getAvatarSources(\n defaultSources\n );\n }\n\n private overrideAvatarColors(): void {\n this.avatarColors = this.avatarConfigService.getAvatarColors(defaultColors);\n }\n\n private calculateAsciiCode(value: string): number {\n return value\n .split('')\n .map(letter => letter.charCodeAt(0))\n .reduce((previous: number, current: number) => previous + current);\n }\n\n private getSourcePriority(sourceType: AvatarSource) {\n return this.avatarSources.indexOf(sourceType);\n }\n}\n","import { Source } from './source';\nimport { AvatarSource } from './avatar-source.enum';\n\n/**\n * Contract of all async sources.\n * Every async source must implement the processResponse method that extracts the avatar url from the data\n */\nexport abstract class AsyncSource implements Source {\n readonly abstract sourceType: AvatarSource;\n\n constructor(public sourceId: string) {}\n\n abstract getAvatar(size: number): string;\n abstract processResponse(data: unknown, size?: number): string | null;\n}\n","import { Source } from './source';\nimport { AvatarSource } from './avatar-source.enum';\n/**\n * Facebook source implementation.\n * Fetch avatar source based on facebook identifier\n * and image size\n */\nexport class Facebook implements Source {\n readonly sourceType: AvatarSource = AvatarSource.FACEBOOK;\n\n constructor(public sourceId: string) {}\n\n public getAvatar(size: number): string {\n return (\n 'https://graph.facebook.com/' +\n `${this.sourceId}/picture?width=${size}&height=${size}`\n );\n }\n}\n","import { Source } from './source';\nimport { AvatarSource } from './avatar-source.enum';\n/**\n * Custom source implementation.\n * return custom image as an avatar\n *\n */\nexport class Custom implements Source {\n readonly sourceType: AvatarSource = AvatarSource.CUSTOM;\n\n constructor(public sourceId: string) {}\n\n public getAvatar(): string {\n return this.sourceId;\n }\n}\n","import { Source } from './source';\nimport { AvatarSource } from './avatar-source.enum';\n\n/**\n * Initials source implementation.\n * return the initials of the given value\n */\nexport class Initials implements Source {\n readonly sourceType: AvatarSource = AvatarSource.INITIALS;\n\n constructor(public sourceId: string) {}\n\n public getAvatar(size: number): string {\n return this.getInitials(this.sourceId, size);\n }\n\n /**\n * Returns the initial letters of a name in a string.\n */\n private getInitials(name: string, size: number): string {\n name = name.trim();\n\n if (!name) {\n return '';\n }\n\n const initials = name.split(' ');\n\n if (size && size < initials.length) {\n return this.constructInitials(initials.slice(0, size));\n } else {\n return this.constructInitials(initials);\n }\n }\n\n /**\n * Iterates a person's name string to get the initials of each word in uppercase.\n */\n private constructInitials(elements: string[]): string {\n if (!elements || !elements.length) {\n return '';\n }\n\n return elements\n .filter(element => element && element.length > 0)\n .map(element => element[0].toUpperCase())\n .join('');\n }\n}\n","import { Md5 } from 'ts-md5';\nimport { Source } from './source';\nimport { AvatarSource } from './avatar-source.enum';\n\nfunction isRetina(): boolean {\n if (typeof window !== 'undefined' && window !== null) {\n if (window.devicePixelRatio > 1.25) {\n return true;\n }\n\n const mediaQuery = '(-webkit-min-device-pixel-ratio: 1.25), (min--moz-device-pixel-ratio: 1.25), (-o-min-device-pixel-ratio: 5/4), (min-resolution: 1.25dppx)';\n if (window.matchMedia && window.matchMedia(mediaQuery).matches) {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * Gravatar source implementation.\n * Fetch avatar source based on gravatar email\n */\nexport class Gravatar implements Source {\n readonly sourceType: AvatarSource = AvatarSource.GRAVATAR;\n public sourceId: string;\n\n constructor(public value: string) {\n this.sourceId = value.match('^[a-f0-9]{32}$')\n ? value\n : Md5.hashStr(value).toString();\n }\n\n public getAvatar(size: number): string {\n const avatarSize = isRetina() ? size * 2 : size;\n return `https://secure.gravatar.com/avatar/${\n this.sourceId\n }?s=${avatarSize}&d=404`;\n }\n}\n","import { Source } from './source';\nimport { AvatarSource } from './avatar-source.enum';\n\n/**\n * Value source implementation.\n * return the value as avatar\n */\nexport class Value implements Source {\n readonly sourceType: AvatarSource = AvatarSource.VALUE;\n\n constructor(public sourceId: string) {}\n\n public getAvatar(): string {\n return this.sourceId;\n }\n}\n","import { AsyncSource } from './async-source';\nimport { AvatarSource } from './avatar-source.enum';\n\n/**\n * GitHub source implementation.\n * Fetch avatar source based on github identifier\n */\nexport class Github extends AsyncSource {\n readonly sourceType: AvatarSource = AvatarSource.GITHUB;\n\n constructor(sourceId: string) {\n super(sourceId);\n }\n\n public getAvatar(): string {\n return `https://api.github.com/users/${this.sourceId}`;\n }\n\n /**\n * extract github avatar from json data\n */\n public processResponse(data: { avatar_url: string }, size?: number): string {\n if (size) {\n return `${data.avatar_url}&s=${size}`;\n }\n return data.avatar_url;\n }\n}\n","import {Source} from './source';\nimport {AvatarSource} from './avatar-source.enum';\n\n/**\n * Custom source implementation (with no cache).\n * return custom image as an avatar\n *\n */\nexport class CustomNoCache implements Source {\n readonly sourceType: AvatarSource = AvatarSource.CUSTOM;\n\n constructor(public sourceId: string) {}\n\n public getAvatar(): string {\n const urlSuffix = Math.random();\n return `${this.sourceId}${this.sourceId.indexOf('?') > -1 ? '&' : '?'}_=${urlSuffix}`;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Source } from './source';\nimport { Facebook } from './facebook';\nimport { Custom } from './custom';\nimport { Initials } from './initials';\nimport { Gravatar } from './gravatar';\nimport { Value } from './value';\nimport { Github } from './github';\nimport { SourceCreator } from './source.creator';\nimport { AvatarSource } from './avatar-source.enum';\nimport { AvatarConfigService } from '../avatar-config.service';\nimport { defaultDisableSrcCache } from '../avatar.service';\nimport { CustomNoCache } from './custom-no-cache';\n\n/**\n * Factory class that implements factory method pattern.\n * Used to create Source implementation class based\n * on the source Type\n */\n@Injectable({providedIn: 'root'})\nexport class SourceFactory {\n private sources: { [key: string]: SourceCreator } = {};\n\n constructor(avatarConfigService: AvatarConfigService) {\n const disableSrcCache = avatarConfigService.getDisableSrcCache(defaultDisableSrcCache);\n this.sources[AvatarSource.FACEBOOK] = Facebook;\n this.sources[AvatarSource.GRAVATAR] = Gravatar;\n this.sources[AvatarSource.CUSTOM] = disableSrcCache ? CustomNoCache : Custom;\n this.sources[AvatarSource.INITIALS] = Initials;\n this.sources[AvatarSource.VALUE] = Value;\n this.sources[AvatarSource.GITHUB] = Github;\n }\n\n public newInstance(sourceType: AvatarSource, sourceValue: string): Source {\n return new this.sources[sourceType](sourceValue);\n }\n}\n","import { AfterContentInit, Component, ElementRef, OnChanges, OnDestroy, SecurityContext, SimpleChanges, ViewChild, input, output } from '@angular/core';\n\nimport { DomSanitizer, SafeUrl } from '@angular/platform-browser';\nimport { map, takeWhile } from 'rxjs/operators';\nimport { AvatarService } from './avatar.service';\nimport { AsyncSource } from './sources/async-source';\nimport { AvatarSource } from './sources/avatar-source.enum';\nimport { Source } from './sources/source';\nimport { SourceFactory } from './sources/source.factory';\n\ntype StyleObject = Record<string, string | number | null | undefined>;\ntype Style = StyleObject | string;\n\n/**\n * Built-in semantic presence statuses for the avatar indicator dot.\n * `online` → success · `away` → warning · `busy` → danger · `offline` → neutral.\n */\nexport type HubAvatarStatus = 'online' | 'away' | 'busy' | 'offline';\n\n/**\n * Universal avatar component that\n * generates avatar from different sources\n *\n * export\n * class AvatarComponent\n * implements {OnChanges}\n */\n\n@Component({\n\t// tslint:disable-next-line:component-selector\n\tselector: 'hub-avatar',\n\tstandalone: false,\n\tstyleUrl: './avatar.component.scss',\n\ttemplate: `\n\t\t<div (click)=\"onAvatarClicked()\" class=\"avatar-container\" [class.hub-avatar--custom]=\"hasCustomContent\" [style]=\"hostStyle\">\n\t\t\t<span #customContent class=\"hub-avatar__custom\" [style]=\"customContentStyle\"><ng-content></ng-content></span>\n\t\t\t@if (!hasCustomContent) {\n\t\t\t\t@if (avatarSrc) {\n\t\t\t\t\t<img\n\t\t\t\t\t\t[src]=\"avatarSrc\"\n\t\t\t\t\t\t[alt]=\"customAlt() ? customAlt() : avatarAlt\"\n\t\t\t\t\t\t[width]=\"size()\"\n\t\t\t\t\t\t[height]=\"size()\"\n\t\t\t\t\t\t[style]=\"avatarStyle\"\n\t\t\t\t\t\t[referrerPolicy]=\"referrerpolicy()\"\n\t\t\t\t\t\t(error)=\"fetchAvatarSource()\"\n\t\t\t\t\t\tclass=\"avatar-content\"\n\t\t\t\t\t\tloading=\"lazy\"\n\t\t\t\t\t/>\n\t\t\t\t} @else {\n\t\t\t\t\t@if (avatarText) {\n\t\t\t\t\t\t<div class=\"avatar-content\" [style]=\"avatarStyle\">\n\t\t\t\t\t\t\t{{ avatarText }}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t</div>\n\t\t@if (status()) {\n\t\t\t<span class=\"hub-avatar__status\" aria-hidden=\"true\"></span>\n\t\t}\n\t`,\n\thost: {\n\t\t'[attr.data-status]': 'status() || null',\n\t\t'[style.--hub-avatar-size]': 'avatarSizePx'\n\t}\n})\nexport class AvatarComponent implements AfterContentInit, OnChanges, OnDestroy {\n\treadonly round = input(true);\n\treadonly size = input<string | number>(50);\n\treadonly textSizeRatio = input(3);\n\treadonly bgColor = input<string>();\n\treadonly fgColor = input('#FFF');\n\treadonly borderColor = input<string>();\n\treadonly style = input<Style>({});\n\treadonly cornerRadius = input<string | number>(0);\n\treadonly facebook = input<string | null>(undefined, { alias: 'facebookId' });\n\treadonly gravatar = input<string | null>(undefined, { alias: 'gravatarId' });\n\treadonly github = input<string | null>(undefined, { alias: 'githubId' });\n\treadonly custom = input<string | SafeUrl | null>(undefined, { alias: 'src' });\n\treadonly customAlt = input<string | null>(undefined, { alias: 'alt' });\n\treadonly initials = input<string | null>(undefined, { alias: 'name' });\n\treadonly value = input<string | null>();\n\treadonly referrerpolicy = input<string | null>();\n\treadonly placeholder = input<string>();\n\treadonly initialsSize = input<string | number>(0);\n\t/**\n\t * Semantic presence indicator shown as a small dot at the bottom-end corner.\n\t * Built-ins: `online` (success) · `away` (warning) · `busy` (danger) · `offline`\n\t * (neutral). Any custom string is accepted — set `--hub-avatar-status-color`\n\t * to colour it. When unset (default) no dot is rendered.\n\t */\n\treadonly status = input<HubAvatarStatus | (string & {}) | null>(null);\n\n\treadonly clickOnAvatar = output<Source>();\n\n\t/** Wrapper around the projected content (`<ng-content>`), used to detect whether the consumer projected anything. */\n\t@ViewChild('customContent', { static: true }) private customContentRef?: ElementRef<HTMLElement>;\n\n\t/** True when the consumer projected custom content (an icon, SVG, image, …) into the avatar. */\n\thasCustomContent = false;\n\n\t/** Inline style applied to the projected-content slot (honours `bgColor` / `fgColor` / `borderColor` / `style`). */\n\tcustomContentStyle: StyleObject = {};\n\n\tisAlive = true;\n\tavatarSrc: SafeUrl | null = null;\n\tavatarAlt: SafeUrl | null = null;\n\tavatarText: string | null = null;\n\tavatarStyle: StyleObject = {};\n\thostStyle: StyleObject = {};\n\n\tprivate currentIndex = -1;\n\tprivate sources: Source[] = [];\n\n\tconstructor(\n\t\tprivate sourceFactory: SourceFactory,\n\t\tprivate avatarService: AvatarService,\n\t\tprivate sanitizer: DomSanitizer\n\t) {}\n\n\tonAvatarClicked(): void {\n\t\tthis.clickOnAvatar.emit(this.sources[this.currentIndex]);\n\t}\n\n\t/**\n\t * Detects projected content once it is available and, when present, computes its style.\n\t * Runs after content init so `<ng-content>` nodes are already in place.\n\t */\n\tngAfterContentInit(): void {\n\t\tconst host = this.customContentRef?.nativeElement;\n\t\tthis.hasCustomContent = !!host && this.hasMeaningfulProjectedContent(host);\n\t\tif (this.hasCustomContent) {\n\t\t\tthis.customContentStyle = this.getCustomContentStyle();\n\t\t}\n\t}\n\n\t/**\n\t * Returns true when the projected slot holds a real element or non-whitespace text,\n\t * so whitespace-only projection does not flip the avatar into custom-content mode.\n\t *\n\t * @param host The element wrapping the projected content.\n\t */\n\tprivate hasMeaningfulProjectedContent(host: HTMLElement): boolean {\n\t\treturn Array.from(host.childNodes).some(\n\t\t\t(node) =>\n\t\t\t\tnode.nodeType === Node.ELEMENT_NODE ||\n\t\t\t\t(node.nodeType === Node.TEXT_NODE && (node.textContent ?? '').trim().length > 0)\n\t\t);\n\t}\n\n\t/**\n\t * Builds the inline style for the projected-content slot. Sensible visible defaults\n\t * (a themed background circle and a readable foreground colour) come from CSS tokens;\n\t * the `bgColor` / `fgColor` / `borderColor` / `style` inputs override them when set.\n\t */\n\tprivate getCustomContentStyle(): StyleObject {\n\t\tconst borderColor = this.borderColor();\n\t\tconst bgColor = this.bgColor();\n\t\tconst hasCustomFgColor = this.fgColor() !== '#FFF';\n\t\treturn {\n\t\t\tbackgroundColor: bgColor ? bgColor : undefined,\n\t\t\tcolor: hasCustomFgColor ? this.fgColor() : undefined,\n\t\t\tborder: borderColor ? '1px solid ' + borderColor : undefined,\n\t\t\t...this.getCustomStyleObject()\n\t\t};\n\t}\n\n\t/**\n\t * The avatar size as a px string. Exposed on the host as `--hub-avatar-size`\n\t * so the status dot (and any token-driven child) scales with the avatar.\n\t */\n\tget avatarSizePx(): string {\n\t\treturn (parseFloat(String(this.size())) || 50) + 'px';\n\t}\n\n\t/**\n\t * Detect inputs change\n\t *\n\t * param {{ [propKey: string]: SimpleChange }} changes\n\t *\n\t * memberof AvatarComponent\n\t */\n\tngOnChanges(changes: SimpleChanges): void {\n\t\tfor (const propName in changes) {\n\t\t\tif (this.avatarService.isSource(propName)) {\n\t\t\t\tconst sourceType: AvatarSource = AvatarSource[propName.toUpperCase() as keyof typeof AvatarSource];\n\t\t\t\tconst currentValue = changes[propName].currentValue;\n\t\t\t\tif (currentValue && typeof currentValue === 'string') {\n\t\t\t\t\tthis.addSource(sourceType, currentValue);\n\t\t\t\t} else {\n\t\t\t\t\tconst sanitized = this.sanitizer.sanitize(SecurityContext.URL, currentValue);\n\t\t\t\t\tif (sanitized) {\n\t\t\t\t\t\tthis.addSource(sourceType, sanitized);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.removeSource(sourceType);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Reinitialize when any source input changes so fallback order is recalculated.\n\t\tthis.initializeAvatar();\n\t\tif (this.hasCustomContent) {\n\t\t\tthis.customContentStyle = this.getCustomContentStyle();\n\t\t}\n\t}\n\n\t/**\n\t * Fetch avatar source\n\t *\n\t * memberOf AvatarComponent\n\t */\n\tfetchAvatarSource(): void {\n\t\tconst previousSource = this.sources[this.currentIndex];\n\t\tif (previousSource) {\n\t\t\tthis.avatarService.markSourceAsFailed(previousSource);\n\t\t}\n\n\t\tconst source = this.findNextSource();\n\t\tif (!source) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.avatarService.isTextAvatar(source.sourceType)) {\n\t\t\tthis.buildTextAvatar(source);\n\t\t\tthis.avatarSrc = null;\n\t\t} else {\n\t\t\tthis.buildImageAvatar(source);\n\t\t}\n\t}\n\n\tprivate findNextSource(): Source | null {\n\t\twhile (++this.currentIndex < this.sources.length) {\n\t\t\tconst source = this.sources[this.currentIndex];\n\t\t\tif (source && !this.avatarService.sourceHasFailedBefore(source)) {\n\t\t\t\treturn source;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis.isAlive = false;\n\t}\n\n\t/**\n\t * Initialize the avatar component and its fallback system\n\t */\n\tprivate initializeAvatar(): void {\n\t\tconst computedBorderRadius = this.round()\n\t\t\t? '50%'\n\t\t\t: this.cornerRadius() + 'px';\n\t\tthis.hostStyle = {\n\t\t\twidth: this.size() + 'px',\n\t\t\theight: this.size() + 'px',\n\t\t\tborderRadius: computedBorderRadius\n\t\t};\n\n\t\tthis.currentIndex = -1;\n\t\tif (this.sources.length > 0) {\n\t\t\tthis.sortAvatarSources();\n\t\t\tthis.fetchAvatarSource();\n\t\t}\n\t}\n\n\tprivate sortAvatarSources(): void {\n\t\tthis.sources.sort((source1: Source, source2: Source) =>\n\t\t\tthis.avatarService.compareSources(source1.sourceType, source2.sourceType)\n\t\t);\n\t}\n\n\tprivate buildTextAvatar(avatarSource: Source): void {\n\t\tthis.avatarText = avatarSource.getAvatar(+this.initialsSize());\n\t\tthis.avatarStyle = this.getInitialsStyle(avatarSource.sourceId);\n\t}\n\n\tprivate buildImageAvatar(avatarSource: Source): void {\n\t\tthis.avatarStyle = this.getImageStyle();\n\t\tif (avatarSource instanceof AsyncSource) {\n\t\t\tthis.fetchAndProcessAsyncAvatar(avatarSource);\n\t\t} else {\n\t\t\tthis.avatarSrc = this.sanitizer.bypassSecurityTrustUrl(avatarSource.getAvatar(+this.size()));\n\t\t\tthis.avatarAlt = avatarSource.getAvatar(+this.size());\n\t\t}\n\t}\n\n\t/**\n\t *\n\t * returns initials style\n\t *\n\t * memberOf AvatarComponent\n\t */\n\tprivate getInitialsStyle(avatarValue: string): StyleObject {\n\t\tconst borderColor = this.borderColor();\n\t\tconst bgColor = this.bgColor();\n\t\tconst hasCornerRadius = !this.round() || +this.cornerRadius() > 0;\n\t\tconst hasCustomFgColor = this.fgColor() !== '#FFF';\n\t\treturn {\n\t\t\ttextAlign: 'center',\n\t\t\tborderRadius: hasCornerRadius ? (this.round() ? '100%' : this.cornerRadius() + 'px') : undefined,\n\t\t\tborder: borderColor ? '1px solid ' + borderColor : undefined,\n\t\t\ttextTransform: 'uppercase',\n\t\t\tcolor: hasCustomFgColor ? this.fgColor() : undefined,\n\t\t\tbackgroundColor: bgColor ? bgColor : this.avatarService.getRandomColor(avatarValue),\n\t\t\tfont: Math.floor(+this.size() / this.textSizeRatio()) + 'px Helvetica, Arial, sans-serif',\n\t\t\tlineHeight: this.size() + 'px',\n\t\t\t...this.getCustomStyleObject()\n\t\t};\n\t}\n\n\t/**\n\t *\n\t * returns image style\n\t *\n\t * memberOf AvatarComponent\n\t */\n\tprivate getImageStyle(): StyleObject {\n\t\tconst borderColor = this.borderColor();\n\t\tconst hasCornerRadius = !this.round() || +this.cornerRadius() > 0;\n\t\treturn {\n\t\t\tmaxWidth: '100%',\n\t\t\tborderRadius: hasCornerRadius ? (this.round() ? '50%' : this.cornerRadius() + 'px') : undefined,\n\t\t\tborder: borderColor ? '1px solid ' + borderColor : undefined,\n\t\t\twidth: this.size() + 'px',\n\t\t\theight: this.size() + 'px',\n\t\t\t...this.getCustomStyleObject()\n\t\t};\n\t}\n\n\tprivate getCustomStyleObject(): StyleObject {\n\t\tconst customStyle = this.style();\n\t\tif (!customStyle) {\n\t\t\treturn {};\n\t\t}\n\n\t\tif (typeof customStyle === 'string') {\n\t\t\treturn this.parseInlineStyleString(customStyle);\n\t\t}\n\n\t\treturn customStyle;\n\t}\n\n\tprivate parseInlineStyleString(styleString: string): StyleObject {\n\t\tconst styleObject: StyleObject = {};\n\t\tstyleString\n\t\t\t.split(';')\n\t\t\t.map((declaration) => declaration.trim())\n\t\t\t.filter((declaration) => declaration.length > 0)\n\t\t\t.forEach((declaration) => {\n\t\t\t\tconst separatorIndex = declaration.indexOf(':');\n\t\t\t\tif (separatorIndex <= 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst property = declaration.slice(0, separatorIndex).trim();\n\t\t\t\tconst value = declaration.slice(separatorIndex + 1).trim();\n\t\t\t\tif (property && value) {\n\t\t\t\t\tstyleObject[property] = value;\n\t\t\t\t}\n\t\t\t});\n\t\treturn styleObject;\n\t}\n\n\t/**\n\t * Fetch avatar image asynchronously.\n\t *\n\t * param {Source} source represents avatar source\n\t * memberof AvatarComponent\n\t */\n\tprivate fetchAndProcessAsyncAvatar(source: AsyncSource): void {\n\t\tif (this.avatarService.sourceHasFailedBefore(source)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.avatarService\n\t\t\t.fetchAvatar(source.getAvatar(+this.size()))\n\t\t\t.pipe(\n\t\t\t\ttakeWhile(() => this.isAlive),\n\t\t\t\tmap((response) => source.processResponse(response, +this.size()))\n\t\t\t)\n\t\t\t.subscribe({\n\t\t\t\tnext: (avatarSrc) => (this.avatarSrc = avatarSrc),\n\t\t\t\terror: () => {\n\t\t\t\t\tthis.fetchAvatarSource();\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\t/**\n\t * Add avatar source\n\t *\n\t * param sourceType avatar source type e.g facebook,twitter, etc.\n\t * param sourceValue source value e.g facebookId value, etc.\n\t */\n\tprivate addSource(sourceType: AvatarSource, sourceValue: string): void {\n\t\tconst source = this.sources.find((s) => s.sourceType === sourceType);\n\t\tif (source) {\n\t\t\tsource.sourceId = sourceValue;\n\t\t} else {\n\t\t\tthis.sources.push(this.sourceFactory.newInstance(sourceType, sourceValue));\n\t\t}\n\t}\n\n\t/**\n\t * Remove avatar source\n\t *\n\t * param sourceType avatar source type e.g facebook,twitter, etc.\n\t */\n\tprivate removeSource(sourceType: AvatarSource): void {\n\t\tthis.sources = this.sources.filter((source) => source.sourceType !== sourceType);\n\t}\n}\n","import { CommonModule } from '@angular/common';\nimport { ModuleWithProviders, NgModule } from '@angular/core';\n\nimport { AvatarConfig } from './avatar-config';\nimport { AvatarConfigService } from './avatar-config.service';\nimport { AVATAR_CONFIG } from './avatar-config.token';\nimport { AvatarComponent } from './avatar.component';\nimport { AvatarService } from './avatar.service';\nimport { SourceFactory } from './sources/source.factory';\n\n@NgModule({\n\timports: [CommonModule],\n\tdeclarations: [AvatarComponent],\n\tproviders: [SourceFactory, AvatarService, AvatarConfigService],\n\texports: [AvatarComponent]\n})\nexport class AvatarModule {\n\tstatic forRoot(\n\t\tavatarConfig?: AvatarConfig\n\t): ModuleWithProviders<AvatarModule> {\n\t\treturn {\n\t\t\tngModule: AvatarModule,\n\t\t\tproviders: [\n\t\t\t\t{\n\t\t\t\t\tprovide: AVATAR_CONFIG,\n\t\t\t\t\tuseValue: avatarConfig ? avatarConfig : {}\n\t\t\t\t}\n\t\t\t]\n\t\t};\n\t}\n}\n","/*\n * Public API Surface of ng-hub-ui-avatar\n */\nexport * from './lib/avatar-config';\nexport * from './lib/avatar.component';\nexport * from './lib/avatar.module';\nexport * from './lib/avatar.service';\nexport * from './lib/sources/avatar-source.enum';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i2.AvatarConfigService","i1.AvatarConfigService","i1.SourceFactory","i2.AvatarService"],"mappings":";;;;;;;;AAGA;;AAEG;AACI,MAAM,aAAa,GAAG,IAAI,cAAc,CAAe,eAAe,CAAC;;MCCjE,mBAAmB,CAAA;AAIvB,IAAA,UAAA;AAHR,IAAA,WAAA,CAGQ,UAAwB,EAAA;QAAxB,IAAA,CAAA,UAAU,GAAV,UAAU;IACf;AAEI,IAAA,gBAAgB,CAAC,cAA8B,EAAA;QACrD,IACC,IAAI,CAAC,UAAU;YACf,IAAI,CAAC,UAAU,CAAC,mBAAmB;AACnC,YAAA,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,MAAM,EACzC;AACD,YAAA,MAAM,aAAa,GAAG;gBACrB,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,mBAAmB;aAC9C;AACD,YAAA,MAAM,YAAY,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC,MAAM,KAChD,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,CAC/B;YACD,OAAO;AACN,gBAAA,GAAG,YAAY;AACf,gBAAA,GAAG,cAAc,CAAC,MAAM,CACvB,CAAC,MAAM,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC;aAE3C;QACF;AACA,QAAA,OAAO,cAAc;IACtB;AAEO,IAAA,eAAe,CAAC,aAAuB,EAAA;AAC7C,QAAA,QACC,CAAC,IAAI,CAAC,UAAU;Y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jFhC,YAAY,CAAA;IACxB,OAAO,OAAO,CACb,YAA2B,EAAA;QAE3B,OAAO;AACN,YAAA,QAAQ,EAAE,YAAY;AACtB,YAAA,SAAS,EAAE;AACV,gBAAA;AACC,oBAAA,OAAO,EAAE,aAAa;oBACtB,QAAQ,EAAE,YAAY,GAAG,YAAY,GAAG;AACxC;AACD;SACD;IACF;uGAbY,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;AAAZ,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,EAAA,YAAA,EAAA,CAJT,eAAe,CAAA,EAAA,OAAA,EAAA,CADpB,YAAY,aAGZ,eAAe,CAAA,EAAA,CAAA;wGAEb,YAAY,EAAA,SAAA,EAHb,CAAC,aAAa,EAAE,aAAa,EAAE,mBAAmB,CAAC,EAAA,OAAA,EAAA,CAFpD,YAAY,CAAA,EAAA,CAAA;;2FAKV,YAAY,EAAA,UAAA,EAAA,CAAA;kBANxB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACT,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,YAAY,EAAE,CAAC,eAAe,CAAC;AAC/B,oBAAA,SAAS,EAAE,CAAC,aAAa,EAAE,aAAa,EAAE,mBAAmB,CAAC;oBAC9D,OAAO,EAAE,CAAC,eAAe;AACzB,iBAAA;;;ACfD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ng-hub-ui-avatar",
|
|
3
3
|
"description": "A universal avatar component for Angular applications that fetches / generates avatar based on the information you have about the user. Supports initials, Gravatar integration, custom images and styling options. Perfect for user profiles and comment systems.",
|
|
4
|
-
"version": "22.
|
|
4
|
+
"version": "22.2.0",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
7
7
|
"avatar",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"repository": {
|
|
25
25
|
"type": "git",
|
|
26
|
-
"url": "https://github.com/carlos-morcillo/ng-hub-ui-avatar"
|
|
26
|
+
"url": "git+https://github.com/carlos-morcillo/ng-hub-ui-avatar.git"
|
|
27
27
|
},
|
|
28
28
|
"sideEffects": false,
|
|
29
29
|
"peerDependencies": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { OnChanges, OnDestroy, SimpleChanges, ModuleWithProviders } from '@angular/core';
|
|
2
|
+
import { AfterContentInit, OnChanges, OnDestroy, SimpleChanges, ModuleWithProviders } from '@angular/core';
|
|
3
3
|
import { SafeUrl, DomSanitizer } from '@angular/platform-browser';
|
|
4
4
|
import { HttpClient } from '@angular/common/http';
|
|
5
5
|
import { Observable } from 'rxjs';
|
|
@@ -129,7 +129,7 @@ type HubAvatarStatus = 'online' | 'away' | 'busy' | 'offline';
|
|
|
129
129
|
* class AvatarComponent
|
|
130
130
|
* implements {OnChanges}
|
|
131
131
|
*/
|
|
132
|
-
declare class AvatarComponent implements OnChanges, OnDestroy {
|
|
132
|
+
declare class AvatarComponent implements AfterContentInit, OnChanges, OnDestroy {
|
|
133
133
|
private sourceFactory;
|
|
134
134
|
private avatarService;
|
|
135
135
|
private sanitizer;
|
|
@@ -159,6 +159,12 @@ declare class AvatarComponent implements OnChanges, OnDestroy {
|
|
|
159
159
|
*/
|
|
160
160
|
readonly status: _angular_core.InputSignal<HubAvatarStatus | (string & {}) | null>;
|
|
161
161
|
readonly clickOnAvatar: _angular_core.OutputEmitterRef<Source>;
|
|
162
|
+
/** Wrapper around the projected content (`<ng-content>`), used to detect whether the consumer projected anything. */
|
|
163
|
+
private customContentRef?;
|
|
164
|
+
/** True when the consumer projected custom content (an icon, SVG, image, …) into the avatar. */
|
|
165
|
+
hasCustomContent: boolean;
|
|
166
|
+
/** Inline style applied to the projected-content slot (honours `bgColor` / `fgColor` / `borderColor` / `style`). */
|
|
167
|
+
customContentStyle: StyleObject;
|
|
162
168
|
isAlive: boolean;
|
|
163
169
|
avatarSrc: SafeUrl | null;
|
|
164
170
|
avatarAlt: SafeUrl | null;
|
|
@@ -169,6 +175,24 @@ declare class AvatarComponent implements OnChanges, OnDestroy {
|
|
|
169
175
|
private sources;
|
|
170
176
|
constructor(sourceFactory: SourceFactory, avatarService: AvatarService, sanitizer: DomSanitizer);
|
|
171
177
|
onAvatarClicked(): void;
|
|
178
|
+
/**
|
|
179
|
+
* Detects projected content once it is available and, when present, computes its style.
|
|
180
|
+
* Runs after content init so `<ng-content>` nodes are already in place.
|
|
181
|
+
*/
|
|
182
|
+
ngAfterContentInit(): void;
|
|
183
|
+
/**
|
|
184
|
+
* Returns true when the projected slot holds a real element or non-whitespace text,
|
|
185
|
+
* so whitespace-only projection does not flip the avatar into custom-content mode.
|
|
186
|
+
*
|
|
187
|
+
* @param host The element wrapping the projected content.
|
|
188
|
+
*/
|
|
189
|
+
private hasMeaningfulProjectedContent;
|
|
190
|
+
/**
|
|
191
|
+
* Builds the inline style for the projected-content slot. Sensible visible defaults
|
|
192
|
+
* (a themed background circle and a readable foreground colour) come from CSS tokens;
|
|
193
|
+
* the `bgColor` / `fgColor` / `borderColor` / `style` inputs override them when set.
|
|
194
|
+
*/
|
|
195
|
+
private getCustomContentStyle;
|
|
172
196
|
/**
|
|
173
197
|
* The avatar size as a px string. Exposed on the host as `--hub-avatar-size`
|
|
174
198
|
* so the status dot (and any token-driven child) scales with the avatar.
|
|
@@ -234,7 +258,7 @@ declare class AvatarComponent implements OnChanges, OnDestroy {
|
|
|
234
258
|
*/
|
|
235
259
|
private removeSource;
|
|
236
260
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AvatarComponent, never>;
|
|
237
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AvatarComponent, "hub-avatar", never, { "round": { "alias": "round"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "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; }; "borderColor": { "alias": "borderColor"; "required": false; "isSignal": true; }; "style": { "alias": "style"; "required": false; "isSignal": true; }; "cornerRadius": { "alias": "cornerRadius"; "required": false; "isSignal": true; }; "facebook": { "alias": "facebookId"; "required": false; "isSignal": true; }; "gravatar": { "alias": "gravatarId"; "required": false; "isSignal": true; }; "github": { "alias": "githubId"; "required": false; "isSignal": true; }; "custom": { "alias": "src"; "required": false; "isSignal": true; }; "customAlt": { "alias": "alt"; "required": false; "isSignal": true; }; "initials": { "alias": "name"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "referrerpolicy": { "alias": "referrerpolicy"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "initialsSize": { "alias": "initialsSize"; "required": false; "isSignal": true; }; "status": { "alias": "status"; "required": false; "isSignal": true; }; }, { "clickOnAvatar": "clickOnAvatar"; }, never,
|
|
261
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AvatarComponent, "hub-avatar", never, { "round": { "alias": "round"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "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; }; "borderColor": { "alias": "borderColor"; "required": false; "isSignal": true; }; "style": { "alias": "style"; "required": false; "isSignal": true; }; "cornerRadius": { "alias": "cornerRadius"; "required": false; "isSignal": true; }; "facebook": { "alias": "facebookId"; "required": false; "isSignal": true; }; "gravatar": { "alias": "gravatarId"; "required": false; "isSignal": true; }; "github": { "alias": "githubId"; "required": false; "isSignal": true; }; "custom": { "alias": "src"; "required": false; "isSignal": true; }; "customAlt": { "alias": "alt"; "required": false; "isSignal": true; }; "initials": { "alias": "name"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "referrerpolicy": { "alias": "referrerpolicy"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "initialsSize": { "alias": "initialsSize"; "required": false; "isSignal": true; }; "status": { "alias": "status"; "required": false; "isSignal": true; }; }, { "clickOnAvatar": "clickOnAvatar"; }, never, ["*"], false, never>;
|
|
238
262
|
}
|
|
239
263
|
|
|
240
264
|
declare class AvatarModule {
|