ng-hub-ui-avatar 22.2.1 → 22.5.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/README.md +89 -55
- package/fesm2022/ng-hub-ui-avatar.mjs +102 -24
- package/fesm2022/ng-hub-ui-avatar.mjs.map +1 -1
- package/ng-hub-ui-avatar-22.3.0.tgz +0 -0
- package/ng-hub-ui-avatar-22.4.0.tgz +0 -0
- package/ng-hub-ui-avatar-22.5.0.tgz +0 -0
- package/package.json +1 -1
- package/src/lib/styles/mixins/_avatar-theme.scss +103 -32
- package/types/ng-hub-ui-avatar.d.ts +64 -14
package/README.md
CHANGED
|
@@ -86,7 +86,7 @@ Fallback uses a source priority order. By default, the component tries the suppo
|
|
|
86
86
|
- **Flexible Shape**: Round or square avatars with configurable corner radius and border.
|
|
87
87
|
- **CSS Variables**: Full theming via canonical `--hub-avatar-*` custom properties.
|
|
88
88
|
- **Signals API**: Modern Angular inputs/outputs built on signals.
|
|
89
|
-
- **
|
|
89
|
+
- **Standalone-first**: `<hub-avatar>` is a standalone component — import it directly, no `NgModule` required. Customize colors, source priority order and cache behavior via `provideAvatar()`.
|
|
90
90
|
|
|
91
91
|
## Installation
|
|
92
92
|
|
|
@@ -97,59 +97,67 @@ npm install ng-hub-ui-avatar
|
|
|
97
97
|
## Quick Start
|
|
98
98
|
|
|
99
99
|
```typescript
|
|
100
|
-
import {
|
|
101
|
-
import { BrowserModule } from '@angular/platform-browser';
|
|
100
|
+
import { bootstrapApplication } from '@angular/platform-browser';
|
|
102
101
|
import { provideHttpClient } from '@angular/common/http';
|
|
103
|
-
import {
|
|
102
|
+
import { provideAvatar } from 'ng-hub-ui-avatar';
|
|
104
103
|
import { AppComponent } from './app.component';
|
|
105
104
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
})
|
|
112
|
-
export class AppModule {}
|
|
105
|
+
bootstrapApplication(AppComponent, {
|
|
106
|
+
providers: [
|
|
107
|
+
provideHttpClient(), // required for async remote sources (Gravatar, GitHub…)
|
|
108
|
+
provideAvatar() // optional — pass a config to customise sources/colours/cache
|
|
109
|
+
]
|
|
110
|
+
});
|
|
113
111
|
```
|
|
114
112
|
|
|
115
|
-
|
|
113
|
+
Then import the standalone component and use it in any template:
|
|
116
114
|
|
|
117
|
-
|
|
115
|
+
```typescript
|
|
116
|
+
import { Component } from '@angular/core';
|
|
117
|
+
import { AvatarComponent } from 'ng-hub-ui-avatar';
|
|
118
118
|
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
@Component({
|
|
120
|
+
selector: 'app-profile',
|
|
121
|
+
standalone: true,
|
|
122
|
+
imports: [AvatarComponent],
|
|
123
|
+
template: `<hub-avatar name="John Doe" [round]="true" size="64"></hub-avatar>`
|
|
124
|
+
})
|
|
125
|
+
export class ProfileComponent {}
|
|
121
126
|
```
|
|
122
127
|
|
|
128
|
+
> `provideAvatar()` is optional — `<hub-avatar>` works out of the box with defaults. `HttpClient` is only needed for async remote sources (Gravatar, GitHub).
|
|
129
|
+
|
|
123
130
|
## Usage
|
|
124
131
|
|
|
125
|
-
|
|
132
|
+
`<hub-avatar>` is a **standalone** component: import `AvatarComponent` directly into the `imports` of any standalone component (as shown above). No `NgModule` is required.
|
|
126
133
|
|
|
127
|
-
###
|
|
134
|
+
### Configuration
|
|
128
135
|
|
|
129
|
-
|
|
130
|
-
import { AvatarModule } from 'ng-hub-ui-avatar';
|
|
136
|
+
Customise source priority, colour palette or src-cache behaviour with `provideAvatar()`:
|
|
131
137
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
|
|
138
|
+
```typescript
|
|
139
|
+
import { provideAvatar } from 'ng-hub-ui-avatar';
|
|
140
|
+
import { AvatarSource } from 'ng-hub-ui-avatar';
|
|
141
|
+
|
|
142
|
+
providers: [
|
|
143
|
+
provideAvatar({
|
|
144
|
+
sourcePriorityOrder: [AvatarSource.CUSTOM, AvatarSource.GRAVATAR, AvatarSource.INITIALS],
|
|
145
|
+
colors: ['#1abc9c', '#3498db', '#9b59b6']
|
|
146
|
+
})
|
|
147
|
+
];
|
|
136
148
|
```
|
|
137
149
|
|
|
138
|
-
###
|
|
150
|
+
### Legacy `NgModule` (deprecated)
|
|
139
151
|
|
|
140
|
-
|
|
152
|
+
`AvatarModule` is still exported for backward compatibility and now simply re-exports the standalone component. It is **deprecated** — prefer importing `AvatarComponent` and using `provideAvatar()`.
|
|
141
153
|
|
|
142
154
|
```typescript
|
|
143
|
-
import {
|
|
144
|
-
import { AvatarModule } from 'ng-hub-ui-avatar';
|
|
155
|
+
import { AvatarModule } from 'ng-hub-ui-avatar'; // deprecated
|
|
145
156
|
|
|
146
|
-
@
|
|
147
|
-
|
|
148
|
-
standalone: true,
|
|
149
|
-
imports: [AvatarModule],
|
|
150
|
-
template: `<hub-avatar name="John Doe" [round]="true" size="64"></hub-avatar>`
|
|
157
|
+
@NgModule({
|
|
158
|
+
imports: [AvatarModule] // AvatarModule.forRoot(config) still works too
|
|
151
159
|
})
|
|
152
|
-
export class
|
|
160
|
+
export class FeatureModule {}
|
|
153
161
|
```
|
|
154
162
|
|
|
155
163
|
### Examples
|
|
@@ -254,9 +262,10 @@ export class AppModule {}
|
|
|
254
262
|
| `style` | `Record<string, any> \| string` | `{}` | Custom inline styles merged into avatar styles |
|
|
255
263
|
| `placeholder` | `string` | `undefined` | Reserved placeholder input |
|
|
256
264
|
| `referrerpolicy` | `string \| null` | `undefined` | Referrer policy for avatar image requests |
|
|
257
|
-
| `
|
|
265
|
+
| `badge` | `string \| number \| boolean \| null` | `null` | Corner overlay. `badge` / `[badge]="true"` → a **dot**; `badge="4k"` / `[badge]="9"` → a **labelled** pill; `null` / absent → nothing. |
|
|
266
|
+
| `badgeColor` | `HubAvatarBadgeColor \| string \| null` | `null` | Semantic colour of the badge: `primary · secondary · success · danger · warning · info · light · dark` (→ `--hub-sys-color-*`). Any custom string also works (set `--hub-avatar-badge-color`). |
|
|
258
267
|
|
|
259
|
-
`
|
|
268
|
+
`HubAvatarBadgeColor` is an exported type covering the semantic colours: `'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark'`. Express presence with the colour: online → `success`, away → `warning`, busy → `danger`, offline → `secondary`.
|
|
260
269
|
|
|
261
270
|
### Outputs
|
|
262
271
|
|
|
@@ -318,33 +327,58 @@ hub-avatar {
|
|
|
318
327
|
}
|
|
319
328
|
```
|
|
320
329
|
|
|
321
|
-
###
|
|
330
|
+
### Badge (dot or labelled)
|
|
322
331
|
|
|
323
|
-
|
|
332
|
+
The `badge` input renders a corner overlay — a plain **dot** (great for presence) or a **labelled** pill (a count / text). Colour it with the semantic `badgeColor` input. Everything scales with the avatar.
|
|
324
333
|
|
|
325
334
|
```html
|
|
326
|
-
|
|
327
|
-
<hub-avatar name="
|
|
328
|
-
<hub-avatar name="
|
|
335
|
+
<!-- presence dot: badge (no content) + a semantic colour -->
|
|
336
|
+
<hub-avatar name="Ada Lovelace" badge badgeColor="success"></hub-avatar> <!-- online -->
|
|
337
|
+
<hub-avatar name="Grace Hopper" badge badgeColor="warning"></hub-avatar> <!-- away -->
|
|
338
|
+
<hub-avatar name="Alan Turing" badge badgeColor="danger"></hub-avatar> <!-- busy -->
|
|
339
|
+
<hub-avatar name="Linus T" badge badgeColor="secondary"></hub-avatar> <!-- offline -->
|
|
340
|
+
|
|
341
|
+
<!-- labelled badge -->
|
|
342
|
+
<hub-avatar name="Carlos M" badge="4k" badgeColor="danger"></hub-avatar>
|
|
329
343
|
```
|
|
330
344
|
|
|
331
|
-
|
|
345
|
+
`badgeColor` maps to `--hub-sys-color-*`. For a custom colour, set `--hub-avatar-badge-color` (per element or via the [colour-variants mixin](#colour-variants--mixins)):
|
|
332
346
|
|
|
333
347
|
```scss
|
|
334
|
-
hub-avatar[data-
|
|
335
|
-
--hub-avatar-
|
|
348
|
+
hub-avatar[data-badge-color='brand'] {
|
|
349
|
+
--hub-avatar-badge-color: #9333ea;
|
|
336
350
|
}
|
|
337
351
|
```
|
|
338
352
|
|
|
339
|
-
|
|
353
|
+
Badge tokens:
|
|
354
|
+
|
|
355
|
+
| Variable | Default | Usage |
|
|
356
|
+
| --------------------------------- | ----------------------------------------------------- | -------------------------------------- |
|
|
357
|
+
| `--hub-avatar-badge-size` | `calc(var(--hub-avatar-size, 50px) * 0.28)` | Dot diameter / label min-height |
|
|
358
|
+
| `--hub-avatar-badge-offset` | `0px` | Inset from the bottom-end corner |
|
|
359
|
+
| `--hub-avatar-badge-ring-width` | `max(2px, calc(var(--hub-avatar-size, 50px) * 0.05))` | Width of the ring around the badge |
|
|
360
|
+
| `--hub-avatar-badge-ring-color` | `var(--hub-sys-surface-page, #fff)` | Colour of the ring around the badge |
|
|
361
|
+
| `--hub-avatar-badge-color` | `var(--hub-sys-color-secondary, #6c757d)` | Badge fill (semantic via `badgeColor`) |
|
|
362
|
+
| `--hub-avatar-badge-text-color` | `var(--hub-ref-color-white, #fff)` | Badge label text colour |
|
|
363
|
+
| `--hub-avatar-badge-font-size` | `calc(var(--hub-avatar-size, 50px) * 0.22)` | Badge label font size |
|
|
364
|
+
| `--hub-avatar-badge-padding` | `calc(var(--hub-avatar-size, 50px) * 0.08)` | Badge label inline padding |
|
|
365
|
+
|
|
366
|
+
### Colour variants & mixins
|
|
367
|
+
|
|
368
|
+
Every semantic colour works out of the box, both for the badge (`badgeColor="success"`) and as a coloured **avatar circle** (`class="hub-avatar--success"`). To (re)generate these in your own CSS — or to register a **custom colour** (e.g. a brand colour) — use the `hub-avatar-color-variants()` mixin, which emits the avatar **and** badge variants in one loop over a colour map:
|
|
340
369
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
370
|
+
```scss
|
|
371
|
+
@use 'ng-hub-ui-avatar/styles/mixins/avatar-theme' as avatar;
|
|
372
|
+
|
|
373
|
+
// the eight semantic colours (default)
|
|
374
|
+
@include avatar.hub-avatar-color-variants();
|
|
375
|
+
|
|
376
|
+
// add your own — generates <hub-avatar class="hub-avatar--brand"> and badgeColor="brand"
|
|
377
|
+
@include avatar.hub-avatar-color-variants((
|
|
378
|
+
'brand': var(--my-brand),
|
|
379
|
+
'accent': #00d4aa
|
|
380
|
+
));
|
|
381
|
+
```
|
|
348
382
|
|
|
349
383
|
### Avatar group
|
|
350
384
|
|
|
@@ -368,18 +402,18 @@ Group tokens:
|
|
|
368
402
|
|
|
369
403
|
### Sass theming mixin
|
|
370
404
|
|
|
371
|
-
The `hub-avatar-theme()` mixin themes an avatar in a single include — shape/surface, initials typography, the
|
|
405
|
+
The `hub-avatar-theme()` mixin themes an avatar in a single include — shape/surface, initials typography, projected-content sizing, the badge and the group ring. Every parameter is optional and defaults to `null`, so only the ones you pass are emitted as `--hub-avatar-*` overrides. It is token-based, with no Bootstrap dependency.
|
|
372
406
|
|
|
373
407
|
```scss
|
|
374
|
-
@use 'ng-hub-ui-avatar/styles/mixins/avatar-theme' as
|
|
408
|
+
@use 'ng-hub-ui-avatar/styles/mixins/avatar-theme' as avatar;
|
|
375
409
|
|
|
376
410
|
hub-avatar.brand {
|
|
377
|
-
@include hub-avatar-theme(
|
|
411
|
+
@include avatar.hub-avatar-theme(
|
|
378
412
|
$size: 64px,
|
|
379
413
|
$border-radius: 1rem,
|
|
380
414
|
$bg: #ede9fe,
|
|
381
415
|
$fg: #5b21b6,
|
|
382
|
-
$
|
|
416
|
+
$badge-color: #f43f5e
|
|
383
417
|
);
|
|
384
418
|
}
|
|
385
419
|
```
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, Optional, Inject, Injectable, input, output, SecurityContext, ViewChild, Component, NgModule } from '@angular/core';
|
|
2
|
+
import { InjectionToken, Optional, Inject, Injectable, input, computed, output, SecurityContext, ViewChild, Component, NgModule, makeEnvironmentProviders } 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';
|
|
6
6
|
import { Md5 } from 'ts-md5';
|
|
7
|
-
import { CommonModule } from '@angular/common';
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* Token used to inject the AvatarConfig object
|
|
@@ -408,13 +407,40 @@ class AvatarComponent {
|
|
|
408
407
|
initialsSize = input(0, /* @ts-ignore */
|
|
409
408
|
...(ngDevMode ? [{ debugName: "initialsSize" }] : /* istanbul ignore next */ []));
|
|
410
409
|
/**
|
|
411
|
-
*
|
|
412
|
-
*
|
|
413
|
-
* (
|
|
414
|
-
*
|
|
410
|
+
* Overlay badge at the bottom-end corner. A boolean / empty value renders a plain
|
|
411
|
+
* dot (great for a presence indicator); a string or number renders a labelled badge
|
|
412
|
+
* (e.g. a count like `"4k"`). `null` / absent (default) renders nothing.
|
|
413
|
+
*
|
|
414
|
+
* @example <hub-avatar badge badgeColor="success" /> // dot
|
|
415
|
+
* @example <hub-avatar badge="4k" badgeColor="danger" /> // labelled
|
|
416
|
+
*/
|
|
417
|
+
badge = input(null, /* @ts-ignore */
|
|
418
|
+
...(ngDevMode ? [{ debugName: "badge" }] : /* istanbul ignore next */ []));
|
|
419
|
+
/**
|
|
420
|
+
* Semantic colour of the {@link badge} (and, as a host class, of the avatar itself).
|
|
421
|
+
* Maps to a `--hub-sys-color-*` token; any custom string also works (set
|
|
422
|
+
* `--hub-avatar-badge-color`). When unset the badge uses a neutral default.
|
|
415
423
|
*/
|
|
416
|
-
|
|
417
|
-
...(ngDevMode ? [{ debugName: "
|
|
424
|
+
badgeColor = input(null, /* @ts-ignore */
|
|
425
|
+
...(ngDevMode ? [{ debugName: "badgeColor" }] : /* istanbul ignore next */ []));
|
|
426
|
+
/** True when a badge should be rendered (the `badge` input is set to anything but `null` / `false`). */
|
|
427
|
+
_hasBadge = computed(() => {
|
|
428
|
+
const b = this.badge();
|
|
429
|
+
return b !== null && b !== undefined && b !== false;
|
|
430
|
+
}, /* @ts-ignore */
|
|
431
|
+
...(ngDevMode ? [{ debugName: "_hasBadge" }] : /* istanbul ignore next */ []));
|
|
432
|
+
/** The badge's text content; empty for a plain dot (`badge` is `true` or an empty string). */
|
|
433
|
+
_badgeText = computed(() => {
|
|
434
|
+
const b = this.badge();
|
|
435
|
+
if (b === true || b === '' || b === null || b === undefined || b === false) {
|
|
436
|
+
return '';
|
|
437
|
+
}
|
|
438
|
+
return String(b);
|
|
439
|
+
}, /* @ts-ignore */
|
|
440
|
+
...(ngDevMode ? [{ debugName: "_badgeText" }] : /* istanbul ignore next */ []));
|
|
441
|
+
/** True when the badge is a plain dot (shown, but with no text content). */
|
|
442
|
+
_isDot = computed(() => this._hasBadge() && this._badgeText() === '', /* @ts-ignore */
|
|
443
|
+
...(ngDevMode ? [{ debugName: "_isDot" }] : /* istanbul ignore next */ []));
|
|
418
444
|
clickOnAvatar = output();
|
|
419
445
|
/** Wrapper around the projected content (`<ng-content>`), used to detect whether the consumer projected anything. */
|
|
420
446
|
customContentRef;
|
|
@@ -697,7 +723,7 @@ class AvatarComponent {
|
|
|
697
723
|
this.sources = this.sources.filter((source) => source.sourceType !== sourceType);
|
|
698
724
|
}
|
|
699
725
|
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 });
|
|
700
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.1", type: AvatarComponent, isStandalone:
|
|
726
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.1", type: AvatarComponent, isStandalone: true, 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 }, badge: { classPropertyName: "badge", publicName: "badge", isSignal: true, isRequired: false, transformFunction: null }, badgeColor: { classPropertyName: "badgeColor", publicName: "badgeColor", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clickOnAvatar: "clickOnAvatar" }, host: { properties: { "attr.data-badge-color": "badgeColor() || null", "style.--hub-avatar-size": "avatarSizePx" } }, viewQueries: [{ propertyName: "customContentRef", first: true, predicate: ["customContent"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: `
|
|
701
727
|
<div (click)="onAvatarClicked()" class="avatar-container" [class.hub-avatar--custom]="hasCustomContent" [style]="hostStyle">
|
|
702
728
|
<span #customContent class="hub-avatar__custom" [style]="customContentStyle"><ng-content></ng-content></span>
|
|
703
729
|
@if (!hasCustomContent) {
|
|
@@ -722,14 +748,20 @@ class AvatarComponent {
|
|
|
722
748
|
}
|
|
723
749
|
}
|
|
724
750
|
</div>
|
|
725
|
-
@if (
|
|
726
|
-
<span
|
|
751
|
+
@if (_hasBadge()) {
|
|
752
|
+
<span
|
|
753
|
+
class="hub-avatar__badge"
|
|
754
|
+
[class.hub-avatar__badge--dot]="_isDot()"
|
|
755
|
+
[class.hub-avatar__badge--label]="!_isDot()"
|
|
756
|
+
[attr.aria-hidden]="_isDot() ? 'true' : null"
|
|
757
|
+
>{{ _badgeText() }}</span
|
|
758
|
+
>
|
|
727
759
|
}
|
|
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-
|
|
760
|
+
`, 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-accent: var(--hub-sys-color-primary, #0d6efd);--hub-avatar-accent-emphasis: color-mix(in oklch, var(--hub-avatar-accent) 80%, var(--hub-sys-color-ink, #212529));--hub-avatar-accent-subtle: color-mix(in oklch, var(--hub-avatar-accent) 12%, var(--hub-sys-surface-page, #fff));--hub-avatar-accent-on: oklch(from var(--hub-avatar-accent) clamp(0, (.62 - l) * 1000, 1) 0 h);--hub-avatar-fg-color: var(--hub-avatar-accent-on, var(--hub-ref-color-white, #fff));--hub-avatar-bg-color: var(--hub-avatar-accent, 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-badge-size: calc(var(--hub-avatar-size, 50px) * .28);--hub-avatar-badge-offset: 0px;--hub-avatar-badge-ring-width: max(2px, calc(var(--hub-avatar-size, 50px) * .05));--hub-avatar-badge-ring-color: var(--hub-sys-surface-page, #fff);--hub-avatar-badge-color: var(--hub-sys-color-secondary, #6c757d);--hub-avatar-badge-text-color: var(--hub-ref-color-white, #fff);--hub-avatar-badge-font-size: calc(var(--hub-avatar-size, 50px) * .22);--hub-avatar-badge-padding: calc(var(--hub-avatar-size, 50px) * .08);--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__badge{position:absolute;inset-block-end:var(--hub-avatar-badge-offset, 0px);inset-inline-end:var(--hub-avatar-badge-offset, 0px);box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;background:var(--hub-avatar-badge-color, var(--hub-sys-color-secondary, #6c757d));color:var(--hub-avatar-badge-text-color, var(--hub-ref-color-white, #fff));box-shadow:0 0 0 var(--hub-avatar-badge-ring-width, 2px) var(--hub-avatar-badge-ring-color, var(--hub-sys-surface-page, #fff))}.hub-avatar__badge--dot{width:var(--hub-avatar-badge-size, calc(var(--hub-avatar-size, 50px) * .28));height:var(--hub-avatar-badge-size, calc(var(--hub-avatar-size, 50px) * .28));border-radius:50%}.hub-avatar__badge--label{min-width:var(--hub-avatar-badge-size, calc(var(--hub-avatar-size, 50px) * .28));height:var(--hub-avatar-badge-size, calc(var(--hub-avatar-size, 50px) * .28));padding-inline:var(--hub-avatar-badge-padding, calc(var(--hub-avatar-size, 50px) * .08));border-radius:var(--hub-sys-radius-pill, 50rem);font-family:var(--hub-avatar-font-family, Helvetica, Arial, sans-serif);font-size:var(--hub-avatar-badge-font-size, calc(var(--hub-avatar-size, 50px) * .22));font-weight:var(--hub-ref-font-weight-bold, 700);line-height:1}:host([data-badge-color=primary]){--hub-avatar-badge-color: var(--hub-sys-color-primary)}:host(.hub-avatar--primary){--hub-avatar-accent: var(--hub-sys-color-primary)}:host([data-badge-color=secondary]){--hub-avatar-badge-color: var(--hub-sys-color-secondary)}:host(.hub-avatar--secondary){--hub-avatar-accent: var(--hub-sys-color-secondary)}:host([data-badge-color=success]){--hub-avatar-badge-color: var(--hub-sys-color-success)}:host(.hub-avatar--success){--hub-avatar-accent: var(--hub-sys-color-success)}:host([data-badge-color=danger]){--hub-avatar-badge-color: var(--hub-sys-color-danger)}:host(.hub-avatar--danger){--hub-avatar-accent: var(--hub-sys-color-danger)}:host([data-badge-color=warning]){--hub-avatar-badge-color: var(--hub-sys-color-warning)}:host(.hub-avatar--warning){--hub-avatar-accent: var(--hub-sys-color-warning)}:host([data-badge-color=info]){--hub-avatar-badge-color: var(--hub-sys-color-info)}:host(.hub-avatar--info){--hub-avatar-accent: var(--hub-sys-color-info)}:host([data-badge-color=neutral]){--hub-avatar-badge-color: var(--hub-sys-color-neutral)}:host(.hub-avatar--neutral){--hub-avatar-accent: var(--hub-sys-color-neutral)}:host([data-badge-color=light]){--hub-avatar-badge-color: var(--hub-sys-color-light)}:host(.hub-avatar--light){--hub-avatar-accent: var(--hub-sys-color-light)}:host([data-badge-color=dark]){--hub-avatar-badge-color: var(--hub-sys-color-dark)}:host(.hub-avatar--dark){--hub-avatar-accent: var(--hub-sys-color-dark)}:host([data-badge-color=warning]),:host([data-badge-color=light]){--hub-avatar-badge-text-color: var(--hub-sys-text-primary, #212529)}.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"] });
|
|
729
761
|
}
|
|
730
762
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: AvatarComponent, decorators: [{
|
|
731
763
|
type: Component,
|
|
732
|
-
args: [{ selector: 'hub-avatar', standalone:
|
|
764
|
+
args: [{ selector: 'hub-avatar', standalone: true, template: `
|
|
733
765
|
<div (click)="onAvatarClicked()" class="avatar-container" [class.hub-avatar--custom]="hasCustomContent" [style]="hostStyle">
|
|
734
766
|
<span #customContent class="hub-avatar__custom" [style]="customContentStyle"><ng-content></ng-content></span>
|
|
735
767
|
@if (!hasCustomContent) {
|
|
@@ -754,19 +786,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImpor
|
|
|
754
786
|
}
|
|
755
787
|
}
|
|
756
788
|
</div>
|
|
757
|
-
@if (
|
|
758
|
-
<span
|
|
789
|
+
@if (_hasBadge()) {
|
|
790
|
+
<span
|
|
791
|
+
class="hub-avatar__badge"
|
|
792
|
+
[class.hub-avatar__badge--dot]="_isDot()"
|
|
793
|
+
[class.hub-avatar__badge--label]="!_isDot()"
|
|
794
|
+
[attr.aria-hidden]="_isDot() ? 'true' : null"
|
|
795
|
+
>{{ _badgeText() }}</span
|
|
796
|
+
>
|
|
759
797
|
}
|
|
760
798
|
`, host: {
|
|
761
|
-
'[attr.data-
|
|
799
|
+
'[attr.data-badge-color]': 'badgeColor() || null',
|
|
762
800
|
'[style.--hub-avatar-size]': 'avatarSizePx'
|
|
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-
|
|
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 }] }],
|
|
801
|
+
}, 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-accent: var(--hub-sys-color-primary, #0d6efd);--hub-avatar-accent-emphasis: color-mix(in oklch, var(--hub-avatar-accent) 80%, var(--hub-sys-color-ink, #212529));--hub-avatar-accent-subtle: color-mix(in oklch, var(--hub-avatar-accent) 12%, var(--hub-sys-surface-page, #fff));--hub-avatar-accent-on: oklch(from var(--hub-avatar-accent) clamp(0, (.62 - l) * 1000, 1) 0 h);--hub-avatar-fg-color: var(--hub-avatar-accent-on, var(--hub-ref-color-white, #fff));--hub-avatar-bg-color: var(--hub-avatar-accent, 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-badge-size: calc(var(--hub-avatar-size, 50px) * .28);--hub-avatar-badge-offset: 0px;--hub-avatar-badge-ring-width: max(2px, calc(var(--hub-avatar-size, 50px) * .05));--hub-avatar-badge-ring-color: var(--hub-sys-surface-page, #fff);--hub-avatar-badge-color: var(--hub-sys-color-secondary, #6c757d);--hub-avatar-badge-text-color: var(--hub-ref-color-white, #fff);--hub-avatar-badge-font-size: calc(var(--hub-avatar-size, 50px) * .22);--hub-avatar-badge-padding: calc(var(--hub-avatar-size, 50px) * .08);--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__badge{position:absolute;inset-block-end:var(--hub-avatar-badge-offset, 0px);inset-inline-end:var(--hub-avatar-badge-offset, 0px);box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;background:var(--hub-avatar-badge-color, var(--hub-sys-color-secondary, #6c757d));color:var(--hub-avatar-badge-text-color, var(--hub-ref-color-white, #fff));box-shadow:0 0 0 var(--hub-avatar-badge-ring-width, 2px) var(--hub-avatar-badge-ring-color, var(--hub-sys-surface-page, #fff))}.hub-avatar__badge--dot{width:var(--hub-avatar-badge-size, calc(var(--hub-avatar-size, 50px) * .28));height:var(--hub-avatar-badge-size, calc(var(--hub-avatar-size, 50px) * .28));border-radius:50%}.hub-avatar__badge--label{min-width:var(--hub-avatar-badge-size, calc(var(--hub-avatar-size, 50px) * .28));height:var(--hub-avatar-badge-size, calc(var(--hub-avatar-size, 50px) * .28));padding-inline:var(--hub-avatar-badge-padding, calc(var(--hub-avatar-size, 50px) * .08));border-radius:var(--hub-sys-radius-pill, 50rem);font-family:var(--hub-avatar-font-family, Helvetica, Arial, sans-serif);font-size:var(--hub-avatar-badge-font-size, calc(var(--hub-avatar-size, 50px) * .22));font-weight:var(--hub-ref-font-weight-bold, 700);line-height:1}:host([data-badge-color=primary]){--hub-avatar-badge-color: var(--hub-sys-color-primary)}:host(.hub-avatar--primary){--hub-avatar-accent: var(--hub-sys-color-primary)}:host([data-badge-color=secondary]){--hub-avatar-badge-color: var(--hub-sys-color-secondary)}:host(.hub-avatar--secondary){--hub-avatar-accent: var(--hub-sys-color-secondary)}:host([data-badge-color=success]){--hub-avatar-badge-color: var(--hub-sys-color-success)}:host(.hub-avatar--success){--hub-avatar-accent: var(--hub-sys-color-success)}:host([data-badge-color=danger]){--hub-avatar-badge-color: var(--hub-sys-color-danger)}:host(.hub-avatar--danger){--hub-avatar-accent: var(--hub-sys-color-danger)}:host([data-badge-color=warning]){--hub-avatar-badge-color: var(--hub-sys-color-warning)}:host(.hub-avatar--warning){--hub-avatar-accent: var(--hub-sys-color-warning)}:host([data-badge-color=info]){--hub-avatar-badge-color: var(--hub-sys-color-info)}:host(.hub-avatar--info){--hub-avatar-accent: var(--hub-sys-color-info)}:host([data-badge-color=neutral]){--hub-avatar-badge-color: var(--hub-sys-color-neutral)}:host(.hub-avatar--neutral){--hub-avatar-accent: var(--hub-sys-color-neutral)}:host([data-badge-color=light]){--hub-avatar-badge-color: var(--hub-sys-color-light)}:host(.hub-avatar--light){--hub-avatar-accent: var(--hub-sys-color-light)}:host([data-badge-color=dark]){--hub-avatar-badge-color: var(--hub-sys-color-dark)}:host(.hub-avatar--dark){--hub-avatar-accent: var(--hub-sys-color-dark)}:host([data-badge-color=warning]),:host([data-badge-color=light]){--hub-avatar-badge-text-color: var(--hub-sys-text-primary, #212529)}.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"] }]
|
|
802
|
+
}], 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 }] }], badge: [{ type: i0.Input, args: [{ isSignal: true, alias: "badge", required: false }] }], badgeColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "badgeColor", required: false }] }], clickOnAvatar: [{ type: i0.Output, args: ["clickOnAvatar"] }], customContentRef: [{
|
|
765
803
|
type: ViewChild,
|
|
766
804
|
args: ['customContent', { static: true }]
|
|
767
805
|
}] } });
|
|
768
806
|
|
|
807
|
+
/**
|
|
808
|
+
* Backward-compatibility module for `<hub-avatar>`.
|
|
809
|
+
*
|
|
810
|
+
* @deprecated `AvatarComponent` is now a standalone component. Import it directly
|
|
811
|
+
* (`imports: [AvatarComponent]`) and, if you need custom configuration, register
|
|
812
|
+
* `provideAvatar()` in your application providers. This module only re-exports the
|
|
813
|
+
* standalone component and will be removed in a future major version.
|
|
814
|
+
*/
|
|
769
815
|
class AvatarModule {
|
|
816
|
+
/**
|
|
817
|
+
* @deprecated Use `provideAvatar(config)` with the standalone APIs instead.
|
|
818
|
+
* Kept so existing `AvatarModule.forRoot()` consumers keep working.
|
|
819
|
+
*/
|
|
770
820
|
static forRoot(avatarConfig) {
|
|
771
821
|
return {
|
|
772
822
|
ngModule: AvatarModule,
|
|
@@ -779,19 +829,47 @@ class AvatarModule {
|
|
|
779
829
|
};
|
|
780
830
|
}
|
|
781
831
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: AvatarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
782
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.1", ngImport: i0, type: AvatarModule,
|
|
783
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: AvatarModule
|
|
832
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.1", ngImport: i0, type: AvatarModule, imports: [AvatarComponent], exports: [AvatarComponent] });
|
|
833
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: AvatarModule });
|
|
784
834
|
}
|
|
785
835
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: AvatarModule, decorators: [{
|
|
786
836
|
type: NgModule,
|
|
787
837
|
args: [{
|
|
788
|
-
imports: [
|
|
789
|
-
declarations: [AvatarComponent],
|
|
790
|
-
providers: [SourceFactory, AvatarService, AvatarConfigService],
|
|
838
|
+
imports: [AvatarComponent],
|
|
791
839
|
exports: [AvatarComponent]
|
|
792
840
|
}]
|
|
793
841
|
}] });
|
|
794
842
|
|
|
843
|
+
/**
|
|
844
|
+
* Registers the avatar configuration for standalone applications.
|
|
845
|
+
*
|
|
846
|
+
* Standalone-friendly replacement for `AvatarModule.forRoot()`. Add it to your
|
|
847
|
+
* `bootstrapApplication` providers (or a route's `providers`) to customise the
|
|
848
|
+
* avatar source priority, colour palette or src-cache behaviour. Calling it is
|
|
849
|
+
* optional — `<hub-avatar>` works out of the box with sensible defaults.
|
|
850
|
+
*
|
|
851
|
+
* ```ts
|
|
852
|
+
* import { provideAvatar } from 'ng-hub-ui-avatar';
|
|
853
|
+
*
|
|
854
|
+
* bootstrapApplication(AppComponent, {
|
|
855
|
+
* providers: [
|
|
856
|
+
* provideAvatar({ sourcePriorityOrder: [AvatarSource.GRAVATAR, AvatarSource.INITIALS] })
|
|
857
|
+
* ]
|
|
858
|
+
* });
|
|
859
|
+
* ```
|
|
860
|
+
*
|
|
861
|
+
* @param config Optional avatar configuration.
|
|
862
|
+
* @returns Environment providers to add to the application config.
|
|
863
|
+
*/
|
|
864
|
+
function provideAvatar(config) {
|
|
865
|
+
return makeEnvironmentProviders([
|
|
866
|
+
{
|
|
867
|
+
provide: AVATAR_CONFIG,
|
|
868
|
+
useValue: config ?? {}
|
|
869
|
+
}
|
|
870
|
+
]);
|
|
871
|
+
}
|
|
872
|
+
|
|
795
873
|
/*
|
|
796
874
|
* Public API Surface of ng-hub-ui-avatar
|
|
797
875
|
*/
|
|
@@ -800,5 +878,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImpor
|
|
|
800
878
|
* Generated bundle index. Do not edit.
|
|
801
879
|
*/
|
|
802
880
|
|
|
803
|
-
export { AvatarComponent, AvatarModule, AvatarService, AvatarSource, defaultColors, defaultDisableSrcCache, defaultSources };
|
|
881
|
+
export { AvatarComponent, AvatarModule, AvatarService, AvatarSource, defaultColors, defaultDisableSrcCache, defaultSources, provideAvatar };
|
|
804
882
|
//# sourceMappingURL=ng-hub-ui-avatar.mjs.map
|
|
@@ -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 { 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":";;;;;;;;A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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/lib/avatar.providers.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, computed, 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 * Semantic colours for the avatar badge and the avatar colour variants. Each maps\n * to a design-system `--hub-sys-color-*` token. Use them to colour a presence dot\n * (e.g. `success` = online, `warning` = away, `danger` = busy, `secondary` = offline)\n * or a labelled badge. Any custom string is also accepted (set `--hub-avatar-badge-color`).\n */\nexport type HubAvatarBadgeColor = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark';\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: true,\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 (_hasBadge()) {\n\t\t\t<span\n\t\t\t\tclass=\"hub-avatar__badge\"\n\t\t\t\t[class.hub-avatar__badge--dot]=\"_isDot()\"\n\t\t\t\t[class.hub-avatar__badge--label]=\"!_isDot()\"\n\t\t\t\t[attr.aria-hidden]=\"_isDot() ? 'true' : null\"\n\t\t\t\t>{{ _badgeText() }}</span\n\t\t\t>\n\t\t}\n\t`,\n\thost: {\n\t\t'[attr.data-badge-color]': 'badgeColor() || 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 * Overlay badge at the bottom-end corner. A boolean / empty value renders a plain\n\t * dot (great for a presence indicator); a string or number renders a labelled badge\n\t * (e.g. a count like `\"4k\"`). `null` / absent (default) renders nothing.\n\t *\n\t * @example <hub-avatar badge badgeColor=\"success\" /> // dot\n\t * @example <hub-avatar badge=\"4k\" badgeColor=\"danger\" /> // labelled\n\t */\n\treadonly badge = input<string | number | boolean | null>(null);\n\n\t/**\n\t * Semantic colour of the {@link badge} (and, as a host class, of the avatar itself).\n\t * Maps to a `--hub-sys-color-*` token; any custom string also works (set\n\t * `--hub-avatar-badge-color`). When unset the badge uses a neutral default.\n\t */\n\treadonly badgeColor = input<HubAvatarBadgeColor | (string & {}) | null>(null);\n\n\t/** True when a badge should be rendered (the `badge` input is set to anything but `null` / `false`). */\n\tprotected readonly _hasBadge = computed(() => {\n\t\tconst b = this.badge();\n\t\treturn b !== null && b !== undefined && b !== false;\n\t});\n\n\t/** The badge's text content; empty for a plain dot (`badge` is `true` or an empty string). */\n\tprotected readonly _badgeText = computed(() => {\n\t\tconst b = this.badge();\n\t\tif (b === true || b === '' || b === null || b === undefined || b === false) {\n\t\t\treturn '';\n\t\t}\n\t\treturn String(b);\n\t});\n\n\t/** True when the badge is a plain dot (shown, but with no text content). */\n\tprotected readonly _isDot = computed(() => this._hasBadge() && this._badgeText() === '');\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 { ModuleWithProviders, NgModule } from '@angular/core';\n\nimport { AvatarConfig } from './avatar-config';\nimport { AVATAR_CONFIG } from './avatar-config.token';\nimport { AvatarComponent } from './avatar.component';\n\n/**\n * Backward-compatibility module for `<hub-avatar>`.\n *\n * @deprecated `AvatarComponent` is now a standalone component. Import it directly\n * (`imports: [AvatarComponent]`) and, if you need custom configuration, register\n * `provideAvatar()` in your application providers. This module only re-exports the\n * standalone component and will be removed in a future major version.\n */\n@NgModule({\n\timports: [AvatarComponent],\n\texports: [AvatarComponent]\n})\nexport class AvatarModule {\n\t/**\n\t * @deprecated Use `provideAvatar(config)` with the standalone APIs instead.\n\t * Kept so existing `AvatarModule.forRoot()` consumers keep working.\n\t */\n\tstatic forRoot(avatarConfig?: AvatarConfig): 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","import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { AvatarConfig } from './avatar-config';\nimport { AVATAR_CONFIG } from './avatar-config.token';\n\n/**\n * Registers the avatar configuration for standalone applications.\n *\n * Standalone-friendly replacement for `AvatarModule.forRoot()`. Add it to your\n * `bootstrapApplication` providers (or a route's `providers`) to customise the\n * avatar source priority, colour palette or src-cache behaviour. Calling it is\n * optional — `<hub-avatar>` works out of the box with sensible defaults.\n *\n * ```ts\n * import { provideAvatar } from 'ng-hub-ui-avatar';\n *\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideAvatar({ sourcePriorityOrder: [AvatarSource.GRAVATAR, AvatarSource.INITIALS] })\n * ]\n * });\n * ```\n *\n * @param config Optional avatar configuration.\n * @returns Environment providers to add to the application config.\n */\nexport function provideAvatar(config?: AvatarConfig): EnvironmentProviders {\n\treturn makeEnvironmentProviders([\n\t\t{\n\t\t\tprovide: AVATAR_CONFIG,\n\t\t\tuseValue: config ?? {}\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.providers';\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,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AAA,EAAA,CAAA;wGAAZ,YAAY,EAAA,OAAA,EAAA,CAHd,eAAe,CAAA,EAAA,OAAA,EAAA,CACf,eAAe,CAAA,EAAA,CAAA;wGAEb,YAAY,EAAA,CAAA;;2FAAZ,YAAY,EAAA,UAAA,EAAA,CAAA;kBAJxB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACT,OAAO,EAAE,CAAC,eAAe,CAAC;oBAC1B,OAAO,EAAE,CAAC,eAAe;AACzB,iBAAA;;;ACbD;;;;;;;;;;;;;;;;;;;;AAoBG;AACG,SAAU,aAAa,CAAC,MAAqB,EAAA;AAClD,IAAA,OAAO,wBAAwB,CAAC;AAC/B,QAAA;AACC,YAAA,OAAO,EAAE,aAAa;YACtB,QAAQ,EAAE,MAAM,IAAI;AACpB;AACD,KAAA,CAAC;AACH;;AChCA;;AAEG;;ACFH;;AAEG;;;;"}
|
|
Binary file
|
|
Binary file
|
|
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.5.0",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
7
7
|
"avatar",
|
|
@@ -1,27 +1,75 @@
|
|
|
1
1
|
// ─────────────────────────────────────────────────────────────────────────
|
|
2
|
-
// hub-avatar
|
|
2
|
+
// ng-hub-ui-avatar — consumer SCSS helpers
|
|
3
3
|
// ─────────────────────────────────────────────────────────────────────────
|
|
4
4
|
//
|
|
5
|
-
//
|
|
6
|
-
// parameter is OPTIONAL and defaults to `null`: only the parameters you pass
|
|
7
|
-
// are emitted, so the rest keep the component's defaults. Token-based and
|
|
8
|
-
// self-contained (no Bootstrap dependencies).
|
|
5
|
+
// @use 'ng-hub-ui-avatar/styles/mixins/avatar-theme' as avatar;
|
|
9
6
|
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
7
|
+
// • hub-avatar-theme() — override any --hub-avatar-* token in one call
|
|
8
|
+
// • hub-avatar-color-variants() — emit avatar + badge colour variants in a loop
|
|
9
|
+
// • hub-avatar-badge-color() — set the badge colour from a single value
|
|
10
|
+
//
|
|
11
|
+
// Token-based and self-contained (no Bootstrap dependency).
|
|
12
|
+
|
|
13
|
+
// Default semantic colour map → design-system `--hub-sys-color-*` tokens.
|
|
14
|
+
// Pass your own map (or extend this one) to `hub-avatar-color-variants()`.
|
|
15
|
+
// Mirrors the open accent set (9 canonical variants); each entry feeds the
|
|
16
|
+
// avatar's `--hub-avatar-accent` slot, so the circle fill and its legible
|
|
17
|
+
// foreground (`-on`) follow automatically. Add custom colours (e.g. `brand`) to
|
|
18
|
+
// this map — or pass your own map — and they work the same way.
|
|
19
|
+
$hub-avatar-semantic-colors: (
|
|
20
|
+
'primary': var(--hub-sys-color-primary),
|
|
21
|
+
'secondary': var(--hub-sys-color-secondary),
|
|
22
|
+
'success': var(--hub-sys-color-success),
|
|
23
|
+
'danger': var(--hub-sys-color-danger),
|
|
24
|
+
'warning': var(--hub-sys-color-warning),
|
|
25
|
+
'info': var(--hub-sys-color-info),
|
|
26
|
+
'neutral': var(--hub-sys-color-neutral),
|
|
27
|
+
'light': var(--hub-sys-color-light),
|
|
28
|
+
'dark': var(--hub-sys-color-dark)
|
|
29
|
+
) !default;
|
|
30
|
+
|
|
31
|
+
// ── hub-avatar-color-variants ────────────────────────────────────────────────
|
|
32
|
+
// In ONE loop over `$colors`, emit a coloured-circle variant of the AVATAR and a
|
|
33
|
+
// coloured variant of its BADGE for every entry. The avatar circle re-bases the
|
|
34
|
+
// single `--hub-avatar-accent` slot (not `--hub-avatar-bg-color` directly), so
|
|
35
|
+
// the fill and its legible foreground (`--hub-avatar-accent-on`) follow from one
|
|
36
|
+
// value — light accents get dark text automatically. The nine canonical colours
|
|
37
|
+
// already work out of the box; use this to (re)emit them in your own global CSS,
|
|
38
|
+
// or to register custom colours.
|
|
13
39
|
//
|
|
14
40
|
// @example
|
|
41
|
+
// @include avatar.hub-avatar-color-variants(); // the 9 semantic
|
|
42
|
+
// @include avatar.hub-avatar-color-variants(('brand': var(--brand))); // custom colour
|
|
15
43
|
//
|
|
16
|
-
//
|
|
44
|
+
// <hub-avatar class="hub-avatar--brand"> → brand-coloured circle
|
|
45
|
+
// <hub-avatar badge badgeColor="brand"> → brand-coloured badge
|
|
46
|
+
@mixin hub-avatar-color-variants($colors: $hub-avatar-semantic-colors) {
|
|
47
|
+
@each $name, $color in $colors {
|
|
48
|
+
hub-avatar.hub-avatar--#{$name} {
|
|
49
|
+
--hub-avatar-accent: #{$color};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
hub-avatar[data-badge-color='#{$name}'] {
|
|
53
|
+
--hub-avatar-badge-color: #{$color};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// ── hub-avatar-badge-color ───────────────────────────────────────────────────
|
|
59
|
+
// Set the badge colour from a single value (a token or a literal).
|
|
60
|
+
@mixin hub-avatar-badge-color($color) {
|
|
61
|
+
--hub-avatar-badge-color: #{$color};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// ── hub-avatar-theme ─────────────────────────────────────────────────────────
|
|
65
|
+
// Override any of the `--hub-avatar-*` design tokens in a single include. Every
|
|
66
|
+
// parameter is OPTIONAL and defaults to `null`: only the parameters you pass are
|
|
67
|
+
// emitted, so the rest keep the component's defaults.
|
|
17
68
|
//
|
|
69
|
+
// @example
|
|
18
70
|
// hub-avatar.brand {
|
|
19
|
-
// @include hub-avatar-theme(
|
|
20
|
-
// $size: 64px,
|
|
21
|
-
// $border-radius: 1rem,
|
|
22
|
-
// $bg: #ede9fe,
|
|
23
|
-
// $fg: #5b21b6,
|
|
24
|
-
// $status-ring-color: #ede9fe
|
|
71
|
+
// @include avatar.hub-avatar-theme(
|
|
72
|
+
// $size: 64px, $bg: #ede9fe, $fg: #5b21b6, $badge-color: #f43f5e
|
|
25
73
|
// );
|
|
26
74
|
// }
|
|
27
75
|
//
|
|
@@ -40,12 +88,18 @@
|
|
|
40
88
|
$font-weight: null,
|
|
41
89
|
$font-size: null,
|
|
42
90
|
$text-transform: null,
|
|
43
|
-
// ──
|
|
44
|
-
$
|
|
45
|
-
$
|
|
46
|
-
|
|
47
|
-
$
|
|
48
|
-
$
|
|
91
|
+
// ── Projected custom content ──
|
|
92
|
+
$content-padding: null,
|
|
93
|
+
$content-icon-size: null,
|
|
94
|
+
// ── Corner badge (dot / labelled) ──
|
|
95
|
+
$badge-size: null,
|
|
96
|
+
$badge-offset: null,
|
|
97
|
+
$badge-ring-width: null,
|
|
98
|
+
$badge-ring-color: null,
|
|
99
|
+
$badge-color: null,
|
|
100
|
+
$badge-text-color: null,
|
|
101
|
+
$badge-font-size: null,
|
|
102
|
+
$badge-padding: null,
|
|
49
103
|
// ── Stacked group ──
|
|
50
104
|
$group-overlap: null,
|
|
51
105
|
$group-ring-width: null,
|
|
@@ -88,21 +142,38 @@
|
|
|
88
142
|
--hub-avatar-text-transform: #{$text-transform};
|
|
89
143
|
}
|
|
90
144
|
|
|
91
|
-
//
|
|
92
|
-
@if $
|
|
93
|
-
--hub-avatar-
|
|
145
|
+
// Projected custom content
|
|
146
|
+
@if $content-padding != null {
|
|
147
|
+
--hub-avatar-content-padding: #{$content-padding};
|
|
148
|
+
}
|
|
149
|
+
@if $content-icon-size != null {
|
|
150
|
+
--hub-avatar-content-icon-size: #{$content-icon-size};
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// Corner badge
|
|
154
|
+
@if $badge-size != null {
|
|
155
|
+
--hub-avatar-badge-size: #{$badge-size};
|
|
156
|
+
}
|
|
157
|
+
@if $badge-offset != null {
|
|
158
|
+
--hub-avatar-badge-offset: #{$badge-offset};
|
|
159
|
+
}
|
|
160
|
+
@if $badge-ring-width != null {
|
|
161
|
+
--hub-avatar-badge-ring-width: #{$badge-ring-width};
|
|
162
|
+
}
|
|
163
|
+
@if $badge-ring-color != null {
|
|
164
|
+
--hub-avatar-badge-ring-color: #{$badge-ring-color};
|
|
94
165
|
}
|
|
95
|
-
@if $
|
|
96
|
-
--hub-avatar-
|
|
166
|
+
@if $badge-color != null {
|
|
167
|
+
--hub-avatar-badge-color: #{$badge-color};
|
|
97
168
|
}
|
|
98
|
-
@if $
|
|
99
|
-
--hub-avatar-
|
|
169
|
+
@if $badge-text-color != null {
|
|
170
|
+
--hub-avatar-badge-text-color: #{$badge-text-color};
|
|
100
171
|
}
|
|
101
|
-
@if $
|
|
102
|
-
--hub-avatar-
|
|
172
|
+
@if $badge-font-size != null {
|
|
173
|
+
--hub-avatar-badge-font-size: #{$badge-font-size};
|
|
103
174
|
}
|
|
104
|
-
@if $
|
|
105
|
-
--hub-avatar-
|
|
175
|
+
@if $badge-padding != null {
|
|
176
|
+
--hub-avatar-badge-padding: #{$badge-padding};
|
|
106
177
|
}
|
|
107
178
|
|
|
108
179
|
// Stacked group
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { AfterContentInit, OnChanges, OnDestroy, SimpleChanges, ModuleWithProviders } from '@angular/core';
|
|
2
|
+
import { AfterContentInit, OnChanges, OnDestroy, SimpleChanges, ModuleWithProviders, EnvironmentProviders } 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';
|
|
6
|
-
import * as i2 from '@angular/common';
|
|
7
6
|
|
|
8
7
|
declare enum AvatarSource {
|
|
9
8
|
FACEBOOK = "facebook",
|
|
@@ -117,10 +116,12 @@ declare class SourceFactory {
|
|
|
117
116
|
type StyleObject = Record<string, string | number | null | undefined>;
|
|
118
117
|
type Style = StyleObject | string;
|
|
119
118
|
/**
|
|
120
|
-
*
|
|
121
|
-
*
|
|
119
|
+
* Semantic colours for the avatar badge and the avatar colour variants. Each maps
|
|
120
|
+
* to a design-system `--hub-sys-color-*` token. Use them to colour a presence dot
|
|
121
|
+
* (e.g. `success` = online, `warning` = away, `danger` = busy, `secondary` = offline)
|
|
122
|
+
* or a labelled badge. Any custom string is also accepted (set `--hub-avatar-badge-color`).
|
|
122
123
|
*/
|
|
123
|
-
type
|
|
124
|
+
type HubAvatarBadgeColor = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark';
|
|
124
125
|
/**
|
|
125
126
|
* Universal avatar component that
|
|
126
127
|
* generates avatar from different sources
|
|
@@ -152,12 +153,26 @@ declare class AvatarComponent implements AfterContentInit, OnChanges, OnDestroy
|
|
|
152
153
|
readonly placeholder: _angular_core.InputSignal<string | undefined>;
|
|
153
154
|
readonly initialsSize: _angular_core.InputSignal<string | number>;
|
|
154
155
|
/**
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
* (
|
|
158
|
-
*
|
|
156
|
+
* Overlay badge at the bottom-end corner. A boolean / empty value renders a plain
|
|
157
|
+
* dot (great for a presence indicator); a string or number renders a labelled badge
|
|
158
|
+
* (e.g. a count like `"4k"`). `null` / absent (default) renders nothing.
|
|
159
|
+
*
|
|
160
|
+
* @example <hub-avatar badge badgeColor="success" /> // dot
|
|
161
|
+
* @example <hub-avatar badge="4k" badgeColor="danger" /> // labelled
|
|
162
|
+
*/
|
|
163
|
+
readonly badge: _angular_core.InputSignal<string | number | boolean | null>;
|
|
164
|
+
/**
|
|
165
|
+
* Semantic colour of the {@link badge} (and, as a host class, of the avatar itself).
|
|
166
|
+
* Maps to a `--hub-sys-color-*` token; any custom string also works (set
|
|
167
|
+
* `--hub-avatar-badge-color`). When unset the badge uses a neutral default.
|
|
159
168
|
*/
|
|
160
|
-
readonly
|
|
169
|
+
readonly badgeColor: _angular_core.InputSignal<HubAvatarBadgeColor | (string & {}) | null>;
|
|
170
|
+
/** True when a badge should be rendered (the `badge` input is set to anything but `null` / `false`). */
|
|
171
|
+
protected readonly _hasBadge: _angular_core.Signal<boolean>;
|
|
172
|
+
/** The badge's text content; empty for a plain dot (`badge` is `true` or an empty string). */
|
|
173
|
+
protected readonly _badgeText: _angular_core.Signal<string>;
|
|
174
|
+
/** True when the badge is a plain dot (shown, but with no text content). */
|
|
175
|
+
protected readonly _isDot: _angular_core.Signal<boolean>;
|
|
161
176
|
readonly clickOnAvatar: _angular_core.OutputEmitterRef<Source>;
|
|
162
177
|
/** Wrapper around the projected content (`<ng-content>`), used to detect whether the consumer projected anything. */
|
|
163
178
|
private customContentRef?;
|
|
@@ -258,15 +273,50 @@ declare class AvatarComponent implements AfterContentInit, OnChanges, OnDestroy
|
|
|
258
273
|
*/
|
|
259
274
|
private removeSource;
|
|
260
275
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AvatarComponent, 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; }; "
|
|
276
|
+
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; }; "badge": { "alias": "badge"; "required": false; "isSignal": true; }; "badgeColor": { "alias": "badgeColor"; "required": false; "isSignal": true; }; }, { "clickOnAvatar": "clickOnAvatar"; }, never, ["*"], true, never>;
|
|
262
277
|
}
|
|
263
278
|
|
|
279
|
+
/**
|
|
280
|
+
* Backward-compatibility module for `<hub-avatar>`.
|
|
281
|
+
*
|
|
282
|
+
* @deprecated `AvatarComponent` is now a standalone component. Import it directly
|
|
283
|
+
* (`imports: [AvatarComponent]`) and, if you need custom configuration, register
|
|
284
|
+
* `provideAvatar()` in your application providers. This module only re-exports the
|
|
285
|
+
* standalone component and will be removed in a future major version.
|
|
286
|
+
*/
|
|
264
287
|
declare class AvatarModule {
|
|
288
|
+
/**
|
|
289
|
+
* @deprecated Use `provideAvatar(config)` with the standalone APIs instead.
|
|
290
|
+
* Kept so existing `AvatarModule.forRoot()` consumers keep working.
|
|
291
|
+
*/
|
|
265
292
|
static forRoot(avatarConfig?: AvatarConfig): ModuleWithProviders<AvatarModule>;
|
|
266
293
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AvatarModule, never>;
|
|
267
|
-
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<AvatarModule,
|
|
294
|
+
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<AvatarModule, never, [typeof AvatarComponent], [typeof AvatarComponent]>;
|
|
268
295
|
static ɵinj: _angular_core.ɵɵInjectorDeclaration<AvatarModule>;
|
|
269
296
|
}
|
|
270
297
|
|
|
271
|
-
|
|
272
|
-
|
|
298
|
+
/**
|
|
299
|
+
* Registers the avatar configuration for standalone applications.
|
|
300
|
+
*
|
|
301
|
+
* Standalone-friendly replacement for `AvatarModule.forRoot()`. Add it to your
|
|
302
|
+
* `bootstrapApplication` providers (or a route's `providers`) to customise the
|
|
303
|
+
* avatar source priority, colour palette or src-cache behaviour. Calling it is
|
|
304
|
+
* optional — `<hub-avatar>` works out of the box with sensible defaults.
|
|
305
|
+
*
|
|
306
|
+
* ```ts
|
|
307
|
+
* import { provideAvatar } from 'ng-hub-ui-avatar';
|
|
308
|
+
*
|
|
309
|
+
* bootstrapApplication(AppComponent, {
|
|
310
|
+
* providers: [
|
|
311
|
+
* provideAvatar({ sourcePriorityOrder: [AvatarSource.GRAVATAR, AvatarSource.INITIALS] })
|
|
312
|
+
* ]
|
|
313
|
+
* });
|
|
314
|
+
* ```
|
|
315
|
+
*
|
|
316
|
+
* @param config Optional avatar configuration.
|
|
317
|
+
* @returns Environment providers to add to the application config.
|
|
318
|
+
*/
|
|
319
|
+
declare function provideAvatar(config?: AvatarConfig): EnvironmentProviders;
|
|
320
|
+
|
|
321
|
+
export { AvatarComponent, AvatarModule, AvatarService, AvatarSource, defaultColors, defaultDisableSrcCache, defaultSources, provideAvatar };
|
|
322
|
+
export type { AvatarConfig, HubAvatarBadgeColor };
|