@ifsworld/granite-components 11.7.1 → 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 (32) hide show
  1. package/esm2022/index.mjs +12 -1
  2. package/esm2022/lib/chips/chip-list.component.mjs +4 -4
  3. package/esm2022/lib/contacts/contact-item/contact-item.component.mjs +30 -0
  4. package/esm2022/lib/contacts/contact-item-default-status/contact-item-default-status.component.mjs +20 -0
  5. package/esm2022/lib/contacts/contact-item-title/contact-item-title.component.mjs +15 -0
  6. package/esm2022/lib/contacts/contacts-profile/contacts-profile.component.mjs +27 -0
  7. package/esm2022/lib/contacts/contacts-trigger/contacts-trigger-data.mjs +24 -0
  8. package/esm2022/lib/contacts/contacts-trigger/contacts-trigger-for.directive.mjs +231 -0
  9. package/esm2022/lib/contacts/contacts-types/contacts.component.private-types.mjs +2 -0
  10. package/esm2022/lib/contacts/contacts-types/contacts.component.public-types.mjs +9 -0
  11. package/esm2022/lib/contacts/contacts.component.mjs +69 -0
  12. package/esm2022/lib/contacts/contacts.module.mjs +52 -0
  13. package/esm2022/lib/contacts/custom-profile.directive.mjs +16 -0
  14. package/esm2022/lib/contacts/custom-status.directive.mjs +18 -0
  15. package/esm2022/lib/menu/menu-trigger-for.directive.mjs +13 -12
  16. package/fesm2022/ifsworld-granite-components.mjs +474 -15
  17. package/fesm2022/ifsworld-granite-components.mjs.map +1 -1
  18. package/index.d.ts +11 -0
  19. package/lib/contacts/contact-item/contact-item.component.d.ts +11 -0
  20. package/lib/contacts/contact-item-default-status/contact-item-default-status.component.d.ts +15 -0
  21. package/lib/contacts/contact-item-title/contact-item-title.component.d.ts +7 -0
  22. package/lib/contacts/contacts-profile/contacts-profile.component.d.ts +12 -0
  23. package/lib/contacts/contacts-trigger/contacts-trigger-data.d.ts +23 -0
  24. package/lib/contacts/contacts-trigger/contacts-trigger-for.directive.d.ts +69 -0
  25. package/lib/contacts/contacts-types/contacts.component.private-types.d.ts +5 -0
  26. package/lib/contacts/contacts-types/contacts.component.public-types.d.ts +24 -0
  27. package/lib/contacts/contacts.component.d.ts +24 -0
  28. package/lib/contacts/contacts.module.d.ts +16 -0
  29. package/lib/contacts/custom-profile.directive.d.ts +8 -0
  30. package/lib/contacts/custom-status.directive.d.ts +9 -0
  31. package/lib/menu/menu-trigger-for.directive.d.ts +4 -4
  32. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, ChangeDetectionStrategy, Input, HostBinding, ContentChildren, NgModule, InjectionToken, Attribute, Inject, Optional, EventEmitter, QueryList, TemplateRef, Directive, ViewChild, Output, Self, HostListener, ViewEncapsulation, Pipe, inject, ContentChild } from '@angular/core';
2
+ import { Component, ChangeDetectionStrategy, Input, HostBinding, ContentChildren, NgModule, InjectionToken, Attribute, Inject, Optional, EventEmitter, QueryList, TemplateRef, Directive, ViewChild, Output, Self, HostListener, ContentChild, Pipe, inject } from '@angular/core';
3
3
  import * as i1$1 from '@angular/common';
4
4
  import { CommonModule, DOCUMENT } from '@angular/common';
5
5
  import { coerceNumberProperty, coerceBooleanProperty } from '@angular/cdk/coercion';
