@ifsworld/granite-components 11.7.2 → 11.8.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.
Files changed (29) hide show
  1. package/esm2022/index.mjs +12 -1
  2. package/esm2022/lib/contacts/contact-item/contact-item.component.mjs +30 -0
  3. package/esm2022/lib/contacts/contact-item-default-status/contact-item-default-status.component.mjs +20 -0
  4. package/esm2022/lib/contacts/contact-item-title/contact-item-title.component.mjs +15 -0
  5. package/esm2022/lib/contacts/contacts-profile/contacts-profile.component.mjs +27 -0
  6. package/esm2022/lib/contacts/contacts-trigger/contacts-trigger-data.mjs +24 -0
  7. package/esm2022/lib/contacts/contacts-trigger/contacts-trigger-for.directive.mjs +231 -0
  8. package/esm2022/lib/contacts/contacts-types/contacts.component.private-types.mjs +2 -0
  9. package/esm2022/lib/contacts/contacts-types/contacts.component.public-types.mjs +9 -0
  10. package/esm2022/lib/contacts/contacts.component.mjs +69 -0
  11. package/esm2022/lib/contacts/contacts.module.mjs +52 -0
  12. package/esm2022/lib/contacts/custom-profile.directive.mjs +16 -0
  13. package/esm2022/lib/contacts/custom-status.directive.mjs +18 -0
  14. package/fesm2022/ifsworld-granite-components.mjs +460 -2
  15. package/fesm2022/ifsworld-granite-components.mjs.map +1 -1
  16. package/index.d.ts +11 -0
  17. package/lib/contacts/contact-item/contact-item.component.d.ts +11 -0
  18. package/lib/contacts/contact-item-default-status/contact-item-default-status.component.d.ts +15 -0
  19. package/lib/contacts/contact-item-title/contact-item-title.component.d.ts +7 -0
  20. package/lib/contacts/contacts-profile/contacts-profile.component.d.ts +12 -0
  21. package/lib/contacts/contacts-trigger/contacts-trigger-data.d.ts +23 -0
  22. package/lib/contacts/contacts-trigger/contacts-trigger-for.directive.d.ts +69 -0
  23. package/lib/contacts/contacts-types/contacts.component.private-types.d.ts +5 -0
  24. package/lib/contacts/contacts-types/contacts.component.public-types.d.ts +24 -0
  25. package/lib/contacts/contacts.component.d.ts +24 -0
  26. package/lib/contacts/contacts.module.d.ts +16 -0
  27. package/lib/contacts/custom-profile.directive.d.ts +8 -0
  28. package/lib/contacts/custom-status.directive.d.ts +9 -0
  29. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -37,6 +37,17 @@ export * from './lib/chips/chip.component';
37
37
  export * from './lib/chips/chip-input';
38
38
  export * from './lib/label/label.module';
39
39
  export * from './lib/label/label.component';
40
+ export * from './lib/contacts/contacts.module';
41
+ export * from './lib/contacts/contacts.component';
42
+ export * from './lib/contacts/contacts-types/contacts.component.public-types';
43
+ export * from './lib/contacts/contacts-profile/contacts-profile.component';
44
+ export * from './lib/contacts/contact-item/contact-item.component';
45
+ export * from './lib/contacts/contact-item-default-status/contact-item-default-status.component';
46
+ export * from './lib/contacts/contact-item-title/contact-item-title.component';
47
+ export * from './lib/contacts/contacts-trigger/contacts-trigger-for.directive';
48
+ export * from './lib/contacts/custom-status.directive';
49
+ export * from './lib/contacts/custom-profile.directive';
50
+ export * from './lib/contacts/contacts-types/contacts.component.public-types';
40
51
  export * from './lib/progress-bar/progress-bar.module';
41
52
  export * from './lib/progress-bar/progress-bar.component';
42
53
  export * from './lib/core/client-environment';
