@ifsworld/granite-components 13.2.9 → 13.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/avatar/avatar.component.mjs +24 -7
- package/esm2022/lib/avatar/empty-avatar/empty-avatar.component.mjs +6 -22
- package/esm2022/lib/contacts/contacts-profile/contacts-profile.component.mjs +4 -13
- package/esm2022/lib/contacts/contacts-types/contacts.component.private-types.mjs +1 -1
- package/esm2022/lib/contacts/contacts-types/contacts.component.public-types.mjs +1 -1
- package/esm2022/lib/contacts/contacts.component.mjs +29 -8
- package/esm2022/lib/core/services/names-utils-service.mjs +51 -0
- package/esm2022/lib/input-field/input-field.component.mjs +1 -1
- package/fesm2022/ifsworld-granite-components.mjs +104 -42
- package/fesm2022/ifsworld-granite-components.mjs.map +1 -1
- package/lib/avatar/avatar.component.d.ts +9 -4
- package/lib/avatar/empty-avatar/empty-avatar.component.d.ts +3 -8
- package/lib/contacts/contacts-profile/contacts-profile.component.d.ts +3 -7
- package/lib/contacts/contacts-types/contacts.component.private-types.d.ts +4 -1
- package/lib/contacts/contacts-types/contacts.component.public-types.d.ts +2 -1
- package/lib/contacts/contacts.component.d.ts +6 -2
- package/lib/core/services/names-utils-service.d.ts +17 -0
- package/package.json +1 -1
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
import { QueryList, AfterContentChecked, TemplateRef } from '@angular/core';
|
|
1
|
+
import { QueryList, AfterContentChecked, TemplateRef, ChangeDetectorRef, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
2
|
import { ContactsTriggerDataComponent } from '../contacts/contacts-trigger/contacts-trigger-data';
|
|
3
3
|
import { GraniteCustomAvatarStatusDirective } from './custom-avatar-status.directive';
|
|
4
4
|
import { AvatarDefaultStatuses } from './avatar.component.public-types';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
|
-
export declare class GraniteAvatarComponent extends ContactsTriggerDataComponent implements AfterContentChecked {
|
|
6
|
+
export declare class GraniteAvatarComponent extends ContactsTriggerDataComponent implements AfterContentChecked, OnChanges {
|
|
7
|
+
private cd;
|
|
7
8
|
name: string;
|
|
8
|
-
|
|
9
|
+
firstName: string;
|
|
10
|
+
lastName: string;
|
|
9
11
|
avatar: string;
|
|
10
12
|
status: AvatarDefaultStatuses;
|
|
11
13
|
_customStatusesQueryList: QueryList<GraniteCustomAvatarStatusDirective>;
|
|
12
14
|
_customStatusDirectives: Record<string, TemplateRef<unknown>>;
|
|
15
|
+
_nameInitials: string;
|
|
16
|
+
constructor(cd: ChangeDetectorRef);
|
|
17
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
13
18
|
ngAfterContentChecked(): void;
|
|
14
19
|
static ɵfac: i0.ɵɵFactoryDeclaration<GraniteAvatarComponent, never>;
|
|
15
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<GraniteAvatarComponent, "granite-avatar", ["graniteAvatar"], { "name": { "alias": "name"; "required": false; }; "
|
|
20
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<GraniteAvatarComponent, "granite-avatar", ["graniteAvatar"], { "name": { "alias": "name"; "required": false; }; "firstName": { "alias": "firstName"; "required": false; }; "lastName": { "alias": "lastName"; "required": false; }; "avatar": { "alias": "avatar"; "required": false; }; "status": { "alias": "status"; "required": false; }; }, {}, ["_customStatusesQueryList"], never, false, never>;
|
|
16
21
|
}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import { OnChanges, SimpleChanges } from '@angular/core';
|
|
2
1
|
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class GraniteEmptyAvatarComponent
|
|
4
|
-
|
|
5
|
-
surname: string;
|
|
6
|
-
_firstNameLetter: string;
|
|
7
|
-
_firstSurnameLetter: string;
|
|
8
|
-
ngOnChanges(changes: SimpleChanges): void;
|
|
2
|
+
export declare class GraniteEmptyAvatarComponent {
|
|
3
|
+
initials: string;
|
|
9
4
|
static ɵfac: i0.ɵɵFactoryDeclaration<GraniteEmptyAvatarComponent, never>;
|
|
10
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<GraniteEmptyAvatarComponent, "granite-empty-avatar", never, { "
|
|
5
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<GraniteEmptyAvatarComponent, "granite-empty-avatar", never, { "initials": { "alias": "initials"; "required": false; }; }, {}, never, never, false, never>;
|
|
11
6
|
}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Profile } from '../contacts-types/contacts.component.public-types';
|
|
1
|
+
import { ProfileData } from '../contacts-types/contacts.component.private-types';
|
|
3
2
|
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class GraniteContactsProfileComponent
|
|
5
|
-
profile:
|
|
3
|
+
export declare class GraniteContactsProfileComponent {
|
|
4
|
+
profile: ProfileData;
|
|
6
5
|
profileClass: any;
|
|
7
|
-
_initials: string;
|
|
8
|
-
ngOnChanges(changes: SimpleChanges): void;
|
|
9
|
-
private createProfileInitials;
|
|
10
6
|
static ɵfac: i0.ɵɵFactoryDeclaration<GraniteContactsProfileComponent, never>;
|
|
11
7
|
static ɵcmp: i0.ɵɵComponentDeclaration<GraniteContactsProfileComponent, "granite-contacts-profile", never, { "profile": { "alias": "profile"; "required": false; }; "profileClass": { "alias": "profileClass"; "required": false; }; }, {}, never, never, false, never>;
|
|
12
8
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { TemplateRef } from '@angular/core';
|
|
2
|
-
import { Contact } from './contacts.component.public-types';
|
|
2
|
+
import { Contact, Profile } from './contacts.component.public-types';
|
|
3
3
|
export interface ContactExtended extends Contact {
|
|
4
4
|
statusTemplate?: TemplateRef<unknown>;
|
|
5
5
|
}
|
|
6
|
+
export type ProfileData = Omit<Profile, 'name'> & {
|
|
7
|
+
initials: string;
|
|
8
|
+
};
|
|
@@ -22,8 +22,9 @@ export interface SelectedContact<T = unknown> {
|
|
|
22
22
|
}
|
|
23
23
|
export type ContactOption<T = unknown> = Omit<Contact<T>, 'options'>;
|
|
24
24
|
export interface Profile {
|
|
25
|
+
firstName?: string;
|
|
26
|
+
lastName?: string;
|
|
25
27
|
name?: string;
|
|
26
|
-
surname?: string;
|
|
27
28
|
jobTitle?: string;
|
|
28
29
|
avatar?: string;
|
|
29
30
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { EventEmitter, QueryList, AfterContentChecked, OnChanges, SimpleChanges } from '@angular/core';
|
|
1
|
+
import { EventEmitter, QueryList, AfterContentChecked, OnChanges, SimpleChanges, ChangeDetectorRef } from '@angular/core';
|
|
2
2
|
import { Contact, Profile, SelectedContact } from './contacts-types/contacts.component.public-types';
|
|
3
3
|
import { ContactsTriggerDataComponent } from './contacts-trigger/contacts-trigger-data';
|
|
4
4
|
import { GraniteCustomStatusDirective } from './custom-status.directive';
|
|
5
|
-
import { ContactExtended } from './contacts-types/contacts.component.private-types';
|
|
5
|
+
import { ContactExtended, ProfileData } from './contacts-types/contacts.component.private-types';
|
|
6
6
|
import { GraniteCustomProfileDirective } from './custom-profile.directive';
|
|
7
7
|
import * as i0 from "@angular/core";
|
|
8
8
|
export declare class GraniteContactsComponent extends ContactsTriggerDataComponent implements OnChanges, AfterContentChecked {
|
|
9
|
+
private cd;
|
|
9
10
|
contacts: Contact[];
|
|
10
11
|
contactsClass: string;
|
|
11
12
|
profile: Profile | unknown;
|
|
@@ -15,11 +16,14 @@ export declare class GraniteContactsComponent extends ContactsTriggerDataCompone
|
|
|
15
16
|
_customStatuses: QueryList<GraniteCustomStatusDirective>;
|
|
16
17
|
customProfileDirective: GraniteCustomProfileDirective;
|
|
17
18
|
_contactsExtended: ContactExtended[];
|
|
19
|
+
_profile: ProfileData;
|
|
20
|
+
constructor(cd: ChangeDetectorRef);
|
|
18
21
|
ngOnChanges(changes: SimpleChanges): void;
|
|
19
22
|
ngAfterContentChecked(): void;
|
|
20
23
|
onSelectedContact(contact: SelectedContact): void;
|
|
21
24
|
private setProperCustomStatusTemplates;
|
|
22
25
|
private applyTemplates;
|
|
26
|
+
private createProfileData;
|
|
23
27
|
static ɵfac: i0.ɵɵFactoryDeclaration<GraniteContactsComponent, never>;
|
|
24
28
|
static ɵcmp: i0.ɵɵComponentDeclaration<GraniteContactsComponent, "granite-contacts", ["graniteContacts"], { "contacts": { "alias": "contacts"; "required": false; }; "contactsClass": { "alias": "contactsClass"; "required": false; }; "profile": { "alias": "profile"; "required": false; }; "profileClass": { "alias": "profileClass"; "required": false; }; "defaultShow": { "alias": "defaultShow"; "required": false; }; }, { "selectedContact": "selectedContact"; }, ["customProfileDirective", "_customStatuses"], never, false, never>;
|
|
25
29
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type firstName = string;
|
|
2
|
+
type lastName = string;
|
|
3
|
+
type NamesFormat = {
|
|
4
|
+
firstName?: firstName | null;
|
|
5
|
+
lastName?: lastName | null;
|
|
6
|
+
name?: string;
|
|
7
|
+
};
|
|
8
|
+
type NameData = {
|
|
9
|
+
firstName?: firstName;
|
|
10
|
+
lastName?: lastName;
|
|
11
|
+
initials: string;
|
|
12
|
+
};
|
|
13
|
+
export declare class NamesUtilsService {
|
|
14
|
+
static getInitialsFrom(firstName: string): string;
|
|
15
|
+
static buildNameData(namesFormat: NamesFormat): NameData;
|
|
16
|
+
}
|
|
17
|
+
export {};
|