@@ -1318,7 +1318,7 @@ class GraniteMenuTriggerForDirective {
1318
1318
  this._isMenuOpen = false;
1319
1319
  // Tracking input type is necessary so it's possible to only auto-focus
1320
1320
  // the first item of the list when the menu is opened via the keyboard
1321
- this._openedBy = null;
1321
+ this.openedBy = null;
1322
1322
  this._hoverSubscription = Subscription.EMPTY;
1323
1323
  this._menuCloseSubscription = Subscription.EMPTY;
1324
1324
  this._closingActionsSubscription = Subscription.EMPTY;
@@ -1330,7 +1330,7 @@ class GraniteMenuTriggerForDirective {
1330
1330
  * Needs to be an arrow function so we can easily use addEventListener and removeEventListener.
1331
1331
  */
1332
1332
  this._handleTouchStart = () => {
1333
- this._openedBy = 'touch';
1333
+ this.openedBy = 'touch';
1334
1334
  };
1335
1335
  // ----------------------------------------- //
1336
1336
  // --- Here be poor man's touch gestures --- //
@@ -1562,11 +1562,11 @@ class GraniteMenuTriggerForDirective {
1562
1562
  this._closingActionsSubscription = this._menuClosingActions().subscribe(() => this.closeMenu());
1563
1563
  this.animateOpenMenu();
1564
1564
  this._setIsMenuOpen(true);
1565
- this.menu.focusFirstItem(this._openedBy || 'program');
1565
+ this.menu.focusFirstItem(this.openedBy || 'program');
1566
1566
  }
1567
1567
  /** Emits an eventtype when the menu is opened */
1568
1568
  openedEvent() {
1569
- if (this._openedBy === 'touch' || this._openedBy === 'mouse') {
1569
+ if (this.openedBy === 'touch' || this.openedBy === 'mouse') {
1570
1570
  this.menu.opened.emit('click');
1571
1571
  }
1572
1572
  else {
@@ -1616,10 +1616,10 @@ class GraniteMenuTriggerForDirective {
1616
1616
  /** Handles mouse presses on the trigger. */
1617
1617
  _handleMousedown(event) {
1618
1618
  if (!isFakeMousedownFromScreenReader(event)) {
1619
- if (this._openedBy !== 'touch') {
1619
+ if (this.openedBy !== 'touch') {
1620
1620
  // Since right or middle button clicks won't trigger the `click` event,
1621
1621
  // we shouldn't consider the menu as opened by mouse in those cases.
1622
- this._openedBy = event.button === 0 ? 'mouse' : null;
1622
+ this.openedBy = event.button === 0 ? 'mouse' : null;
1623
1623
  }
1624
1624
  // Since clicking on the trigger won't close the menu if it opens a sub-menu,
1625
1625
  // we should prevent focus from moving onto it via click to avoid the
@@ -1663,7 +1663,7 @@ class GraniteMenuTriggerForDirective {
1663
1663
  // it won't be closed immediately after it is opened.
1664
1664
  filter((active) => active === this._menuItemInstance /*&& !active.disabled*/), delay(0, asapScheduler))
1665
1665
  .subscribe(() => {
1666
- this._openedBy = 'mouse';
1666
+ this.openedBy = 'mouse';
1667
1667
  // If the same menu is used between multiple triggers, it might still be animating
1668
1668
  // while the new trigger tries to re-open it. Wait for the animation to finish
1669
1669
  // before doing so. Also interrupt if the user moves to another item.
@@ -1688,15 +1688,15 @@ class GraniteMenuTriggerForDirective {
1688
1688
  // We should reset focus if the user is navigating using a keyboard or
1689
1689
  // if we have a top-level trigger which might cause focus to be lost
1690
1690
  // when clicking outside of the menu.
1691
- if (!this._openedBy) {
1691
+ if (!this.openedBy) {
1692
1692
  // Note that the focus style will show up both for `program` and
1693
1693
  // `keyboard` so we don't have to specify which one it is.
1694
1694
  this.focus();
1695
1695
  }
1696
1696
  else if (!this.triggersSubmenu()) {
1697
- this.focus(this._openedBy);
1697
+ this.focus(this.openedBy);
1698
1698
  }
1699
- this._openedBy = null;
1699
+ this.openedBy = null;
1700
1700
  }
1701
1701
  // Set state rather than toggle to support triggers sharing a menu
1702
1702
  _setIsMenuOpen(isOpen) {
@@ -1920,12 +1920,13 @@ class GraniteMenuTriggerForDirective {
1920
1920
  : target * (-Math.pow(2, (-10 * current) / end) + 1) + offset;
1921
1921
  }
1922
1922
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteMenuTriggerForDirective, deps: [{ token: i1$2.Overlay }, { token: i0.ElementRef }, { token: i0.ViewContainerRef }, { token: GRANITE_MENU_PANEL, optional: true }, { token: GRANITE_CLIENT_INPUT, optional: true }, { token: GRANITE_CLIENT_OUTPUT, optional: true }, { token: GraniteMenuItemComponent, optional: true, self: true }, { token: i3.Directionality, optional: true }, { token: i1.FocusMonitor }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Directive }); }
1923
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.4", type: GraniteMenuTriggerForDirective, selector: "[graniteMenuTriggerFor]", inputs: { menu: ["graniteMenuTriggerFor", "menu"], openOnClick: "openOnClick" }, host: { attributes: { "aria-haspopup": "true" }, listeners: { "mousedown": "_handleMousedown($event)", "keydown": "_handleKeydown($event)", "click": "_handleClick($event)" }, properties: { "attr.aria-expanded": "_isMenuOpen || null", "attr.aria-controls": "_isMenuOpen ? menu.panelId : null" }, classAttribute: "granite-menu-trigger" }, usesOnChanges: true, ngImport: i0 }); }
1923
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.4", type: GraniteMenuTriggerForDirective, selector: "[graniteMenuTriggerFor]", inputs: { menu: ["graniteMenuTriggerFor", "menu"], openOnClick: "openOnClick" }, host: { attributes: { "aria-haspopup": "true" }, listeners: { "mousedown": "_handleMousedown($event)", "keydown": "_handleKeydown($event)", "click": "_handleClick($event)" }, properties: { "attr.aria-expanded": "_isMenuOpen || null", "attr.aria-controls": "_isMenuOpen ? menu.panelId : null" }, classAttribute: "granite-menu-trigger" }, exportAs: ["graniteMenuTriggerFor"], usesOnChanges: true, ngImport: i0 }); }
1924
1924
  }
1925
1925
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteMenuTriggerForDirective, decorators: [{
1926
1926
  type: Directive,
1927
1927
  args: [{
1928
1928
  selector: `[graniteMenuTriggerFor]`,
1929
+ exportAs: 'graniteMenuTriggerFor',
1929
1930
  host: {
1930
1931
  class: 'granite-menu-trigger', // Required for test harness host selector
1931
1932
  'aria-haspopup': 'true',
@@ -3614,7 +3615,7 @@ class GraniteChipListComponent extends GraniteChipListBase {
3614
3615
  }
3615
3616
  }
3616
3617
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteChipListComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i3.Directionality, optional: true }, { token: i2$1.NgForm, optional: true }, { token: i2$1.FormGroupDirective, optional: true }, { token: i2$1.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component }); }
3617
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: GraniteChipListComponent, selector: "granite-chip-list", inputs: { ariaLabel: ["aria-label", "ariaLabel"], ariaLabelledby: ["aria-labelledby", "ariaLabelledby"], ariaOrientation: ["aria-orientation", "ariaOrientation"], role: "role", multiselect: "multiselect", disabled: "disabled", selectable: "selectable", tabindex: "tabindex" }, host: { listeners: { "focus": "focus()", "blur": "_blur()", "keydown": "_keydown($event)" }, properties: { "class.granite-chip-list-disabled": "disabled", "attr.tabindex": "disabled ? null : _tabIndex", "attr.role": "role", "attr.aria-label": "ariaLabel", "attr.aria-labelledby": "ariaLabelledby", "attr.aria-disabled": "disabled.toString()", "attr.aria-multiselectable": "multiselect", "attr.aria-orientation": "ariaOrientation", "id": "_uid" }, classAttribute: "granite-chip-list" }, queries: [{ propertyName: "chips", predicate: GraniteChipComponent, descendants: true }], exportAs: ["graniteChipList"], usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, styles: [".granite-chip-list{display:flex;flex-direction:row;flex-wrap:wrap;place-content:center flex-start;align-items:center;font-weight:400;font-size:var(--granite-font-size-body-small);line-height:var(--granite-line-height-regular);overflow:auto;padding:0;margin:0}input.granite-chip-input{outline:none;border:none;background-color:transparent;color:var(--granite-color-text);margin:var(--granite-spacing-4)}granite-icon{color:var(--granite-color-text);background-color:transparent}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
3618
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: GraniteChipListComponent, selector: "granite-chip-list", inputs: { ariaLabel: ["aria-label", "ariaLabel"], ariaLabelledby: ["aria-labelledby", "ariaLabelledby"], ariaOrientation: ["aria-orientation", "ariaOrientation"], role: "role", multiselect: "multiselect", disabled: "disabled", selectable: "selectable", tabindex: "tabindex" }, host: { listeners: { "focus": "focus()", "blur": "_blur()", "keydown": "_keydown($event)" }, properties: { "class.granite-chip-list-disabled": "disabled", "attr.tabindex": "disabled ? null : _tabIndex", "attr.role": "role", "attr.aria-label": "ariaLabel", "attr.aria-labelledby": "ariaLabelledby", "attr.aria-disabled": "disabled.toString()", "attr.aria-multiselectable": "multiselect", "attr.aria-orientation": "ariaOrientation", "id": "_uid" }, classAttribute: "granite-chip-list" }, queries: [{ propertyName: "chips", predicate: GraniteChipComponent, descendants: true }], exportAs: ["graniteChipList"], usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, styles: [":host.granite-chip-list{display:flex;flex-direction:row;flex-wrap:wrap;place-content:center flex-start;align-items:center;font-weight:400;font-size:var(--granite-font-size-body-small);line-height:var(--granite-line-height-regular);overflow:auto;padding:0;margin:0}:host ::ng-deep input.granite-chip-input{outline:none;border:none;background-color:transparent;color:var(--granite-color-text);margin:var(--granite-spacing-4)}:host ::ng-deep granite-icon{color:var(--granite-color-text);background-color:transparent}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3618
3619
  }
3619
3620
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteChipListComponent, decorators: [{
3620
3621
  type: Component,
@@ -3632,7 +3633,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
3632
3633
  '(focus)': 'focus()',
3633
3634
  '(blur)': '_blur()',
3634
3635
  '(keydown)': '_keydown($event)',
3635
- }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".granite-chip-list{display:flex;flex-direction:row;flex-wrap:wrap;place-content:center flex-start;align-items:center;font-weight:400;font-size:var(--granite-font-size-body-small);line-height:var(--granite-line-height-regular);overflow:auto;padding:0;margin:0}input.granite-chip-input{outline:none;border:none;background-color:transparent;color:var(--granite-color-text);margin:var(--granite-spacing-4)}granite-icon{color:var(--granite-color-text);background-color:transparent}\n"] }]
3636
+ }, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host.granite-chip-list{display:flex;flex-direction:row;flex-wrap:wrap;place-content:center flex-start;align-items:center;font-weight:400;font-size:var(--granite-font-size-body-small);line-height:var(--granite-line-height-regular);overflow:auto;padding:0;margin:0}:host ::ng-deep input.granite-chip-input{outline:none;border:none;background-color:transparent;color:var(--granite-color-text);margin:var(--granite-spacing-4)}:host ::ng-deep granite-icon{color:var(--granite-color-text);background-color:transparent}\n"] }]
3636
3637
  }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i3.Directionality, decorators: [{
3637
3638
  type: Optional
3638
3639
  }] }, { type: i2$1.NgForm, decorators: [{
@@ -3925,6 +3926,464 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
3925
3926
  }]
3926
3927
  }] });
3927
3928
 
3929
+ let contactsPanelUid = 0;
3930
+ class ContactsTriggerDataComponent {
3931
+ constructor() {
3932
+ this.xPosition = 'after';
3933
+ this.yPosition = 'below';
3934
+ /**
3935
+ * Used for locating the panel in tests and setting the aria-control attribute
3936
+ * for the contacts trigger.
3937
+ */
3938
+ this.panelId = `granite-contacts-panel-${contactsPanelUid++}`;
3939
+ }
3940
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ContactsTriggerDataComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
3941
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.4", type: ContactsTriggerDataComponent, viewQueries: [{ propertyName: "templateRef", first: true, predicate: TemplateRef, descendants: true }], ngImport: i0 }); }
3942
+ }
3943
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ContactsTriggerDataComponent, decorators: [{
3944
+ type: Directive,
3945
+ args: [{}]
3946
+ }], propDecorators: { templateRef: [{
3947
+ type: ViewChild,
3948
+ args: [TemplateRef]
3949
+ }] } });
3950
+
3951
+ class GraniteCustomStatusDirective {
3952
+ constructor(templateRef) {
3953
+ this.templateRef = templateRef;
3954
+ }
3955
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteCustomStatusDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
3956
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.4", type: GraniteCustomStatusDirective, selector: "[graniteCustomStatus]", inputs: { graniteCustomStatus: "graniteCustomStatus" }, ngImport: i0 }); }
3957
+ }
3958
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteCustomStatusDirective, decorators: [{
3959
+ type: Directive,
3960
+ args: [{
3961
+ selector: '[graniteCustomStatus]',
3962
+ }]
3963
+ }], ctorParameters: () => [{ type: i0.TemplateRef }], propDecorators: { graniteCustomStatus: [{
3964
+ type: Input
3965
+ }] } });
3966
+
3967
+ class GraniteCustomProfileDirective {
3968
+ constructor(templateRef) {
3969
+ this.templateRef = templateRef;
3970
+ }
3971
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteCustomProfileDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
3972
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.4", type: GraniteCustomProfileDirective, selector: "[graniteCustomProfile]", ngImport: i0 }); }
3973
+ }
3974
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteCustomProfileDirective, decorators: [{
3975
+ type: Directive,
3976
+ args: [{
3977
+ selector: '[graniteCustomProfile]',
3978
+ }]
3979
+ }], ctorParameters: () => [{ type: i0.TemplateRef }] });
3980
+
3981
+ class GraniteContactsProfileComponent {
3982
+ ngOnChanges(changes) {
3983
+ const profile = changes.profile?.currentValue;
3984
+ if (profile && profile.name && profile.surname) {
3985
+ this.createProfileInitials(profile.name, profile.surname);
3986
+ }
3987
+ }
3988
+ createProfileInitials(name, surname) {
3989
+ this._initials = name[0].toUpperCase() + surname[0].toUpperCase();
3990
+ }
3991
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteContactsProfileComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3992
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: GraniteContactsProfileComponent, selector: "granite-contacts-profile", inputs: { profile: "profile", profileClass: "profileClass" }, host: { classAttribute: "granite-contacts-profile" }, usesOnChanges: true, ngImport: i0, template: "<div [class]=\"profileClass\" data-fnd=\"profile\" class=\"profile\">\n <img\n data-fnd=\"profile-avatar\"\n *ngIf=\"profile?.avatar; else noProfileAvatar\"\n [src]=\"profile?.avatar\"\n alt=\"profile avatar\"\n class=\"profile-avatar\"\n />\n\n <ng-template #noProfileAvatar>\n <div class=\"no-profile-avatar\">\n <span\n data-fnd=\"no-profile-avatar-initials\"\n class=\"no-profile-avatar-initials\"\n >{{ _initials }}</span\n >\n </div>\n </ng-template>\n\n <div>\n <p data-fnd=\"profile-info-names\" class=\"profile-name\">\n {{ profile?.name }} {{ profile?.surname }}\n </p>\n <p data-fnd=\"profile-info-job-title\" class=\"profile-job-title\">\n {{ profile?.jobTitle }}\n </p>\n </div>\n</div>\n", styles: [".profile{display:flex;align-items:center;margin-bottom:var(--granite-spacing-8);gap:var(--granite-spacing-4)}.profile-avatar{width:4.5rem;height:4.5rem;border-radius:50%;object-fit:cover}.profile-name{color:var(--granite-color-text);font-size:var(--granite-font-size-body-small);font-weight:var(--granite-font-weight-regular);margin:0 0 var(--granite-spacing-8)}.profile-job-title{color:var(--granite-color-text-hint);font-size:var(--granite-font-size-micro);font-weight:var(--granite-font-weight-regular);margin:0}.profile-surname{color:var(--granite-color-text-hint);font-size:var(--granite-font-size-body-small);font-weight:var(--granite-font-weight-regular)}.no-profile-avatar{display:flex;width:4.5rem;height:4.5rem;border-radius:360px;background:var(--granite-color-background-info);justify-content:center;align-items:center}.no-profile-avatar-initials{font-size:var(--granite-font-size-micro);color:var(--granite-color-signal-info);font-weight:var(--granite-font-weight-regular)}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3993
+ }
3994
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteContactsProfileComponent, decorators: [{
3995
+ type: Component,
3996
+ args: [{ selector: 'granite-contacts-profile', host: {
3997
+ class: 'granite-contacts-profile',
3998
+ }, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"profileClass\" data-fnd=\"profile\" class=\"profile\">\n <img\n data-fnd=\"profile-avatar\"\n *ngIf=\"profile?.avatar; else noProfileAvatar\"\n [src]=\"profile?.avatar\"\n alt=\"profile avatar\"\n class=\"profile-avatar\"\n />\n\n <ng-template #noProfileAvatar>\n <div class=\"no-profile-avatar\">\n <span\n data-fnd=\"no-profile-avatar-initials\"\n class=\"no-profile-avatar-initials\"\n >{{ _initials }}</span\n >\n </div>\n </ng-template>\n\n <div>\n <p data-fnd=\"profile-info-names\" class=\"profile-name\">\n {{ profile?.name }} {{ profile?.surname }}\n </p>\n <p data-fnd=\"profile-info-job-title\" class=\"profile-job-title\">\n {{ profile?.jobTitle }}\n </p>\n </div>\n</div>\n", styles: [".profile{display:flex;align-items:center;margin-bottom:var(--granite-spacing-8);gap:var(--granite-spacing-4)}.profile-avatar{width:4.5rem;height:4.5rem;border-radius:50%;object-fit:cover}.profile-name{color:var(--granite-color-text);font-size:var(--granite-font-size-body-small);font-weight:var(--granite-font-weight-regular);margin:0 0 var(--granite-spacing-8)}.profile-job-title{color:var(--granite-color-text-hint);font-size:var(--granite-font-size-micro);font-weight:var(--granite-font-weight-regular);margin:0}.profile-surname{color:var(--granite-color-text-hint);font-size:var(--granite-font-size-body-small);font-weight:var(--granite-font-weight-regular)}.no-profile-avatar{display:flex;width:4.5rem;height:4.5rem;border-radius:360px;background:var(--granite-color-background-info);justify-content:center;align-items:center}.no-profile-avatar-initials{font-size:var(--granite-font-size-micro);color:var(--granite-color-signal-info);font-weight:var(--granite-font-weight-regular)}\n"] }]
3999
+ }], propDecorators: { profile: [{
4000
+ type: Input
4001
+ }], profileClass: [{
4002
+ type: Input
4003
+ }] } });
4004
+
4005
+ const CONTACT_DEFAULT_STATUS = {
4006
+ AVAILABLE: 'Available',
4007
+ AWAY: 'Away',
4008
+ BE_RIGHT_BACK: 'BeRightBack',
4009
+ BUSY: 'Busy',
4010
+ DO_NOT_DISTURB: 'DoNotDisturb',
4011
+ OFFLINE: 'Offline',
4012
+ };
4013
+
4014
+ class ContactItemDefaultStatusComponent {
4015
+ constructor() {
4016
+ this.CONTACT_STATUS = CONTACT_DEFAULT_STATUS;
4017
+ }
4018
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ContactItemDefaultStatusComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4019
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: ContactItemDefaultStatusComponent, selector: "granite-contact-item-default-status", inputs: { status: "status" }, host: { classAttribute: "granite-contact-item-default-status" }, ngImport: i0, template: "<ng-container [ngSwitch]=\"status\">\n <ng-container *ngSwitchCase=\"CONTACT_STATUS.AVAILABLE\">\n <svg\n data-fnd=\"available\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"9\"\n height=\"10\"\n viewBox=\"0 0 9 10\"\n fill=\"none\"\n >\n <path\n d=\"M4.085 0.915009C1.83008 0.915009 0 2.74509 0 5.00001C0 7.25493 1.83008 9.08501 4.085 9.08501C6.33992 9.08501 8.17 7.25493 8.17 5.00001C8.17 2.74509 6.33992 0.915009 4.085 0.915009Z\"\n fill=\"#17A511\"\n />\n <path\n d=\"M2.45099 4.82838L3.47224 6.06418L5.51474 4.21048\"\n stroke=\"white\"\n stroke-linecap=\"round\"\n />\n </svg>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"CONTACT_STATUS.BUSY\">\n <svg\n data-fnd=\"busy\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"9\"\n height=\"9\"\n viewBox=\"0 0 9 9\"\n fill=\"none\"\n >\n <path\n d=\"M4.25504 0.169922C2.00012 0.169922 0.170044 2 0.170044 4.25492C0.170044 6.50984 2.00012 8.33992 4.25504 8.33992C6.50996 8.33992 8.34004 6.50984 8.34004 4.25492C8.34004 2 6.50996 0.169922 4.25504 0.169922Z\"\n fill=\"#D23335\"\n />\n </svg>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"CONTACT_STATUS.DO_NOT_DISTURB\">\n <svg\n data-fnd=\"doNotDisturb\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"9\"\n height=\"9\"\n viewBox=\"0 0 9 9\"\n fill=\"none\"\n >\n <path\n d=\"M4.085 0C1.83008 0 0 1.83008 0 4.085C0 6.33992 1.83008 8.17 4.085 8.17C6.33992 8.17 8.17 6.33992 8.17 4.085C8.17 1.83008 6.33992 0 4.085 0Z\"\n fill=\"#D23335\"\n />\n <path d=\"M2 4L6 4\" stroke=\"white\" stroke-linecap=\"round\" />\n </svg>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"CONTACT_STATUS.AWAY\">\n <svg\n data-fnd=\"away\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"9\"\n height=\"9\"\n viewBox=\"0 0 9 9\"\n fill=\"none\"\n >\n <path\n d=\"M4.085 0C1.83008 0 0 1.83008 0 4.085C0 6.33992 1.83008 8.17 4.085 8.17C6.33992 8.17 8.17 6.33992 8.17 4.085C8.17 1.83008 6.33992 0 4.085 0Z\"\n fill=\"#EDA000\"\n />\n <path d=\"M4 2L4 3.875L5.5 5.5\" stroke=\"white\" stroke-linecap=\"round\" />\n </svg>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"CONTACT_STATUS.OFFLINE\">\n <svg\n data-fnd=\"offline\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"9\"\n height=\"9\"\n viewBox=\"0 0 9 9\"\n fill=\"none\"\n >\n <path\n d=\"M0.5 4.085C0.5 2.10622 2.10622 0.5 4.085 0.5C6.06378 0.5 7.67 2.10622 7.67 4.085C7.67 6.06378 6.06378 7.67 4.085 7.67C2.10622 7.67 0.5 6.06378 0.5 4.085Z\"\n stroke=\"#7D7D7D\"\n />\n <path d=\"M3 3L5 5\" stroke=\"#7D7D7D\" stroke-linecap=\"round\" />\n <path d=\"M5 3L3 5\" stroke=\"#7D7D7D\" stroke-linecap=\"round\" />\n </svg>\n </ng-container>\n</ng-container>\n", dependencies: [{ kind: "directive", type: i1$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4020
+ }
4021
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ContactItemDefaultStatusComponent, decorators: [{
4022
+ type: Component,
4023
+ args: [{ selector: 'granite-contact-item-default-status', host: {
4024
+ class: 'granite-contact-item-default-status',
4025
+ }, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container [ngSwitch]=\"status\">\n <ng-container *ngSwitchCase=\"CONTACT_STATUS.AVAILABLE\">\n <svg\n data-fnd=\"available\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"9\"\n height=\"10\"\n viewBox=\"0 0 9 10\"\n fill=\"none\"\n >\n <path\n d=\"M4.085 0.915009C1.83008 0.915009 0 2.74509 0 5.00001C0 7.25493 1.83008 9.08501 4.085 9.08501C6.33992 9.08501 8.17 7.25493 8.17 5.00001C8.17 2.74509 6.33992 0.915009 4.085 0.915009Z\"\n fill=\"#17A511\"\n />\n <path\n d=\"M2.45099 4.82838L3.47224 6.06418L5.51474 4.21048\"\n stroke=\"white\"\n stroke-linecap=\"round\"\n />\n </svg>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"CONTACT_STATUS.BUSY\">\n <svg\n data-fnd=\"busy\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"9\"\n height=\"9\"\n viewBox=\"0 0 9 9\"\n fill=\"none\"\n >\n <path\n d=\"M4.25504 0.169922C2.00012 0.169922 0.170044 2 0.170044 4.25492C0.170044 6.50984 2.00012 8.33992 4.25504 8.33992C6.50996 8.33992 8.34004 6.50984 8.34004 4.25492C8.34004 2 6.50996 0.169922 4.25504 0.169922Z\"\n fill=\"#D23335\"\n />\n </svg>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"CONTACT_STATUS.DO_NOT_DISTURB\">\n <svg\n data-fnd=\"doNotDisturb\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"9\"\n height=\"9\"\n viewBox=\"0 0 9 9\"\n fill=\"none\"\n >\n <path\n d=\"M4.085 0C1.83008 0 0 1.83008 0 4.085C0 6.33992 1.83008 8.17 4.085 8.17C6.33992 8.17 8.17 6.33992 8.17 4.085C8.17 1.83008 6.33992 0 4.085 0Z\"\n fill=\"#D23335\"\n />\n <path d=\"M2 4L6 4\" stroke=\"white\" stroke-linecap=\"round\" />\n </svg>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"CONTACT_STATUS.AWAY\">\n <svg\n data-fnd=\"away\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"9\"\n height=\"9\"\n viewBox=\"0 0 9 9\"\n fill=\"none\"\n >\n <path\n d=\"M4.085 0C1.83008 0 0 1.83008 0 4.085C0 6.33992 1.83008 8.17 4.085 8.17C6.33992 8.17 8.17 6.33992 8.17 4.085C8.17 1.83008 6.33992 0 4.085 0Z\"\n fill=\"#EDA000\"\n />\n <path d=\"M4 2L4 3.875L5.5 5.5\" stroke=\"white\" stroke-linecap=\"round\" />\n </svg>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"CONTACT_STATUS.OFFLINE\">\n <svg\n data-fnd=\"offline\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"9\"\n height=\"9\"\n viewBox=\"0 0 9 9\"\n fill=\"none\"\n >\n <path\n d=\"M0.5 4.085C0.5 2.10622 2.10622 0.5 4.085 0.5C6.06378 0.5 7.67 2.10622 7.67 4.085C7.67 6.06378 6.06378 7.67 4.085 7.67C2.10622 7.67 0.5 6.06378 0.5 4.085Z\"\n stroke=\"#7D7D7D\"\n />\n <path d=\"M3 3L5 5\" stroke=\"#7D7D7D\" stroke-linecap=\"round\" />\n <path d=\"M5 3L3 5\" stroke=\"#7D7D7D\" stroke-linecap=\"round\" />\n </svg>\n </ng-container>\n</ng-container>\n" }]
4026
+ }], propDecorators: { status: [{
4027
+ type: Input
4028
+ }] } });
4029
+
4030
+ class GraniteContactItemTitleComponent {
4031
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteContactItemTitleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4032
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: GraniteContactItemTitleComponent, selector: "granite-contact-item-title", inputs: { contact: "contact" }, host: { classAttribute: "granite-contact-item-title" }, ngImport: i0, template: "<button\n tabindex=\"0\"\n data-fnd=\"contact-item-title\"\n [class.title-status-active]=\"!contact.disabled && !contact.options\"\n [class.title-status-disabled]=\"contact.disabled\"\n [class.title-status-parent]=\"!contact.disabled && contact.options\"\n>\n {{ contact.label }}\n</button>\n", styles: [".title-status-parent,.title-status-disabled,.title-status-active{font-size:var(--granite-font-size-micro);font-weight:var(--granite-font-weight-regular)}.title-status-active{color:var(--granite-color-text-link)}.title-status-active:hover{text-decoration:underline;cursor:pointer}.title-status-disabled{color:var(--granite-color-text-hint)}.title-status-parent{color:var(--granite-color-text)}button{all:unset}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4033
+ }
4034
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteContactItemTitleComponent, decorators: [{
4035
+ type: Component,
4036
+ args: [{ selector: 'granite-contact-item-title', host: {
4037
+ class: 'granite-contact-item-title',
4038
+ }, changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\n tabindex=\"0\"\n data-fnd=\"contact-item-title\"\n [class.title-status-active]=\"!contact.disabled && !contact.options\"\n [class.title-status-disabled]=\"contact.disabled\"\n [class.title-status-parent]=\"!contact.disabled && contact.options\"\n>\n {{ contact.label }}\n</button>\n", styles: [".title-status-parent,.title-status-disabled,.title-status-active{font-size:var(--granite-font-size-micro);font-weight:var(--granite-font-weight-regular)}.title-status-active{color:var(--granite-color-text-link)}.title-status-active:hover{text-decoration:underline;cursor:pointer}.title-status-disabled{color:var(--granite-color-text-hint)}.title-status-parent{color:var(--granite-color-text)}button{all:unset}\n"] }]
4039
+ }], propDecorators: { contact: [{
4040
+ type: Input
4041
+ }] } });
4042
+
4043
+ class GraniteContactItemComponent {
4044
+ constructor() {
4045
+ this.selectedContact = new EventEmitter();
4046
+ }
4047
+ emitSelectedContact(contact) {
4048
+ if (contact.disabled || contact.options) {
4049
+ return;
4050
+ }
4051
+ this.selectedContact.emit(contact);
4052
+ }
4053
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteContactItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4054
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: GraniteContactItemComponent, selector: "granite-contact-item", inputs: { contact: "contact" }, outputs: { selectedContact: "selectedContact" }, host: { classAttribute: "granite-contact-item" }, ngImport: i0, template: "<div class=\"contact-item\" [attr.data-fnd]=\"contact.name\">\n <div class=\"contact-item-main\">\n <ng-container\n *ngTemplateOutlet=\"\n contactItem;\n context: { contact: contact, testName: 'contact' }\n \"\n ></ng-container>\n </div>\n\n <ul *ngIf=\"contact.options\" class=\"contact-item-options\">\n <li\n tabindex=\"0\"\n *ngFor=\"let option of contact.options; let i = index\"\n class=\"option-item\"\n [attr.data-fnd]=\"'contact-option-' + i\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n contactItem;\n context: { contact: option, testName: 'contact-option-' + i }\n \"\n ></ng-container>\n </li>\n </ul>\n</div>\n\n<ng-template let-testName=\"testName\" let-contact=\"contact\" #contactItem>\n <granite-icon\n [attr.data-fnd]=\"testName + '-icon'\"\n fontIcon=\"{{ contact.iconName }}\"\n ></granite-icon>\n\n <granite-contact-item-title\n [attr.data-fnd]=\"testName + '-title'\"\n tabindex=\"0\"\n [contact]=\"contact\"\n (click)=\"emitSelectedContact(contact)\"\n ></granite-contact-item-title>\n\n <ng-container *ngIf=\"contact.statusTemplate; else defaultStatus\">\n <ng-container *ngTemplateOutlet=\"contact.statusTemplate\"></ng-container>\n </ng-container>\n\n <ng-template #defaultStatus>\n <granite-contact-item-default-status\n [attr.data-fnd]=\"testName + '-status'\"\n [status]=\"contact.status\"\n ></granite-contact-item-default-status>\n </ng-template>\n</ng-template>\n", styles: [".contact-item{display:flex;flex-direction:column;gap:var(--granite-spacing-8)}.contact-item-main{display:flex;gap:var(--granite-spacing-8);align-self:stretch;align-items:center}.contact-item-options{display:flex;flex-direction:column;padding-inline-start:var(--granite-spacing-24);gap:var(--granite-spacing-4);list-style:none}.contact-item-options .option-item{display:flex;gap:var(--granite-spacing-8);align-self:stretch;align-items:center}.contact-item granite-contact-item-title,.contact-item granite-contact-item-default-status{display:flex}granite-icon{padding:0;color:var(--granite-color-text-hint);width:var(--granite-size-base-rem);height:var(--granite-size-base-rem)}\n"], dependencies: [{ kind: "component", type: GraniteIconComponent, selector: "granite-icon", inputs: ["fontIcon"] }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ContactItemDefaultStatusComponent, selector: "granite-contact-item-default-status", inputs: ["status"] }, { kind: "component", type: GraniteContactItemTitleComponent, selector: "granite-contact-item-title", inputs: ["contact"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4055
+ }
4056
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteContactItemComponent, decorators: [{
4057
+ type: Component,
4058
+ args: [{ selector: 'granite-contact-item', host: {
4059
+ class: 'granite-contact-item',
4060
+ }, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"contact-item\" [attr.data-fnd]=\"contact.name\">\n <div class=\"contact-item-main\">\n <ng-container\n *ngTemplateOutlet=\"\n contactItem;\n context: { contact: contact, testName: 'contact' }\n \"\n ></ng-container>\n </div>\n\n <ul *ngIf=\"contact.options\" class=\"contact-item-options\">\n <li\n tabindex=\"0\"\n *ngFor=\"let option of contact.options; let i = index\"\n class=\"option-item\"\n [attr.data-fnd]=\"'contact-option-' + i\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n contactItem;\n context: { contact: option, testName: 'contact-option-' + i }\n \"\n ></ng-container>\n </li>\n </ul>\n</div>\n\n<ng-template let-testName=\"testName\" let-contact=\"contact\" #contactItem>\n <granite-icon\n [attr.data-fnd]=\"testName + '-icon'\"\n fontIcon=\"{{ contact.iconName }}\"\n ></granite-icon>\n\n <granite-contact-item-title\n [attr.data-fnd]=\"testName + '-title'\"\n tabindex=\"0\"\n [contact]=\"contact\"\n (click)=\"emitSelectedContact(contact)\"\n ></granite-contact-item-title>\n\n <ng-container *ngIf=\"contact.statusTemplate; else defaultStatus\">\n <ng-container *ngTemplateOutlet=\"contact.statusTemplate\"></ng-container>\n </ng-container>\n\n <ng-template #defaultStatus>\n <granite-contact-item-default-status\n [attr.data-fnd]=\"testName + '-status'\"\n [status]=\"contact.status\"\n ></granite-contact-item-default-status>\n </ng-template>\n</ng-template>\n", styles: [".contact-item{display:flex;flex-direction:column;gap:var(--granite-spacing-8)}.contact-item-main{display:flex;gap:var(--granite-spacing-8);align-self:stretch;align-items:center}.contact-item-options{display:flex;flex-direction:column;padding-inline-start:var(--granite-spacing-24);gap:var(--granite-spacing-4);list-style:none}.contact-item-options .option-item{display:flex;gap:var(--granite-spacing-8);align-self:stretch;align-items:center}.contact-item granite-contact-item-title,.contact-item granite-contact-item-default-status{display:flex}granite-icon{padding:0;color:var(--granite-color-text-hint);width:var(--granite-size-base-rem);height:var(--granite-size-base-rem)}\n"] }]
4061
+ }], propDecorators: { contact: [{
4062
+ type: Input
4063
+ }], selectedContact: [{
4064
+ type: Output
4065
+ }] } });
4066
+
4067
+ class GraniteContactsComponent extends ContactsTriggerDataComponent {
4068
+ constructor() {
4069
+ super(...arguments);
4070
+ this.contacts = [];
4071
+ this.defaultShow = false;
4072
+ this.selectedContact = new EventEmitter();
4073
+ this._contactsExtended = [];
4074
+ }
4075
+ ngOnChanges(changes) {
4076
+ if (changes.contacts && !changes.contacts.currentValue) {
4077
+ this.contacts = [];
4078
+ }
4079
+ }
4080
+ ngAfterContentChecked() {
4081
+ this._contactsExtended = this.setProperCustomStatusTemplates(this._customStatuses.toArray(), this.contacts);
4082
+ }
4083
+ onSelectedContact(contact) {
4084
+ this.selectedContact.emit(contact);
4085
+ }
4086
+ setProperCustomStatusTemplates(customStatusDirectives, contacts) {
4087
+ return this.applyTemplates(contacts, customStatusDirectives);
4088
+ }
4089
+ applyTemplates(contacts, directives) {
4090
+ return contacts.map((item) => {
4091
+ const matchingDirective = directives.find((d) => d.graniteCustomStatus === item.status);
4092
+ const result = { ...item };
4093
+ if (matchingDirective) {
4094
+ result.statusTemplate = matchingDirective.templateRef;
4095
+ }
4096
+ if (item.options) {
4097
+ result.options = this.applyTemplates(item.options, directives);
4098
+ }
4099
+ return result;
4100
+ });
4101
+ }
4102
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteContactsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
4103
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: GraniteContactsComponent, selector: "granite-contacts", inputs: { contacts: "contacts", profile: "profile", profileClass: "profileClass", defaultShow: "defaultShow" }, outputs: { selectedContact: "selectedContact" }, host: { classAttribute: "granite-contacts" }, queries: [{ propertyName: "customProfileDirective", first: true, predicate: GraniteCustomProfileDirective, descendants: true }, { propertyName: "_customStatuses", predicate: GraniteCustomStatusDirective }], exportAs: ["graniteContacts"], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ng-template #contactsTemplate>\n <div data-fnd=\"contacts\" class=\"granite-contact\">\n <ng-container *ngIf=\"customProfileDirective; else defaultProfile\">\n <ng-container\n *ngTemplateOutlet=\"customProfileDirective.templateRef\"\n ></ng-container>\n </ng-container>\n\n <ng-template #defaultProfile>\n <granite-contacts-profile\n data-fnd=\"default-profile\"\n [profileClass]=\"profileClass\"\n [profile]=\"profile\"\n ></granite-contacts-profile>\n </ng-template>\n\n <ul class=\"contact-list\">\n <li *ngFor=\"let contact of _contactsExtended\">\n <granite-contact-item\n [contact]=\"contact\"\n (selectedContact)=\"onSelectedContact($event)\"\n ></granite-contact-item>\n </li>\n </ul>\n </div>\n</ng-template>\n\n<ng-container *ngIf=\"defaultShow\">\n <ng-container *ngTemplateOutlet=\"contactsTemplate\"></ng-container>\n</ng-container>\n", styles: [".granite-contact{display:inline-block;font-size:var(--granite-font-size-body);font-family:var(--granite-font-family-default);color:var(--granite-color-text-weak);min-width:10rem;max-width:20rem;padding:var(--granite-spacing-16);box-shadow:var(--granite-shadow-popover);background:var(--granite-color-background-variant)}.granite-contact .contact-list{display:flex;flex-direction:column;align-items:flex-start;gap:var(--granite-spacing-8);list-style-type:none;padding:0;margin:0}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: GraniteContactsProfileComponent, selector: "granite-contacts-profile", inputs: ["profile", "profileClass"] }, { kind: "component", type: GraniteContactItemComponent, selector: "granite-contact-item", inputs: ["contact"], outputs: ["selectedContact"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4104
+ }
4105
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteContactsComponent, decorators: [{
4106
+ type: Component,
4107
+ args: [{ selector: 'granite-contacts', exportAs: 'graniteContacts', host: {
4108
+ class: 'granite-contacts',
4109
+ }, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template #contactsTemplate>\n <div data-fnd=\"contacts\" class=\"granite-contact\">\n <ng-container *ngIf=\"customProfileDirective; else defaultProfile\">\n <ng-container\n *ngTemplateOutlet=\"customProfileDirective.templateRef\"\n ></ng-container>\n </ng-container>\n\n <ng-template #defaultProfile>\n <granite-contacts-profile\n data-fnd=\"default-profile\"\n [profileClass]=\"profileClass\"\n [profile]=\"profile\"\n ></granite-contacts-profile>\n </ng-template>\n\n <ul class=\"contact-list\">\n <li *ngFor=\"let contact of _contactsExtended\">\n <granite-contact-item\n [contact]=\"contact\"\n (selectedContact)=\"onSelectedContact($event)\"\n ></granite-contact-item>\n </li>\n </ul>\n </div>\n</ng-template>\n\n<ng-container *ngIf=\"defaultShow\">\n <ng-container *ngTemplateOutlet=\"contactsTemplate\"></ng-container>\n</ng-container>\n", styles: [".granite-contact{display:inline-block;font-size:var(--granite-font-size-body);font-family:var(--granite-font-family-default);color:var(--granite-color-text-weak);min-width:10rem;max-width:20rem;padding:var(--granite-spacing-16);box-shadow:var(--granite-shadow-popover);background:var(--granite-color-background-variant)}.granite-contact .contact-list{display:flex;flex-direction:column;align-items:flex-start;gap:var(--granite-spacing-8);list-style-type:none;padding:0;margin:0}\n"] }]
4110
+ }], propDecorators: { contacts: [{
4111
+ type: Input
4112
+ }], profile: [{
4113
+ type: Input
4114
+ }], profileClass: [{
4115
+ type: Input
4116
+ }], defaultShow: [{
4117
+ type: Input
4118
+ }], selectedContact: [{
4119
+ type: Output
4120
+ }], _customStatuses: [{
4121
+ type: ContentChildren,
4122
+ args: [GraniteCustomStatusDirective]
4123
+ }], customProfileDirective: [{
4124
+ type: ContentChild,
4125
+ args: [GraniteCustomProfileDirective]
4126
+ }] } });
4127
+
4128
+ class GraniteContactsTriggerForDirective {
4129
+ constructor(_overlay, _element, _viewContainerRef, _outsideClickDispatcher,
4130
+ /** Client input device information */
4131
+ _clientInput,
4132
+ /** Client output device information */
4133
+ _clientOutput, _dir, _focusMonitor) {
4134
+ this._overlay = _overlay;
4135
+ this._element = _element;
4136
+ this._viewContainerRef = _viewContainerRef;
4137
+ this._outsideClickDispatcher = _outsideClickDispatcher;
4138
+ this._clientInput = _clientInput;
4139
+ this._clientOutput = _clientOutput;
4140
+ this._dir = _dir;
4141
+ this._focusMonitor = _focusMonitor;
4142
+ /** Whether the associated contacts is open */
4143
+ this._isContactsOpen = false;
4144
+ this._contactsCloseSubscription = Subscription.EMPTY;
4145
+ this._portal = null;
4146
+ this._overlayRef = null;
4147
+ }
4148
+ ngAfterContentInit() {
4149
+ const selectedContact = this.contacts.selectedContact;
4150
+ this._contactsCloseSubscription = selectedContact.subscribe(() => this.closeContacts());
4151
+ }
4152
+ ngOnDestroy() {
4153
+ if (this._overlayRef) {
4154
+ this._overlayRef.dispose();
4155
+ this._overlayRef = null;
4156
+ }
4157
+ this._contactsCloseSubscription.unsubscribe();
4158
+ }
4159
+ isOpen() {
4160
+ return this._isContactsOpen;
4161
+ }
4162
+ openContacts() {
4163
+ if (this._isContactsOpen) {
4164
+ return;
4165
+ }
4166
+ this.contacts.direction = this._dir.value === 'rtl' ? 'rtl' : 'ltr';
4167
+ this.contacts.clientInput = this._clientInput;
4168
+ this.contacts.clientOutput = this._clientOutput;
4169
+ const panelClass = [];
4170
+ if (this._clientOutput?.device === 'touch') {
4171
+ panelClass.push('granite-overlay-pane-center');
4172
+ }
4173
+ const scrollStrategy = this._clientOutput?.device !== 'touch'
4174
+ ? this._overlay.scrollStrategies.reposition()
4175
+ : this._overlay.scrollStrategies.block();
4176
+ const hasBackdrop = this._clientOutput?.device === 'touch';
4177
+ if (!this._overlayRef) {
4178
+ const config = new OverlayConfig({
4179
+ positionStrategy: this._positionStrategy(),
4180
+ backdropClass: 'granite-overlay-dark-glass-backdrop',
4181
+ scrollStrategy,
4182
+ direction: this._dir,
4183
+ panelClass,
4184
+ hasBackdrop,
4185
+ });
4186
+ this._overlayRef = this._overlay.create(config);
4187
+ }
4188
+ if (!this._portal ||
4189
+ this._portal.templateRef !== this.contacts.templateRef) {
4190
+ this._portal = new TemplatePortal(this.contacts.templateRef, this._viewContainerRef);
4191
+ }
4192
+ // Attach portal to overlay ref (which is a portal outlet)
4193
+ this._overlayRef.attach(this._portal);
4194
+ this._outsideClickDispatcher.add(this._overlayRef);
4195
+ this._overlayRef.outsidePointerEvents().subscribe((event) => {
4196
+ event.stopPropagation();
4197
+ this.closeContacts();
4198
+ });
4199
+ this._isContactsOpen = true;
4200
+ }
4201
+ /** Toggles the contacts between the open and closed states. */
4202
+ toggleContacts() {
4203
+ if (this._isContactsOpen) {
4204
+ this.closeContacts();
4205
+ }
4206
+ else {
4207
+ this.openContacts();
4208
+ }
4209
+ }
4210
+ /** Close the associated contacts */
4211
+ closeContacts() {
4212
+ if (!this._overlayRef || !this._isContactsOpen) {
4213
+ return;
4214
+ }
4215
+ this._outsideClickDispatcher.remove(this._overlayRef);
4216
+ this._overlayRef.detach();
4217
+ this._restoreFocus();
4218
+ this._isContactsOpen = false;
4219
+ }
4220
+ /** Handles key presses on the trigger. */
4221
+ _handleKeydown(event) {
4222
+ if (event.key === 'Enter') {
4223
+ event.preventDefault();
4224
+ this.toggleContacts();
4225
+ }
4226
+ }
4227
+ /** Handles click events on the trigger. */
4228
+ _handleClick() {
4229
+ this.toggleContacts();
4230
+ }
4231
+ /**
4232
+ * Restores focus to the element that was focused before the contacts was open.
4233
+ */
4234
+ _restoreFocus(origin = 'program', options) {
4235
+ if (this._focusMonitor) {
4236
+ this._focusMonitor.focusVia(this._element, origin, options);
4237
+ }
4238
+ else {
4239
+ this._element.nativeElement.focus(options);
4240
+ }
4241
+ }
4242
+ /**
4243
+ * Returns strategy for positioning the overlay for desktop devices:
4244
+ */
4245
+ _desktopPositionStrategy() {
4246
+ const positionStrategy = this._overlay
4247
+ .position()
4248
+ .flexibleConnectedTo(this._element)
4249
+ .withLockedPosition()
4250
+ .withTransformOriginOn('.granite-contacts')
4251
+ .withPush(false);
4252
+ this._setPosition(positionStrategy);
4253
+ return positionStrategy;
4254
+ }
4255
+ /**
4256
+ * Sets the appropriate positions on a position strategy
4257
+ * so the overlay connects with the trigger correctly.
4258
+ * @param positionStrategy Strategy whose position to update.
4259
+ */
4260
+ _setPosition(positionStrategy) {
4261
+ const [originX, originFallbackX] = this.contacts.xPosition === 'before'
4262
+ ? ['end', 'start']
4263
+ : ['start', 'end'];
4264
+ const [overlayY, overlayFallbackY] = this.contacts.yPosition === 'above'
4265
+ ? ['bottom', 'top']
4266
+ : ['top', 'bottom'];
4267
+ let [originY, originFallbackY] = [overlayY, overlayFallbackY];
4268
+ const [overlayX, overlayFallbackX] = [originX, originFallbackX];
4269
+ const offsetY = 0;
4270
+ originY = overlayY === 'top' ? 'bottom' : 'top';
4271
+ originFallbackY = overlayFallbackY === 'top' ? 'bottom' : 'top';
4272
+ positionStrategy.withPositions([
4273
+ { originX, originY, overlayX, overlayY, offsetY },
4274
+ {
4275
+ originX: originFallbackX,
4276
+ originY,
4277
+ overlayX: overlayFallbackX,
4278
+ overlayY,
4279
+ offsetY,
4280
+ },
4281
+ {
4282
+ originX,
4283
+ originY: originFallbackY,
4284
+ overlayX,
4285
+ overlayY: overlayFallbackY,
4286
+ offsetY: -offsetY,
4287
+ },
4288
+ {
4289
+ originX: originFallbackX,
4290
+ originY: originFallbackY,
4291
+ overlayX: overlayFallbackX,
4292
+ overlayY: overlayFallbackY,
4293
+ offsetY: -offsetY,
4294
+ },
4295
+ ]);
4296
+ }
4297
+ /**
4298
+ * Returns strategy for positioning the overlay depending on what type of
4299
+ * device the contacts is being shown on
4300
+ */
4301
+ _positionStrategy() {
4302
+ if (this._clientOutput?.device !== 'touch') {
4303
+ return this._desktopPositionStrategy();
4304
+ }
4305
+ return this._touchPositionStrategy();
4306
+ }
4307
+ /**
4308
+ * Returns strategy for positioning the overlay for touch devices:
4309
+ * Place centered in the screen.
4310
+ */
4311
+ _touchPositionStrategy() {
4312
+ return this._overlay.position().global();
4313
+ }
4314
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteContactsTriggerForDirective, deps: [{ token: i1$2.Overlay }, { token: i0.ElementRef }, { token: i0.ViewContainerRef }, { token: i1$2.OverlayOutsideClickDispatcher }, { token: GRANITE_CLIENT_INPUT, optional: true }, { token: GRANITE_CLIENT_OUTPUT, optional: true }, { token: i3.Directionality, optional: true }, { token: i1.FocusMonitor }], target: i0.ɵɵFactoryTarget.Directive }); }
4315
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.4", type: GraniteContactsTriggerForDirective, selector: "[graniteContactsTriggerFor]", inputs: { contacts: ["graniteContactsTriggerFor", "contacts"] }, host: { attributes: { "aria-haspopup": "true" }, listeners: { "keydown": "_handleKeydown($event)", "click": "_handleClick($event)" }, properties: { "attr.aria-expanded": "_isContactsOpen || null", "attr.aria-controls": "_isContactsOpen ? contacts.panelId : null" }, classAttribute: "granite-contacts-trigger" }, ngImport: i0 }); }
4316
+ }
4317
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteContactsTriggerForDirective, decorators: [{
4318
+ type: Directive,
4319
+ args: [{
4320
+ selector: `[graniteContactsTriggerFor]`,
4321
+ host: {
4322
+ class: 'granite-contacts-trigger',
4323
+ 'aria-haspopup': 'true',
4324
+ '[attr.aria-expanded]': '_isContactsOpen || null',
4325
+ '[attr.aria-controls]': '_isContactsOpen ? contacts.panelId : null',
4326
+ '(keydown)': '_handleKeydown($event)',
4327
+ '(click)': '_handleClick($event)',
4328
+ },
4329
+ }]
4330
+ }], ctorParameters: () => [{ type: i1$2.Overlay }, { type: i0.ElementRef }, { type: i0.ViewContainerRef }, { type: i1$2.OverlayOutsideClickDispatcher }, { type: undefined, decorators: [{
4331
+ type: Inject,
4332
+ args: [GRANITE_CLIENT_INPUT]
4333
+ }, {
4334
+ type: Optional
4335
+ }] }, { type: undefined, decorators: [{
4336
+ type: Inject,
4337
+ args: [GRANITE_CLIENT_OUTPUT]
4338
+ }, {
4339
+ type: Optional
4340
+ }] }, { type: i3.Directionality, decorators: [{
4341
+ type: Optional
4342
+ }] }, { type: i1.FocusMonitor }], propDecorators: { contacts: [{
4343
+ type: Input,
4344
+ args: ['graniteContactsTriggerFor']
4345
+ }] } });
4346
+
4347
+ class GraniteContactsModule {
4348
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteContactsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
4349
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.4", ngImport: i0, type: GraniteContactsModule, declarations: [GraniteContactsComponent,
4350
+ GraniteContactsProfileComponent,
4351
+ GraniteContactItemComponent,
4352
+ ContactItemDefaultStatusComponent,
4353
+ GraniteContactItemTitleComponent,
4354
+ GraniteContactsTriggerForDirective,
4355
+ GraniteCustomStatusDirective,
4356
+ GraniteCustomProfileDirective], imports: [GraniteIconModule, CommonModule], exports: [GraniteContactsComponent,
4357
+ GraniteContactsTriggerForDirective,
4358
+ GraniteContactItemComponent,
4359
+ GraniteCustomStatusDirective,
4360
+ GraniteCustomProfileDirective] }); }
4361
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteContactsModule, imports: [GraniteIconModule, CommonModule] }); }
4362
+ }
4363
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteContactsModule, decorators: [{
4364
+ type: NgModule,
4365
+ args: [{
4366
+ imports: [GraniteIconModule, CommonModule],
4367
+ declarations: [
4368
+ GraniteContactsComponent,
4369
+ GraniteContactsProfileComponent,
4370
+ GraniteContactItemComponent,
4371
+ ContactItemDefaultStatusComponent,
4372
+ GraniteContactItemTitleComponent,
4373
+ GraniteContactsTriggerForDirective,
4374
+ GraniteCustomStatusDirective,
4375
+ GraniteCustomProfileDirective,
4376
+ ],
4377
+ exports: [
4378
+ GraniteContactsComponent,
4379
+ GraniteContactsTriggerForDirective,
4380
+ GraniteContactItemComponent,
4381
+ GraniteCustomStatusDirective,
4382
+ GraniteCustomProfileDirective,
4383
+ ],
4384
+ }]
4385
+ }] });
4386
+
3928
4387
  class GraniteHideOnOverflowDirective {
3929
4388
  constructor(_elementRef, renderer) {
3930
4389
  this._elementRef = _elementRef;
@@ -4501,5 +4960,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
4501
4960
  * Generated bundle index. Do not edit.
4502
4961
  */
4503
4962
 
4504
- export { ButtonSelectors, ClientInputDesktopDirective, ClientInputTouchDirective, ClientOutputDesktopDirective, ClientOutputTouchDirective, GRANITE_CLIENT_INPUT, GRANITE_CLIENT_OUTPUT, GraniteAnchorComponent, GraniteArrangeGridComponent, GraniteArrangeGridItemComponent, GraniteArrangeGridModule, GraniteArrangeGridOrientation, GraniteBadgeComponent, GraniteBadgeHarness, GraniteBadgeModule, GraniteButtonComponent, GraniteButtonModule, GraniteCardActionsComponent, GraniteCardAvatarComponent, GraniteCardBodyComponent, GraniteCardComponent, GraniteCardContentComponent, GraniteCardFooterComponent, GraniteCardHeaderComponent, GraniteCardHeaderSubTitleComponent, GraniteCardHeaderTitleComponent, GraniteCardListComponent, GraniteCardListModule, GraniteCheckboxComponent, GraniteCheckboxGroupComponent, GraniteCheckboxModule, GraniteChipComponent, GraniteChipInputDirective, GraniteChipListComponent, GraniteChipSelectionChangeEvent, GraniteChipsModule, GraniteCollapsibleConditionalBodyDirective, GraniteCollapsibleConditionalHeaderDirective, GraniteCollapsibleGroupComponent, GraniteCollapsibleGroupModule, GraniteCoreModule, GraniteDividerDirective, GraniteGridComponent, GraniteGridItemComponent, GraniteGridModule, GraniteHideOnOverflowDirective, GraniteIconComponent, GraniteIconModule, GraniteInputFieldComponent, GraniteInputFieldModule, GraniteLabelComponent, GraniteLabelModule, GraniteMenuComponent, GraniteMenuHarness, GraniteMenuItemComponent, GraniteMenuItemHarness, GraniteMenuModule, GraniteMenuTouchCloseComponent, GraniteMenuTouchTitleItemComponent, GraniteMenuTriggerForDirective, GraniteProgressBarComponent, GraniteProgressBarModule, GraniteRadioButtonComponent, GraniteRadioButtonModule, GraniteRadioGroupComponent, GraniteTitleDirective, GraniteTitlePipe, GraniteToggleSwitchComponent, GraniteToggleSwitchModule, PurePipesModule, deviceDesktop, deviceTouch, disabledMixin, graniteMenuDesktopAnimations, graniteMenuTouchAnimations };
4963
+ export { ButtonSelectors, CONTACT_DEFAULT_STATUS, ClientInputDesktopDirective, ClientInputTouchDirective, ClientOutputDesktopDirective, ClientOutputTouchDirective, ContactItemDefaultStatusComponent, GRANITE_CLIENT_INPUT, GRANITE_CLIENT_OUTPUT, GraniteAnchorComponent, GraniteArrangeGridComponent, GraniteArrangeGridItemComponent, GraniteArrangeGridModule, GraniteArrangeGridOrientation, GraniteBadgeComponent, GraniteBadgeHarness, GraniteBadgeModule, GraniteButtonComponent, GraniteButtonModule, GraniteCardActionsComponent, GraniteCardAvatarComponent, GraniteCardBodyComponent, GraniteCardComponent, GraniteCardContentComponent, GraniteCardFooterComponent, GraniteCardHeaderComponent, GraniteCardHeaderSubTitleComponent, GraniteCardHeaderTitleComponent, GraniteCardListComponent, GraniteCardListModule, GraniteCheckboxComponent, GraniteCheckboxGroupComponent, GraniteCheckboxModule, GraniteChipComponent, GraniteChipInputDirective, GraniteChipListComponent, GraniteChipSelectionChangeEvent, GraniteChipsModule, GraniteCollapsibleConditionalBodyDirective, GraniteCollapsibleConditionalHeaderDirective, GraniteCollapsibleGroupComponent, GraniteCollapsibleGroupModule, GraniteContactItemComponent, GraniteContactItemTitleComponent, GraniteContactsComponent, GraniteContactsModule, GraniteContactsProfileComponent, GraniteContactsTriggerForDirective, GraniteCoreModule, GraniteCustomProfileDirective, GraniteCustomStatusDirective, GraniteDividerDirective, GraniteGridComponent, GraniteGridItemComponent, GraniteGridModule, GraniteHideOnOverflowDirective, GraniteIconComponent, GraniteIconModule, GraniteInputFieldComponent, GraniteInputFieldModule, GraniteLabelComponent, GraniteLabelModule, GraniteMenuComponent, GraniteMenuHarness, GraniteMenuItemComponent, GraniteMenuItemHarness, GraniteMenuModule, GraniteMenuTouchCloseComponent, GraniteMenuTouchTitleItemComponent, GraniteMenuTriggerForDirective, GraniteProgressBarComponent, GraniteProgressBarModule, GraniteRadioButtonComponent, GraniteRadioButtonModule, GraniteRadioGroupComponent, GraniteTitleDirective, GraniteTitlePipe, GraniteToggleSwitchComponent, GraniteToggleSwitchModule, PurePipesModule, deviceDesktop, deviceTouch, disabledMixin, graniteMenuDesktopAnimations, graniteMenuTouchAnimations };
4505
4964
  //# sourceMappingURL=ifsworld-granite-components.mjs.map