@leanix/components 0.4.511 → 0.4.512
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/esm2022/index.mjs +6 -1
- package/esm2022/lib/core-ui/components/avatar/avatar.component.mjs +40 -0
- package/esm2022/lib/core-ui/components/avatar/avatar.helpers.mjs +49 -0
- package/esm2022/lib/core-ui/components/avatar/avatar.model.mjs +33 -0
- package/esm2022/lib/core-ui/components/avatar-group/avatar-group.component.mjs +73 -0
- package/esm2022/lib/core-ui/pipes/display-avatars.pipe.mjs +37 -0
- package/fesm2022/leanix-components.mjs +217 -1
- package/fesm2022/leanix-components.mjs.map +1 -1
- package/index.d.ts +4 -0
- package/lib/core-ui/components/avatar/avatar.component.d.ts +18 -0
- package/lib/core-ui/components/avatar/avatar.helpers.d.ts +8 -0
- package/lib/core-ui/components/avatar/avatar.model.d.ts +38 -0
- package/lib/core-ui/components/avatar-group/avatar-group.component.d.ts +28 -0
- package/lib/core-ui/pipes/display-avatars.pipe.d.ts +12 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
@@ -18,6 +18,8 @@ export * from './lib/core-ui/pipes/unescape-curly-braces.pipe';
|
|
18
18
|
export * from './lib/core-ui/directives/after-view-init.directive';
|
19
19
|
export * from './lib/core-ui/directives/autoclose.directive';
|
20
20
|
export * from './lib/core-ui/directives/autofocus.directive';
|
21
|
+
export * from './lib/core-ui/components/avatar-group/avatar-group.component';
|
22
|
+
export * from './lib/core-ui/components/avatar/avatar.component';
|
21
23
|
export * from './lib/core-ui/components/badge/badge.component';
|
22
24
|
export * from './lib/core-ui/components/banner/banner.component';
|
23
25
|
export * from './lib/core-ui/components/button-group/button-group.component';
|
@@ -40,8 +42,10 @@ export * from './lib/core-ui/components/tokenizer/tokenizer.component';
|
|
40
42
|
export * from './lib/core-ui/tooltip/tooltip-position.interface';
|
41
43
|
export * from './lib/core-ui/tooltip/tooltip.component';
|
42
44
|
export * from './lib/core-ui/tooltip/tooltip.directive';
|
45
|
+
export * from './lib/core-ui/components/avatar/avatar.model';
|
43
46
|
export * from './lib/core-ui/linkify/linkify.pipe';
|
44
47
|
export * from './lib/core-ui/linkify/unlinkify.pipe';
|
48
|
+
export * from './lib/core-ui/components/avatar/avatar.helpers';
|
45
49
|
export * from './lib/core-ui/functions/core-css.helpers';
|
46
50
|
export * from './lib/core-ui/functions/highlight-text.function';
|
47
51
|
export * from './lib/core-ui/directives/autoclose-group.service';
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { OnChanges, SimpleChanges } from '@angular/core';
|
2
|
+
import { ImageReader, User, UserAvatarSize } from './avatar.model';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
export declare class AvatarComponent implements OnChanges {
|
5
|
+
private imageReader;
|
6
|
+
user: User & {
|
7
|
+
technicalUser?: boolean;
|
8
|
+
};
|
9
|
+
size: UserAvatarSize;
|
10
|
+
showMailToLink: boolean;
|
11
|
+
disabled: boolean;
|
12
|
+
readonly NAME = "AvatarComponent";
|
13
|
+
imageURL: Promise<string>;
|
14
|
+
constructor(imageReader: ImageReader);
|
15
|
+
ngOnChanges(changes: SimpleChanges): void;
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AvatarComponent, never>;
|
17
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AvatarComponent, "lx-avatar", never, { "user": { "alias": "user"; "required": false; }; "size": { "alias": "size"; "required": false; }; "showMailToLink": { "alias": "showMailToLink"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, true, never>;
|
18
|
+
}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { UserAvatarSize } from './avatar.model';
|
2
|
+
/**
|
3
|
+
* Generates an SVG for the avatar initials
|
4
|
+
* @param displayName The name of the user
|
5
|
+
* @param size The size of the avatar
|
6
|
+
* @returns A promise with the data URL of the generated SVG
|
7
|
+
*/
|
8
|
+
export declare function getInitialsUrl(displayName: string, size?: UserAvatarSize): Promise<string>;
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
2
|
+
import { Observable } from 'rxjs';
|
3
|
+
/** This is a temporary storage for our user and image related models, before we find a better place for them
|
4
|
+
*
|
5
|
+
* We relocated the models here to facilitate moving the avatar and avatar group components out of the user-ui directory.
|
6
|
+
*
|
7
|
+
* This ensures we maintain a single source of truth and adhere to the current strict no-shared-nx policy, since all
|
8
|
+
* libraries and apps already support importing from `@leanix/components` already.
|
9
|
+
*/
|
10
|
+
export type UserAvatarSize = 'XS' | 'S' | 'M' | 'L' | 'XL';
|
11
|
+
export interface ImageReader {
|
12
|
+
getAvatar(userId?: string, size?: UserAvatarSize, displayName?: string): Promise<string>;
|
13
|
+
getAvatarUrl(userId?: string, size?: UserAvatarSize): string;
|
14
|
+
getStorageServiceAvatarUrl(userId?: string, size?: UserAvatarSize): string;
|
15
|
+
getThumbnailUrl(imageId: string): string;
|
16
|
+
loadThumbnail(imageId: string): Observable<string>;
|
17
|
+
}
|
18
|
+
export declare const IMAGE_READER: InjectionToken<ImageReader>;
|
19
|
+
export declare const DEFAULT_IMAGE_ID = "00000000-0000-4000-0000-000000000001";
|
20
|
+
/**
|
21
|
+
* This User model includes common properties that the ui avatar components care about in order to respresent a user
|
22
|
+
* in the UI.
|
23
|
+
*/
|
24
|
+
export interface User {
|
25
|
+
id?: string;
|
26
|
+
displayName?: string;
|
27
|
+
email?: string;
|
28
|
+
firstName?: string;
|
29
|
+
lastName?: string;
|
30
|
+
}
|
31
|
+
export declare const AVATAR_SIZE_MAPPING: {
|
32
|
+
XS: number;
|
33
|
+
S: number;
|
34
|
+
M: number;
|
35
|
+
L: number;
|
36
|
+
XL: number;
|
37
|
+
};
|
38
|
+
export declare const AVATAR_COLORS: string[];
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { AfterViewInit, ChangeDetectorRef, ElementRef, NgZone, OnDestroy } from '@angular/core';
|
2
|
+
import { User, UserAvatarSize } from '../avatar/avatar.model';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
export declare class AvatarGroupComponent implements AfterViewInit, OnDestroy {
|
5
|
+
private cdr;
|
6
|
+
private zone;
|
7
|
+
readonly NAME = "AvatarGroupComponent";
|
8
|
+
title?: string;
|
9
|
+
users: (User & {
|
10
|
+
technicalUser?: boolean;
|
11
|
+
})[];
|
12
|
+
size: UserAvatarSize;
|
13
|
+
type: 'individual' | 'group';
|
14
|
+
maxLength: number;
|
15
|
+
autoScale: boolean;
|
16
|
+
disabledUserIds: string[];
|
17
|
+
userGroupElement: ElementRef<HTMLElement>;
|
18
|
+
get userNames(): string;
|
19
|
+
overlayVisible: boolean;
|
20
|
+
constructor(cdr: ChangeDetectorRef, zone: NgZone);
|
21
|
+
ngAfterViewInit(): void;
|
22
|
+
resizeObserver: ResizeObserver;
|
23
|
+
handleClick(event: Event): void;
|
24
|
+
ngOnDestroy(): void;
|
25
|
+
isUserDisabled(user: User): boolean;
|
26
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AvatarGroupComponent, never>;
|
27
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AvatarGroupComponent, "lx-avatar-group", never, { "title": { "alias": "title"; "required": false; }; "users": { "alias": "users"; "required": false; }; "size": { "alias": "size"; "required": false; }; "type": { "alias": "type"; "required": false; }; "maxLength": { "alias": "maxLength"; "required": false; }; "autoScale": { "alias": "autoScale"; "required": false; }; "disabledUserIds": { "alias": "disabledUserIds"; "required": false; }; }, {}, never, never, true, never>;
|
28
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
2
|
+
import { User, UserAvatarSize } from '../components/avatar/avatar.model';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
export declare class DisplayAvatarsPipe implements PipeTransform {
|
5
|
+
transform(users: (User & {
|
6
|
+
technicalUser?: boolean;
|
7
|
+
})[], type: 'individual' | 'group', size: UserAvatarSize, userGroupWidth: number, autoScale: boolean, maxLength: number): (User & {
|
8
|
+
technicalUser?: boolean;
|
9
|
+
})[];
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DisplayAvatarsPipe, never>;
|
11
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<DisplayAvatarsPipe, "displayAvatars", true>;
|
12
|
+
}
|