@@ -0,0 +1,11 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import { Contact, ContactOptions } from '../contacts-types/contacts.component.public-types';
3
+ import { ContactExtended } from '../contacts-types/contacts.component.private-types';
4
+ import * as i0 from "@angular/core";
5
+ export declare class GraniteContactItemComponent {
6
+ contact: ContactExtended;
7
+ selectedContact: EventEmitter<Contact | ContactOptions>;
8
+ emitSelectedContact(contact: ContactExtended): void;
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<GraniteContactItemComponent, never>;
10
+ static ɵcmp: i0.ɵɵComponentDeclaration<GraniteContactItemComponent, "granite-contact-item", never, { "contact": { "alias": "contact"; "required": false; }; }, { "selectedContact": "selectedContact"; }, never, never, false, never>;
11
+ }
@@ -0,0 +1,15 @@
1
+ import { ContactDefaultStatuses } from '../contacts-types/contacts.component.public-types';
2
+ import * as i0 from "@angular/core";
3
+ export declare class ContactItemDefaultStatusComponent {
4
+ status: ContactDefaultStatuses;
5
+ CONTACT_STATUS: {
6
+ readonly AVAILABLE: "Available";
7
+ readonly AWAY: "Away";
8
+ readonly BE_RIGHT_BACK: "BeRightBack";
9
+ readonly BUSY: "Busy";
10
+ readonly DO_NOT_DISTURB: "DoNotDisturb";
11
+ readonly OFFLINE: "Offline";
12
+ };
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<ContactItemDefaultStatusComponent, never>;
14
+ static ɵcmp: i0.ɵɵComponentDeclaration<ContactItemDefaultStatusComponent, "granite-contact-item-default-status", never, { "status": { "alias": "status"; "required": false; }; }, {}, never, never, false, never>;
15
+ }
@@ -0,0 +1,7 @@
1
+ import { ContactExtended } from '../contacts-types/contacts.component.private-types';
2
+ import * as i0 from "@angular/core";
3
+ export declare class GraniteContactItemTitleComponent {
4
+ contact: ContactExtended;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<GraniteContactItemTitleComponent, never>;
6
+ static ɵcmp: i0.ɵɵComponentDeclaration<GraniteContactItemTitleComponent, "granite-contact-item-title", never, { "contact": { "alias": "contact"; "required": false; }; }, {}, never, never, false, never>;
7
+ }
@@ -0,0 +1,12 @@
1
+ import { OnChanges, SimpleChanges } from '@angular/core';
2
+ import { Profile } from '../contacts-types/contacts.component.public-types';
3
+ import * as i0 from "@angular/core";
4
+ export declare class GraniteContactsProfileComponent implements OnChanges {
5
+ profile: Profile;
6
+ profileClass: any;
7
+ _initials: string;
8
+ ngOnChanges(changes: SimpleChanges): void;
9
+ private createProfileInitials;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<GraniteContactsProfileComponent, never>;
11
+ static ɵcmp: i0.ɵɵComponentDeclaration<GraniteContactsProfileComponent, "granite-contacts-profile", never, { "profile": { "alias": "profile"; "required": false; }; "profileClass": { "alias": "profileClass"; "required": false; }; }, {}, never, never, false, never>;
12
+ }
@@ -0,0 +1,23 @@
1
+ import { TemplateRef } from '@angular/core';
2
+ import { ClientInputInterface, ClientOutputInterface } from '../../core/client-environment';
3
+ import { Direction } from '@angular/cdk/bidi';
4
+ import * as i0 from "@angular/core";
5
+ export type PositionX = 'before' | 'after';
6
+ export type PositionY = 'above' | 'below';
7
+ export declare class ContactsTriggerDataComponent {
8
+ templateRef: TemplateRef<unknown>;
9
+ xPosition: PositionX;
10
+ yPosition: PositionY;
11
+ direction: Direction;
12
+ /**
13
+ * Used for locating the panel in tests and setting the aria-control attribute
14
+ * for the contacts trigger.
15
+ */
16
+ readonly panelId: string;
17
+ /** Client input device information */
18
+ clientInput: ClientInputInterface;
19
+ /** Client output device information */
20
+ clientOutput: ClientOutputInterface;
21
+ static ɵfac: i0.ɵɵFactoryDeclaration<ContactsTriggerDataComponent, never>;
22
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ContactsTriggerDataComponent, never, never, {}, {}, never, never, false, never>;
23
+ }
@@ -0,0 +1,69 @@
1
+ import { AfterContentInit, ElementRef, OnDestroy, ViewContainerRef } from '@angular/core';
2
+ import { FocusMonitor, FocusOrigin } from '@angular/cdk/a11y';
3
+ import { Directionality } from '@angular/cdk/bidi';
4
+ import { Overlay, OverlayOutsideClickDispatcher } from '@angular/cdk/overlay';
5
+ import { GraniteContactsComponent } from '../contacts.component';
6
+ import { ClientInputInterface, ClientOutputInterface } from '../../core/client-environment';
7
+ import * as i0 from "@angular/core";
8
+ export declare class GraniteContactsTriggerForDirective implements AfterContentInit, OnDestroy {
9
+ private _overlay;
10
+ private _element;
11
+ private _viewContainerRef;
12
+ private _outsideClickDispatcher;
13
+ /** Client input device information */
14
+ _clientInput: ClientInputInterface;
15
+ /** Client output device information */
16
+ _clientOutput: ClientOutputInterface;
17
+ private _dir;
18
+ private _focusMonitor;
19
+ /** References the contacts instance that the trigger is associated with. */
20
+ contacts: GraniteContactsComponent;
21
+ /** Whether the associated contacts is open */
22
+ _isContactsOpen: boolean;
23
+ private _contactsCloseSubscription;
24
+ private _portal;
25
+ private _overlayRef;
26
+ constructor(_overlay: Overlay, _element: ElementRef<HTMLElement>, _viewContainerRef: ViewContainerRef, _outsideClickDispatcher: OverlayOutsideClickDispatcher,
27
+ /** Client input device information */
28
+ _clientInput: ClientInputInterface,
29
+ /** Client output device information */
30
+ _clientOutput: ClientOutputInterface, _dir: Directionality, _focusMonitor: FocusMonitor);
31
+ ngAfterContentInit(): void;
32
+ ngOnDestroy(): void;
33
+ isOpen(): boolean;
34
+ openContacts(): void;
35
+ /** Toggles the contacts between the open and closed states. */
36
+ toggleContacts(): void;
37
+ /** Close the associated contacts */
38
+ closeContacts(): void;
39
+ /** Handles key presses on the trigger. */
40
+ _handleKeydown(event: KeyboardEvent): void;
41
+ /** Handles click events on the trigger. */
42
+ _handleClick(): void;
43
+ /**
44
+ * Restores focus to the element that was focused before the contacts was open.
45
+ */
46
+ _restoreFocus(origin?: FocusOrigin, options?: FocusOptions): void;
47
+ /**
48
+ * Returns strategy for positioning the overlay for desktop devices:
49
+ */
50
+ private _desktopPositionStrategy;
51
+ /**
52
+ * Sets the appropriate positions on a position strategy
53
+ * so the overlay connects with the trigger correctly.
54
+ * @param positionStrategy Strategy whose position to update.
55
+ */
56
+ private _setPosition;
57
+ /**
58
+ * Returns strategy for positioning the overlay depending on what type of
59
+ * device the contacts is being shown on
60
+ */
61
+ private _positionStrategy;
62
+ /**
63
+ * Returns strategy for positioning the overlay for touch devices:
64
+ * Place centered in the screen.
65
+ */
66
+ private _touchPositionStrategy;
67
+ static ɵfac: i0.ɵɵFactoryDeclaration<GraniteContactsTriggerForDirective, [null, null, null, null, { optional: true; }, { optional: true; }, { optional: true; }, null]>;
68
+ static ɵdir: i0.ɵɵDirectiveDeclaration<GraniteContactsTriggerForDirective, "[graniteContactsTriggerFor]", never, { "contacts": { "alias": "graniteContactsTriggerFor"; "required": false; }; }, {}, never, never, false, never>;
69
+ }
@@ -0,0 +1,5 @@
1
+ import { TemplateRef } from '@angular/core';
2
+ import { Contact } from './contacts.component.public-types';
3
+ export interface ContactExtended extends Contact {
4
+ statusTemplate?: TemplateRef<unknown>;
5
+ }
@@ -0,0 +1,24 @@
1
+ export type ContactDefaultStatuses = (typeof CONTACT_DEFAULT_STATUS)[keyof typeof CONTACT_DEFAULT_STATUS];
2
+ export declare const CONTACT_DEFAULT_STATUS: {
3
+ readonly AVAILABLE: "Available";
4
+ readonly AWAY: "Away";
5
+ readonly BE_RIGHT_BACK: "BeRightBack";
6
+ readonly BUSY: "Busy";
7
+ readonly DO_NOT_DISTURB: "DoNotDisturb";
8
+ readonly OFFLINE: "Offline";
9
+ };
10
+ export interface Contact {
11
+ name: string;
12
+ label: string;
13
+ iconName?: string;
14
+ status?: ContactDefaultStatuses | string;
15
+ options?: ContactOptions[];
16
+ disabled?: boolean;
17
+ }
18
+ export type ContactOptions = Omit<Contact, 'options'>;
19
+ export interface Profile {
20
+ name?: string;
21
+ surname?: string;
22
+ jobTitle?: string;
23
+ avatar?: string;
24
+ }
@@ -0,0 +1,24 @@
1
+ import { EventEmitter, QueryList, AfterContentChecked, OnChanges, SimpleChanges } from '@angular/core';
2
+ import { Contact, ContactOptions, Profile } from './contacts-types/contacts.component.public-types';
3
+ import { ContactsTriggerDataComponent } from './contacts-trigger/contacts-trigger-data';
4
+ import { GraniteCustomStatusDirective } from './custom-status.directive';
5
+ import { ContactExtended } from './contacts-types/contacts.component.private-types';
6
+ import { GraniteCustomProfileDirective } from './custom-profile.directive';
7
+ import * as i0 from "@angular/core";
8
+ export declare class GraniteContactsComponent extends ContactsTriggerDataComponent implements OnChanges, AfterContentChecked {
9
+ contacts: Contact[];
10
+ profile: Profile | unknown;
11
+ profileClass: string;
12
+ defaultShow: boolean;
13
+ readonly selectedContact: EventEmitter<Contact | ContactOptions>;
14
+ _customStatuses: QueryList<GraniteCustomStatusDirective>;
15
+ customProfileDirective: GraniteCustomProfileDirective;
16
+ _contactsExtended: ContactExtended[];
17
+ ngOnChanges(changes: SimpleChanges): void;
18
+ ngAfterContentChecked(): void;
19
+ onSelectedContact(contact: Contact | ContactOptions): void;
20
+ private setProperCustomStatusTemplates;
21
+ private applyTemplates;
22
+ static ɵfac: i0.ɵɵFactoryDeclaration<GraniteContactsComponent, never>;
23
+ static ɵcmp: i0.ɵɵComponentDeclaration<GraniteContactsComponent, "granite-contacts", ["graniteContacts"], { "contacts": { "alias": "contacts"; "required": false; }; "profile": { "alias": "profile"; "required": false; }; "profileClass": { "alias": "profileClass"; "required": false; }; "defaultShow": { "alias": "defaultShow"; "required": false; }; }, { "selectedContact": "selectedContact"; }, ["customProfileDirective", "_customStatuses"], never, false, never>;
24
+ }
@@ -0,0 +1,16 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./contacts.component";
3
+ import * as i2 from "./contacts-profile/contacts-profile.component";
4
+ import * as i3 from "./contact-item/contact-item.component";
5
+ import * as i4 from "./contact-item-default-status/contact-item-default-status.component";
6
+ import * as i5 from "./contact-item-title/contact-item-title.component";
7
+ import * as i6 from "./contacts-trigger/contacts-trigger-for.directive";
8
+ import * as i7 from "./custom-status.directive";
9
+ import * as i8 from "./custom-profile.directive";
10
+ import * as i9 from "../icon/icon.module";
11
+ import * as i10 from "@angular/common";
12
+ export declare class GraniteContactsModule {
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<GraniteContactsModule, never>;
14
+ static ɵmod: i0.ɵɵNgModuleDeclaration<GraniteContactsModule, [typeof i1.GraniteContactsComponent, typeof i2.GraniteContactsProfileComponent, typeof i3.GraniteContactItemComponent, typeof i4.ContactItemDefaultStatusComponent, typeof i5.GraniteContactItemTitleComponent, typeof i6.GraniteContactsTriggerForDirective, typeof i7.GraniteCustomStatusDirective, typeof i8.GraniteCustomProfileDirective], [typeof i9.GraniteIconModule, typeof i10.CommonModule], [typeof i1.GraniteContactsComponent, typeof i6.GraniteContactsTriggerForDirective, typeof i3.GraniteContactItemComponent, typeof i7.GraniteCustomStatusDirective, typeof i8.GraniteCustomProfileDirective]>;
15
+ static ɵinj: i0.ɵɵInjectorDeclaration<GraniteContactsModule>;
16
+ }
@@ -0,0 +1,8 @@
1
+ import { TemplateRef } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class GraniteCustomProfileDirective {
4
+ templateRef: TemplateRef<unknown>;
5
+ constructor(templateRef: TemplateRef<unknown>);
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<GraniteCustomProfileDirective, never>;
7
+ static ɵdir: i0.ɵɵDirectiveDeclaration<GraniteCustomProfileDirective, "[graniteCustomProfile]", never, {}, {}, never, never, false, never>;
8
+ }
@@ -0,0 +1,9 @@
1
+ import { TemplateRef } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class GraniteCustomStatusDirective {
4
+ templateRef: TemplateRef<unknown>;
5
+ graniteCustomStatus: string;
6
+ constructor(templateRef: TemplateRef<unknown>);
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<GraniteCustomStatusDirective, never>;
8
+ static ɵdir: i0.ɵɵDirectiveDeclaration<GraniteCustomStatusDirective, "[graniteCustomStatus]", never, { "graniteCustomStatus": { "alias": "graniteCustomStatus"; "required": false; }; }, {}, never, never, false, never>;
9
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ifsworld/granite-components",
3
- "version": "11.7.2",
3
+ "version": "11.8.0",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "peerDependencies": {
6
6
  "@angular/cdk": ">=17.3.4",