@ifsworld/granite-components 13.2.6 → 13.2.7

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.
@@ -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, ContentChild, Pipe, ElementRef, inject } from '@angular/core';
2
+ import { Component, ChangeDetectionStrategy, Input, HostBinding, ContentChildren, NgModule, InjectionToken, Attribute, Inject, Optional, EventEmitter, QueryList, TemplateRef, Directive, ViewChild, Output, Self, HostListener, ContentChild, Injectable, inject, ElementRef, ViewContainerRef, Pipe } 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';
@@ -7,19 +7,20 @@ import { Subject, BehaviorSubject, combineLatest, Subscription, merge, of, asapS
7
7
  import { takeUntil, filter, map, startWith, switchMap, take, delay, debounceTime } from 'rxjs/operators';
8
8
  import { ComponentHarness, HarnessPredicate, TestKey } from '@angular/cdk/testing';
9
9
  import * as i1$2 from '@angular/cdk/overlay';
10
- import { OverlayConfig, OverlayModule } from '@angular/cdk/overlay';
10
+ import { OverlayConfig, OverlayModule, Overlay } from '@angular/cdk/overlay';
11
11
  import { TemplatePortal, PortalModule } from '@angular/cdk/portal';
12
12
  import { trigger, state, style, transition, group, query, animate, sequence } from '@angular/animations';
13
13
  import * as i1 from '@angular/cdk/a11y';
14
14
  import { FocusKeyManager, isFakeMousedownFromScreenReader } from '@angular/cdk/a11y';
15
15
  import { hasModifierKey, SPACE, BACKSPACE, DELETE, ENTER, TAB } from '@angular/cdk/keycodes';
16
- import * as i2 from '@angular/cdk/bidi';
16
+ import * as i3 from '@angular/cdk/bidi';
17
+ import { Directionality } from '@angular/cdk/bidi';
17
18
  import { normalizePassiveListenerOptions } from '@angular/cdk/platform';
18
- import * as i2$1 from '@angular/cdk/collections';
19
+ import * as i2 from '@angular/cdk/collections';
19
20
  import { SelectionModel } from '@angular/cdk/collections';
20
- import * as i2$2 from '@angular/forms';
21
+ import * as i2$1 from '@angular/forms';
21
22
  import { FormsModule, ReactiveFormsModule } from '@angular/forms';
22
- import * as i3 from '@ifsworld/granite-components/tooltip';
23
+ import * as i3$1 from '@ifsworld/granite-components/tooltip';
23
24
  import { GraniteTooltipModule } from '@ifsworld/granite-components/tooltip';
24
25
  import * as i1$3 from '@angular/cdk/scrolling';
25
26
  import { ScrollingModule } from '@angular/cdk/scrolling';
@@ -1950,7 +1951,7 @@ class GraniteMenuTriggerForDirective {
1950
1951
  }
1951
1952
  }
1952
1953
  }
1953
- 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: i0.ChangeDetectorRef }, { 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: i2.Directionality, optional: true }, { token: i1.FocusMonitor }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Directive }); }
1954
+ 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: i0.ChangeDetectorRef }, { 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 }); }
1954
1955
  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": "isMenuOpened || null", "attr.aria-controls": "isMenuOpened ? menu.panelId : null" }, classAttribute: "granite-menu-trigger" }, exportAs: ["graniteMenuTriggerFor"], usesOnChanges: true, ngImport: i0 }); }
1955
1956
  }
1956
1957
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteMenuTriggerForDirective, decorators: [{
@@ -1987,7 +1988,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
1987
1988
  type: Optional
1988
1989
  }, {
1989
1990
  type: Self
1990
- }] }, { type: i2.Directionality, decorators: [{
1991
+ }] }, { type: i3.Directionality, decorators: [{
1991
1992
  type: Optional
1992
1993
  }] }, { type: i1.FocusMonitor }, { type: undefined, decorators: [{
1993
1994
  type: Inject,
@@ -2375,7 +2376,7 @@ class GraniteRadioButtonComponent {
2375
2376
  _getInputElement() {
2376
2377
  return this._inputElement.nativeElement;
2377
2378
  }
2378
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteRadioButtonComponent, deps: [{ token: i1.FocusMonitor }, { token: i2$1.UniqueSelectionDispatcher }], target: i0.ɵɵFactoryTarget.Component }); }
2379
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteRadioButtonComponent, deps: [{ token: i1.FocusMonitor }, { token: i2.UniqueSelectionDispatcher }], target: i0.ɵɵFactoryTarget.Component }); }
2379
2380
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: GraniteRadioButtonComponent, selector: "granite-radio-button", inputs: { value: "value", id: "id", name: "name", checked: "checked", required: "required", disabled: "disabled", readonly: "readonly", labelPosition: "labelPosition", ariaLabel: ["aria-label", "ariaLabel"], ariaLabelledby: ["aria-labelledby", "ariaLabelledby"] }, outputs: { radioChange: "radioChange", radioBlur: "radioBlur" }, host: { properties: { "class.granite-radio-button-disabled": "disabled", "class.granite-radio-button-label-before": "_positionBefore", "class.granite-radio-button-checked": "checked", "class.granite-radio-button-readonly": "readonly" }, classAttribute: "granite-radio-button" }, viewQueries: [{ propertyName: "_inputElement", first: true, predicate: ["input"], descendants: true }], exportAs: ["graniteRadioButton"], usesOnChanges: true, ngImport: i0, template: "<label class=\"granite-radio-button-label\">\n <div class=\"granite-radio-button-outer-circle\">\n <input\n #input\n [id]=\"id\"\n class=\"granite-radio-button-input cdk-visually-hidden\"\n type=\"radio\"\n [attr.name]=\"name\"\n [disabled]=\"_radioDisabled\"\n [checked]=\"checked\"\n [readonly]=\"readonly\"\n [required]=\"required\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [attr.aria-checked]=\"checked.toString()\"\n [value]=\"value\"\n (change)=\"_radioChange($event.target)\"\n (blur)=\"_onBlur()\"\n />\n <div class=\"granite-radio-button-inner-circle\"></div>\n </div>\n <span class=\"granite-radio-button-text\">\n <ng-content></ng-content>\n </span>\n</label>\n", styles: [".cdk-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap;outline:0;-webkit-appearance:none;-moz-appearance:none;left:0}[dir=rtl] .cdk-visually-hidden{left:auto;right:0}:host(.granite-radio-button):not(.granite-radio-button-readonly):not(.granite-radio-button-disabled) .granite-radio-button-outer-circle:focus-within{border:.0625rem solid var(--granite-color-focus)}:host(.granite-radio-button):not(.granite-radio-button-readonly):not(.granite-radio-button-disabled) .granite-radio-button-outer-circle .granite-radio-button-label:hover{cursor:pointer}:host(.granite-radio-button):not(.granite-radio-button-readonly):not(.granite-radio-button-disabled) .granite-radio-button-outer-circle .granite-radio-button-label:hover .granite-radio-button-outer-circle{border-color:var(--granite-color-background-active-hover)}:host(.granite-radio-button):not(.granite-radio-button-readonly):not(.granite-radio-button-disabled) .granite-radio-button-outer-circle .granite-radio-button-label:hover .granite-radio-button-inner-circle{background-color:var(--granite-color-background-active-hover)}:host(.granite-radio-button-label-before) .granite-radio-button-label{flex-direction:row-reverse}:host(.granite-radio-button-label-before) .granite-radio-button-text{padding-inline-start:0;padding-inline-end:var(--granite-spacing-8)}:host(.granite-radio-button-checked) .granite-radio-button-inner-circle{visibility:visible;animation:grow-animation .1s}:host(.granite-radio-button-checked) .granite-radio-button-outer-circle{border-color:var(--granite-color-background-active)}:host(.granite-radio-button-checked).granite-radio-button-disabled .granite-radio-button-inner-circle{background-color:var(--granite-color-text)}:host(.granite-radio-button-checked).granite-radio-button-disabled .granite-radio-button-outer-circle{border:.0625rem solid var(--granite-color-text);background-color:transparent}:host(.granite-radio-button-checked).granite-radio-button-readonly .granite-radio-button-inner-circle{background-color:var(--granite-color-text)}:host(.granite-radio-button-checked).granite-radio-button-readonly .granite-radio-button-outer-circle{border:.0625rem solid var(--granite-color-text)}.granite-radio-button-text{padding-inline-start:var(--granite-spacing-8);color:var(--granite-color-text);font-size:var(--granite-font-size-body-small)}.granite-radio-button-text:empty{display:none}.granite-radio-button-label{display:flex;align-items:center;width:max-content;margin-inline-end:var(--granite-spacing-32);margin-block-end:var(--granite-spacing-4)}:host(.granite-radio-button-disabled) .granite-radio-button-text{opacity:.6}:host(.granite-radio-button-disabled) .granite-radio-button-outer-circle{opacity:.3;background-color:var(--granite-color-border-soft)}.granite-radio-button-outer-circle{height:1rem;width:1rem;border-radius:50%;box-sizing:border-box;border:.0625rem solid var(--granite-color-border-hard);display:flex;justify-content:center;position:relative;align-items:center}.granite-radio-button-inner-circle{width:.625rem;height:.625rem;visibility:hidden;position:absolute;border-radius:50%;background-color:var(--granite-color-background-active);margin:auto}@keyframes grow-animation{0%{transform:scale(0)}to{transform:scale(1)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2380
2381
  }
2381
2382
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteRadioButtonComponent, decorators: [{
@@ -2387,7 +2388,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
2387
2388
  '[class.granite-radio-button-checked]': 'checked',
2388
2389
  '[class.granite-radio-button-readonly]': 'readonly',
2389
2390
  }, changeDetection: ChangeDetectionStrategy.OnPush, template: "<label class=\"granite-radio-button-label\">\n <div class=\"granite-radio-button-outer-circle\">\n <input\n #input\n [id]=\"id\"\n class=\"granite-radio-button-input cdk-visually-hidden\"\n type=\"radio\"\n [attr.name]=\"name\"\n [disabled]=\"_radioDisabled\"\n [checked]=\"checked\"\n [readonly]=\"readonly\"\n [required]=\"required\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [attr.aria-checked]=\"checked.toString()\"\n [value]=\"value\"\n (change)=\"_radioChange($event.target)\"\n (blur)=\"_onBlur()\"\n />\n <div class=\"granite-radio-button-inner-circle\"></div>\n </div>\n <span class=\"granite-radio-button-text\">\n <ng-content></ng-content>\n </span>\n</label>\n", styles: [".cdk-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap;outline:0;-webkit-appearance:none;-moz-appearance:none;left:0}[dir=rtl] .cdk-visually-hidden{left:auto;right:0}:host(.granite-radio-button):not(.granite-radio-button-readonly):not(.granite-radio-button-disabled) .granite-radio-button-outer-circle:focus-within{border:.0625rem solid var(--granite-color-focus)}:host(.granite-radio-button):not(.granite-radio-button-readonly):not(.granite-radio-button-disabled) .granite-radio-button-outer-circle .granite-radio-button-label:hover{cursor:pointer}:host(.granite-radio-button):not(.granite-radio-button-readonly):not(.granite-radio-button-disabled) .granite-radio-button-outer-circle .granite-radio-button-label:hover .granite-radio-button-outer-circle{border-color:var(--granite-color-background-active-hover)}:host(.granite-radio-button):not(.granite-radio-button-readonly):not(.granite-radio-button-disabled) .granite-radio-button-outer-circle .granite-radio-button-label:hover .granite-radio-button-inner-circle{background-color:var(--granite-color-background-active-hover)}:host(.granite-radio-button-label-before) .granite-radio-button-label{flex-direction:row-reverse}:host(.granite-radio-button-label-before) .granite-radio-button-text{padding-inline-start:0;padding-inline-end:var(--granite-spacing-8)}:host(.granite-radio-button-checked) .granite-radio-button-inner-circle{visibility:visible;animation:grow-animation .1s}:host(.granite-radio-button-checked) .granite-radio-button-outer-circle{border-color:var(--granite-color-background-active)}:host(.granite-radio-button-checked).granite-radio-button-disabled .granite-radio-button-inner-circle{background-color:var(--granite-color-text)}:host(.granite-radio-button-checked).granite-radio-button-disabled .granite-radio-button-outer-circle{border:.0625rem solid var(--granite-color-text);background-color:transparent}:host(.granite-radio-button-checked).granite-radio-button-readonly .granite-radio-button-inner-circle{background-color:var(--granite-color-text)}:host(.granite-radio-button-checked).granite-radio-button-readonly .granite-radio-button-outer-circle{border:.0625rem solid var(--granite-color-text)}.granite-radio-button-text{padding-inline-start:var(--granite-spacing-8);color:var(--granite-color-text);font-size:var(--granite-font-size-body-small)}.granite-radio-button-text:empty{display:none}.granite-radio-button-label{display:flex;align-items:center;width:max-content;margin-inline-end:var(--granite-spacing-32);margin-block-end:var(--granite-spacing-4)}:host(.granite-radio-button-disabled) .granite-radio-button-text{opacity:.6}:host(.granite-radio-button-disabled) .granite-radio-button-outer-circle{opacity:.3;background-color:var(--granite-color-border-soft)}.granite-radio-button-outer-circle{height:1rem;width:1rem;border-radius:50%;box-sizing:border-box;border:.0625rem solid var(--granite-color-border-hard);display:flex;justify-content:center;position:relative;align-items:center}.granite-radio-button-inner-circle{width:.625rem;height:.625rem;visibility:hidden;position:absolute;border-radius:50%;background-color:var(--granite-color-background-active);margin:auto}@keyframes grow-animation{0%{transform:scale(0)}to{transform:scale(1)}}\n"] }]
2390
- }], ctorParameters: () => [{ type: i1.FocusMonitor }, { type: i2$1.UniqueSelectionDispatcher }], propDecorators: { value: [{
2391
+ }], ctorParameters: () => [{ type: i1.FocusMonitor }, { type: i2.UniqueSelectionDispatcher }], propDecorators: { value: [{
2391
2392
  type: Input
2392
2393
  }], id: [{
2393
2394
  type: Input
@@ -3645,7 +3646,7 @@ class GraniteChipListComponent extends GraniteChipListBase {
3645
3646
  });
3646
3647
  }
3647
3648
  }
3648
- 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: i2.Directionality, optional: true }, { token: i2$2.NgForm, optional: true }, { token: i2$2.FormGroupDirective, optional: true }, { token: i2$2.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component }); }
3649
+ 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 }); }
3649
3650
  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 }); }
3650
3651
  }
3651
3652
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteChipListComponent, decorators: [{
@@ -3665,13 +3666,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
3665
3666
  '(blur)': '_blur()',
3666
3667
  '(keydown)': '_keydown($event)',
3667
3668
  }, 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"] }]
3668
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i2.Directionality, decorators: [{
3669
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i3.Directionality, decorators: [{
3669
3670
  type: Optional
3670
- }] }, { type: i2$2.NgForm, decorators: [{
3671
+ }] }, { type: i2$1.NgForm, decorators: [{
3671
3672
  type: Optional
3672
- }] }, { type: i2$2.FormGroupDirective, decorators: [{
3673
+ }] }, { type: i2$1.FormGroupDirective, decorators: [{
3673
3674
  type: Optional
3674
- }] }, { type: i2$2.NgControl, decorators: [{
3675
+ }] }, { type: i2$1.NgControl, decorators: [{
3675
3676
  type: Optional
3676
3677
  }, {
3677
3678
  type: Self
@@ -4474,7 +4475,7 @@ class GraniteContactsTriggerForDirective {
4474
4475
  _touchPositionStrategy() {
4475
4476
  return this._overlay.position().global();
4476
4477
  }
4477
- 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: i2.Directionality, optional: true }, { token: i1.FocusMonitor }], target: i0.ɵɵFactoryTarget.Directive }); }
4478
+ 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 }); }
4478
4479
  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 }); }
4479
4480
  }
4480
4481
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteContactsTriggerForDirective, decorators: [{
@@ -4500,7 +4501,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
4500
4501
  args: [GRANITE_CLIENT_OUTPUT]
4501
4502
  }, {
4502
4503
  type: Optional
4503
- }] }, { type: i2.Directionality, decorators: [{
4504
+ }] }, { type: i3.Directionality, decorators: [{
4504
4505
  type: Optional
4505
4506
  }] }, { type: i1.FocusMonitor }], propDecorators: { contacts: [{
4506
4507
  type: Input,
@@ -4656,17 +4657,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
4656
4657
  }]
4657
4658
  }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }] });
4658
4659
 
4659
- let legendPanelUid = 0;
4660
- class LegendBaseComponent {
4660
+ class OverlayBaseComponent {
4661
4661
  constructor() {
4662
- this.xPosition = 'before';
4662
+ this.xPosition = 'after';
4663
4663
  this.yPosition = 'below';
4664
- this.panelId = `granite-progress-bar-legend-panel-${legendPanelUid++}`;
4665
4664
  }
4666
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: LegendBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
4667
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.4", type: LegendBaseComponent, viewQueries: [{ propertyName: "templateRef", first: true, predicate: TemplateRef, descendants: true }], ngImport: i0 }); }
4665
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: OverlayBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
4666
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.4", type: OverlayBaseComponent, viewQueries: [{ propertyName: "templateRef", first: true, predicate: TemplateRef, descendants: true }], ngImport: i0 }); }
4668
4667
  }
4669
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: LegendBaseComponent, decorators: [{
4668
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: OverlayBaseComponent, decorators: [{
4670
4669
  type: Directive,
4671
4670
  args: [{}]
4672
4671
  }], propDecorators: { templateRef: [{
@@ -4674,134 +4673,73 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
4674
4673
  args: [TemplateRef]
4675
4674
  }] } });
4676
4675
 
4676
+ let legendPanelUid = 0;
4677
+ class LegendBaseComponent extends OverlayBaseComponent {
4678
+ constructor() {
4679
+ super(...arguments);
4680
+ this.panelId = `granite-progress-bar-legend-panel-${legendPanelUid++}`;
4681
+ this.xPosition = 'before';
4682
+ }
4683
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: LegendBaseComponent, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
4684
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.4", type: LegendBaseComponent, usesInheritance: true, ngImport: i0 }); }
4685
+ }
4686
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: LegendBaseComponent, decorators: [{
4687
+ type: Directive
4688
+ }] });
4689
+
4677
4690
  class GraniteProgressBarLegendComponent extends LegendBaseComponent {
4678
4691
  constructor() {
4679
4692
  super(...arguments);
4680
4693
  this.legendItems = [];
4681
4694
  }
4682
4695
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteProgressBarLegendComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
4683
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: GraniteProgressBarLegendComponent, selector: "granite-progress-bar-legend", inputs: { legendItems: "legendItems" }, usesInheritance: true, ngImport: i0, template: "<ng-template>\n <div class=\"legend\" data-fnd=\"legend\">\n <div\n *ngFor=\"let item of legendItems\"\n class=\"legend-item\"\n data-fnd=\"legend-item\"\n >\n <div class=\"legend-label-text\">{{ item.label }}</div>\n <div\n [style.background-color]=\"item.backgroundColor\"\n class=\"color-box\"\n ></div>\n </div>\n </div>\n</ng-template>\n", styles: [".legend{display:flex;flex-direction:column;align-items:flex-start;padding:var(--granite-spacing-8);gap:var(--granite-spacing-8);background-color:var(--granite-color-background-page);border:solid var(--granite-border-width-regular) var(--granite-color-border-contrast);border-radius:var(--granite-radius-s)}.legend-item{display:flex;align-items:center;justify-content:space-between;align-self:stretch;flex-wrap:wrap;padding:0 var(--granite-spacing-4);gap:var(--granite-spacing-8)}.legend-label-text{font-size:var(--granite-font-size-body-small);line-height:var(--granite-font-size-body-small);font-weight:var(--granite-font-weight-regular);color:var(--granite-color-text);width:max-content}.color-box{width:8px;height:8px}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4696
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: GraniteProgressBarLegendComponent, selector: "granite-progress-bar-legend", inputs: { legendItems: "legendItems" }, usesInheritance: true, ngImport: i0, template: "<ng-template>\n <div class=\"legend\" data-fnd=\"legend\">\n <div\n *ngFor=\"let item of legendItems\"\n class=\"legend-item\"\n data-fnd=\"legend-item\"\n >\n <div class=\"legend-label-text\">{{ item.label }}</div>\n <div\n [style.background-color]=\"item.backgroundColor\"\n class=\"color-box\"\n ></div>\n </div>\n </div>\n</ng-template>\n", styles: [".legend{display:flex;flex-direction:column;align-items:flex-start;padding:var(--granite-spacing-8);gap:var(--granite-spacing-8);background-color:var(--granite-color-background-page);border:solid var(--granite-border-width-regular) var(--granite-color-border-contrast);border-radius:var(--granite-radius-s);height:-moz-fit-content;height:fit-content}.legend-item{display:flex;align-items:center;justify-content:space-between;align-self:stretch;flex-wrap:wrap;padding:0 var(--granite-spacing-4);gap:var(--granite-spacing-8)}.legend-label-text{font-size:var(--granite-font-size-body-small);line-height:var(--granite-font-size-body-small);font-weight:var(--granite-font-weight-regular);color:var(--granite-color-text);width:max-content}.color-box{width:8px;height:8px}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4684
4697
  }
4685
4698
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteProgressBarLegendComponent, decorators: [{
4686
4699
  type: Component,
4687
- args: [{ selector: 'granite-progress-bar-legend', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template>\n <div class=\"legend\" data-fnd=\"legend\">\n <div\n *ngFor=\"let item of legendItems\"\n class=\"legend-item\"\n data-fnd=\"legend-item\"\n >\n <div class=\"legend-label-text\">{{ item.label }}</div>\n <div\n [style.background-color]=\"item.backgroundColor\"\n class=\"color-box\"\n ></div>\n </div>\n </div>\n</ng-template>\n", styles: [".legend{display:flex;flex-direction:column;align-items:flex-start;padding:var(--granite-spacing-8);gap:var(--granite-spacing-8);background-color:var(--granite-color-background-page);border:solid var(--granite-border-width-regular) var(--granite-color-border-contrast);border-radius:var(--granite-radius-s)}.legend-item{display:flex;align-items:center;justify-content:space-between;align-self:stretch;flex-wrap:wrap;padding:0 var(--granite-spacing-4);gap:var(--granite-spacing-8)}.legend-label-text{font-size:var(--granite-font-size-body-small);line-height:var(--granite-font-size-body-small);font-weight:var(--granite-font-weight-regular);color:var(--granite-color-text);width:max-content}.color-box{width:8px;height:8px}\n"] }]
4700
+ args: [{ selector: 'granite-progress-bar-legend', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template>\n <div class=\"legend\" data-fnd=\"legend\">\n <div\n *ngFor=\"let item of legendItems\"\n class=\"legend-item\"\n data-fnd=\"legend-item\"\n >\n <div class=\"legend-label-text\">{{ item.label }}</div>\n <div\n [style.background-color]=\"item.backgroundColor\"\n class=\"color-box\"\n ></div>\n </div>\n </div>\n</ng-template>\n", styles: [".legend{display:flex;flex-direction:column;align-items:flex-start;padding:var(--granite-spacing-8);gap:var(--granite-spacing-8);background-color:var(--granite-color-background-page);border:solid var(--granite-border-width-regular) var(--granite-color-border-contrast);border-radius:var(--granite-radius-s);height:-moz-fit-content;height:fit-content}.legend-item{display:flex;align-items:center;justify-content:space-between;align-self:stretch;flex-wrap:wrap;padding:0 var(--granite-spacing-4);gap:var(--granite-spacing-8)}.legend-label-text{font-size:var(--granite-font-size-body-small);line-height:var(--granite-font-size-body-small);font-weight:var(--granite-font-weight-regular);color:var(--granite-color-text);width:max-content}.color-box{width:8px;height:8px}\n"] }]
4688
4701
  }], propDecorators: { legendItems: [{
4689
4702
  type: Input
4690
4703
  }] } });
4691
4704
 
4692
- class GraniteProgressBarLegendTriggerForDirective {
4693
- constructor(_overlay, _element, _viewContainerRef, _outsideClickDispatcher,
4694
- /** Client input device information */
4695
- _clientInput,
4696
- /** Client output device information */
4697
- _clientOutput, _dir, _focusMonitor) {
4705
+ class OverlayService {
4706
+ constructor(_overlay, _focusMonitor, _outsideClickDispatcher) {
4698
4707
  this._overlay = _overlay;
4699
- this._element = _element;
4700
- this._viewContainerRef = _viewContainerRef;
4701
- this._outsideClickDispatcher = _outsideClickDispatcher;
4702
- this._clientInput = _clientInput;
4703
- this._clientOutput = _clientOutput;
4704
- this._dir = _dir;
4705
4708
  this._focusMonitor = _focusMonitor;
4706
- this._isLegendOpen = false;
4707
- this._portal = null;
4708
- this._overlayRef = null;
4709
- }
4710
- ngOnDestroy() {
4711
- if (this._overlayRef) {
4712
- this._overlayRef.dispose();
4713
- this._overlayRef = null;
4714
- }
4715
- }
4716
- openLegend() {
4717
- if (this._isLegendOpen) {
4718
- return;
4719
- }
4720
- this.legend.direction = this._dir.value === 'rtl' ? 'rtl' : 'ltr';
4721
- this.legend.clientInput = this._clientInput;
4722
- this.legend.clientOutput = this._clientOutput;
4723
- const panelClass = [];
4724
- if (this._clientOutput?.device === 'touch') {
4725
- panelClass.push('granite-overlay-pane-center');
4726
- }
4727
- const scrollStrategy = this._clientOutput?.device !== 'touch'
4728
- ? this._overlay.scrollStrategies.reposition()
4729
- : this._overlay.scrollStrategies.block();
4730
- const hasBackdrop = this._clientOutput?.device === 'touch';
4731
- if (!this._overlayRef) {
4732
- const config = new OverlayConfig({
4733
- positionStrategy: this._positionStrategy(),
4734
- backdropClass: 'granite-overlay-dark-glass-backdrop',
4735
- scrollStrategy,
4736
- direction: this._dir,
4737
- panelClass,
4738
- hasBackdrop,
4739
- });
4740
- this._overlayRef = this._overlay.create(config);
4741
- }
4742
- if (!this._portal || this._portal.templateRef !== this.legend.templateRef) {
4743
- this._portal = new TemplatePortal(this.legend.templateRef, this._viewContainerRef);
4744
- }
4745
- this._overlayRef.attach(this._portal);
4746
- this._outsideClickDispatcher.add(this._overlayRef);
4747
- this._overlayRef.outsidePointerEvents().subscribe((event) => {
4748
- event.stopPropagation();
4749
- this.closeLegend();
4750
- });
4751
- this._isLegendOpen = true;
4752
- }
4753
- toggleLegend() {
4754
- if (this._isLegendOpen) {
4755
- this.closeLegend();
4756
- }
4757
- else {
4758
- this.openLegend();
4759
- }
4760
- }
4761
- closeLegend() {
4762
- if (!this._overlayRef || !this._isLegendOpen) {
4763
- return;
4764
- }
4765
- this._outsideClickDispatcher.remove(this._overlayRef);
4766
- this._overlayRef.detach();
4767
- this._restoreFocus();
4768
- this._isLegendOpen = false;
4709
+ this._outsideClickDispatcher = _outsideClickDispatcher;
4769
4710
  }
4770
- _handleKeydown(event) {
4771
- if (event.key === 'Enter') {
4772
- event.preventDefault();
4773
- this.toggleLegend();
4774
- }
4711
+ createOverlay(config, component, viewContainerRef) {
4712
+ const overlayRef = this._overlay.create(config);
4713
+ const portal = new TemplatePortal(component.templateRef, viewContainerRef);
4714
+ overlayRef.attach(portal);
4715
+ return overlayRef;
4775
4716
  }
4776
- _handleClick() {
4777
- this.toggleLegend();
4717
+ closeOverlay(overlayRef, element) {
4718
+ this._outsideClickDispatcher.remove(overlayRef);
4719
+ overlayRef.detach();
4720
+ this.restoreFocus(element);
4778
4721
  }
4779
- _restoreFocus(origin = 'program', options) {
4722
+ restoreFocus(element, origin = 'program', options) {
4780
4723
  if (this._focusMonitor) {
4781
- this._focusMonitor.focusVia(this._element, origin, options);
4724
+ this._focusMonitor.focusVia(element, origin, options);
4782
4725
  }
4783
4726
  else {
4784
- this._element.nativeElement.focus(options);
4727
+ element.nativeElement.focus(options);
4785
4728
  }
4786
4729
  }
4787
- _desktopPositionStrategy() {
4788
- const positionStrategy = this._overlay
4730
+ desktopPositionStrategy(element, selector) {
4731
+ return this._overlay
4789
4732
  .position()
4790
- .flexibleConnectedTo(this._element)
4733
+ .flexibleConnectedTo(element)
4791
4734
  .withLockedPosition()
4792
- .withTransformOriginOn('.granite-progress-bar-legend')
4735
+ .withTransformOriginOn(selector)
4793
4736
  .withPush(false);
4794
- this._setPosition(positionStrategy);
4795
- return positionStrategy;
4796
4737
  }
4797
- _setPosition(positionStrategy) {
4798
- const [originX, originFallbackX] = this.legend.xPosition === 'before' ? ['end', 'start'] : ['start', 'end'];
4799
- const [overlayY, overlayFallbackY] = this.legend.yPosition === 'above' ? ['bottom', 'top'] : ['top', 'bottom'];
4800
- let [originY, originFallbackY] = [overlayY, overlayFallbackY];
4801
- const [overlayX, overlayFallbackX] = [originX, originFallbackX];
4802
- const offsetY = 4;
4803
- originY = overlayY === 'top' ? 'bottom' : 'top';
4804
- originFallbackY = overlayFallbackY === 'top' ? 'bottom' : 'top';
4738
+ touchPositionStrategy() {
4739
+ return this._overlay.position().global();
4740
+ }
4741
+ setPosition(positionStrategy, positionConfig) {
4742
+ const { originX, originFallbackX, originY, originFallbackY, overlayX, overlayFallbackX, overlayY, overlayFallbackY, offsetX, offsetY, } = positionConfig;
4805
4743
  positionStrategy.withPositions([
4806
4744
  { originX, originY, overlayX, overlayY, offsetY },
4807
4745
  {
@@ -4826,18 +4764,173 @@ class GraniteProgressBarLegendTriggerForDirective {
4826
4764
  offsetY: -offsetY,
4827
4765
  },
4828
4766
  ]);
4767
+ return positionStrategy;
4829
4768
  }
4830
- _positionStrategy() {
4831
- if (this._clientOutput?.device !== 'touch') {
4832
- return this._desktopPositionStrategy();
4769
+ subscribeOutsideClick(overlayRef, callback) {
4770
+ this._outsideClickDispatcher.add(overlayRef);
4771
+ overlayRef.outsidePointerEvents().subscribe((event) => {
4772
+ event.stopPropagation();
4773
+ if (callback) {
4774
+ callback();
4775
+ }
4776
+ });
4777
+ }
4778
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: OverlayService, deps: [{ token: i1$2.Overlay }, { token: i1.FocusMonitor }, { token: i1$2.OverlayOutsideClickDispatcher }], target: i0.ɵɵFactoryTarget.Injectable }); }
4779
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: OverlayService, providedIn: 'root' }); }
4780
+ }
4781
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: OverlayService, decorators: [{
4782
+ type: Injectable,
4783
+ args: [{
4784
+ providedIn: 'root',
4785
+ }]
4786
+ }], ctorParameters: () => [{ type: i1$2.Overlay }, { type: i1.FocusMonitor }, { type: i1$2.OverlayOutsideClickDispatcher }] });
4787
+
4788
+ class GraniteOverlayTriggerForBaseDirective {
4789
+ constructor() {
4790
+ /** Client output device information */
4791
+ this._clientOutput = inject(GRANITE_CLIENT_OUTPUT);
4792
+ /** Client input device information */
4793
+ this._clientInput = inject(GRANITE_CLIENT_INPUT);
4794
+ this._dir = inject(Directionality);
4795
+ this.offsetX = 0;
4796
+ this.offsetY = 0;
4797
+ this._overlayRef = null;
4798
+ this._overlay = inject(Overlay);
4799
+ this._element = inject((ElementRef));
4800
+ this._viewContainerRef = inject(ViewContainerRef);
4801
+ this._overlayService = inject(OverlayService);
4802
+ }
4803
+ ngOnDestroy() {
4804
+ if (this._overlayRef) {
4805
+ this._overlayRef.dispose();
4806
+ this._overlayRef = null;
4833
4807
  }
4834
- return this._touchPositionStrategy();
4835
4808
  }
4836
- _touchPositionStrategy() {
4837
- return this._overlay.position().global();
4809
+ getPositionConfig() {
4810
+ const [originX, originFallbackX] = this.componentRef.xPosition === 'before'
4811
+ ? ['end', 'start']
4812
+ : ['start', 'end'];
4813
+ const [overlayY, overlayFallbackY] = this.componentRef.yPosition === 'above'
4814
+ ? ['bottom', 'top']
4815
+ : ['top', 'bottom'];
4816
+ let [originY, originFallbackY] = [overlayY, overlayFallbackY];
4817
+ const [overlayX, overlayFallbackX] = [originX, originFallbackX];
4818
+ originY = overlayY === 'top' ? 'bottom' : 'top';
4819
+ originFallbackY = overlayFallbackY === 'top' ? 'bottom' : 'top';
4820
+ return {
4821
+ originX,
4822
+ originFallbackX,
4823
+ originY,
4824
+ originFallbackY,
4825
+ overlayX,
4826
+ overlayFallbackX,
4827
+ overlayY,
4828
+ overlayFallbackY,
4829
+ offsetX: this.offsetX,
4830
+ offsetY: this.offsetY,
4831
+ };
4832
+ }
4833
+ getPositionStrategy() {
4834
+ let positionStrategy = this._overlayService.desktopPositionStrategy(this._element, this.selector);
4835
+ const positionConfig = this.getPositionConfig();
4836
+ positionStrategy = this._overlayService.setPosition(positionStrategy, positionConfig);
4837
+ return positionStrategy;
4838
+ }
4839
+ getScrollStrategy() {
4840
+ return this.setScrollStrategy('close');
4841
+ }
4842
+ setScrollStrategy(scrollStrategy) {
4843
+ switch (scrollStrategy) {
4844
+ case 'reposition':
4845
+ return this._overlay.scrollStrategies.reposition();
4846
+ case 'block':
4847
+ return this._overlay.scrollStrategies.block();
4848
+ case 'close':
4849
+ return this._overlay.scrollStrategies.close();
4850
+ default:
4851
+ return this._overlay.scrollStrategies.close();
4852
+ }
4838
4853
  }
4839
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteProgressBarLegendTriggerForDirective, 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: i2.Directionality, optional: true }, { token: i1.FocusMonitor }], target: i0.ɵɵFactoryTarget.Directive }); }
4840
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.4", type: GraniteProgressBarLegendTriggerForDirective, selector: "[graniteProgressBarLegendTriggerFor]", inputs: { legend: ["graniteProgressBarLegendTriggerFor", "legend"] }, host: { attributes: { "aria-haspopup": "true" }, listeners: { "keydown": "_handleKeydown($event)", "click": "_handleClick($event)" }, properties: { "attr.aria-expanded": "_isLegendOpen || null", "attr.aria-controls": "_isLegendOpen ? legend.panelId : null" }, classAttribute: "granite-progress-bar-legend-trigger" }, ngImport: i0 }); }
4854
+ toggleOverlay(isOpen) {
4855
+ isOpen ? this._closeOverlay() : this._openOverlay();
4856
+ return !isOpen;
4857
+ }
4858
+ onOutsideClick() {
4859
+ this._closeOverlay();
4860
+ }
4861
+ _openOverlay() {
4862
+ this.componentRef.direction = this._dir.value === 'rtl' ? 'rtl' : 'ltr';
4863
+ this.componentRef.clientInput = this._clientInput;
4864
+ this.componentRef.clientOutput = this._clientOutput;
4865
+ const panelClass = [];
4866
+ if (this._clientOutput?.device === 'touch') {
4867
+ panelClass.push('granite-overlay-pane-center');
4868
+ }
4869
+ const hasBackdrop = this._clientOutput?.device === 'touch';
4870
+ const config = new OverlayConfig({
4871
+ positionStrategy: this.getPositionStrategy(),
4872
+ backdropClass: 'granite-overlay-dark-glass-backdrop',
4873
+ scrollStrategy: this.getScrollStrategy(),
4874
+ direction: this._dir,
4875
+ panelClass,
4876
+ hasBackdrop,
4877
+ });
4878
+ this._overlayRef = this._overlayService.createOverlay(config, this.componentRef, this._viewContainerRef);
4879
+ this._overlayService.subscribeOutsideClick(this._overlayRef, () => this.onOutsideClick());
4880
+ }
4881
+ _closeOverlay() {
4882
+ if (!this._overlayRef) {
4883
+ return;
4884
+ }
4885
+ this._overlayService.closeOverlay(this._overlayRef, this._element);
4886
+ }
4887
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteOverlayTriggerForBaseDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
4888
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.4", type: GraniteOverlayTriggerForBaseDirective, selector: "[graniteOverlayTriggerForBase]", ngImport: i0 }); }
4889
+ }
4890
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteOverlayTriggerForBaseDirective, decorators: [{
4891
+ type: Directive,
4892
+ args: [{
4893
+ selector: '[graniteOverlayTriggerForBase]',
4894
+ }]
4895
+ }], propDecorators: { _clientOutput: [{
4896
+ type: Optional
4897
+ }], _clientInput: [{
4898
+ type: Optional
4899
+ }], _dir: [{
4900
+ type: Optional
4901
+ }] } });
4902
+
4903
+ class GraniteProgressBarLegendTriggerForDirective extends GraniteOverlayTriggerForBaseDirective {
4904
+ constructor() {
4905
+ super(...arguments);
4906
+ this.isLegendOpen = false;
4907
+ this.selector = '.granite-progress-bar-legend';
4908
+ this.offsetY = 4;
4909
+ }
4910
+ get legend() {
4911
+ return this.componentRef;
4912
+ }
4913
+ set legend(value) {
4914
+ this.componentRef = value;
4915
+ }
4916
+ handleKeydown(event) {
4917
+ if (event.key === 'Enter') {
4918
+ event.preventDefault();
4919
+ this.isLegendOpen = this.toggleOverlay(this.isLegendOpen);
4920
+ }
4921
+ }
4922
+ handleClick() {
4923
+ this.isLegendOpen = this.toggleOverlay(this.isLegendOpen);
4924
+ }
4925
+ onOutsideClick() {
4926
+ super.onOutsideClick();
4927
+ this.isLegendOpen = false;
4928
+ }
4929
+ getScrollStrategy() {
4930
+ return this.setScrollStrategy('reposition');
4931
+ }
4932
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteProgressBarLegendTriggerForDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
4933
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.4", type: GraniteProgressBarLegendTriggerForDirective, selector: "[graniteProgressBarLegendTriggerFor]", inputs: { legend: ["graniteProgressBarLegendTriggerFor", "legend"] }, host: { attributes: { "aria-haspopup": "true" }, listeners: { "keydown": "handleKeydown($event)", "click": "handleClick($event)" }, properties: { "attr.aria-expanded": "isLegendOpen || null", "attr.aria-controls": "isLegendOpen ? legend.panelId : null" }, classAttribute: "granite-progress-bar-legend-trigger" }, usesInheritance: true, ngImport: i0 }); }
4841
4934
  }
4842
4935
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteProgressBarLegendTriggerForDirective, decorators: [{
4843
4936
  type: Directive,
@@ -4846,25 +4939,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
4846
4939
  host: {
4847
4940
  class: 'granite-progress-bar-legend-trigger',
4848
4941
  'aria-haspopup': 'true',
4849
- '[attr.aria-expanded]': '_isLegendOpen || null',
4850
- '[attr.aria-controls]': '_isLegendOpen ? legend.panelId : null',
4851
- '(keydown)': '_handleKeydown($event)',
4852
- '(click)': '_handleClick($event)',
4942
+ '[attr.aria-expanded]': 'isLegendOpen || null',
4943
+ '[attr.aria-controls]': 'isLegendOpen ? legend.panelId : null',
4944
+ '(keydown)': 'handleKeydown($event)',
4945
+ '(click)': 'handleClick($event)',
4853
4946
  },
4854
4947
  }]
4855
- }], ctorParameters: () => [{ type: i1$2.Overlay }, { type: i0.ElementRef }, { type: i0.ViewContainerRef }, { type: i1$2.OverlayOutsideClickDispatcher }, { type: undefined, decorators: [{
4856
- type: Inject,
4857
- args: [GRANITE_CLIENT_INPUT]
4858
- }, {
4859
- type: Optional
4860
- }] }, { type: undefined, decorators: [{
4861
- type: Inject,
4862
- args: [GRANITE_CLIENT_OUTPUT]
4863
- }, {
4864
- type: Optional
4865
- }] }, { type: i2.Directionality, decorators: [{
4866
- type: Optional
4867
- }] }, { type: i1.FocusMonitor }], propDecorators: { legend: [{
4948
+ }], propDecorators: { legend: [{
4868
4949
  type: Input,
4869
4950
  args: ['graniteProgressBarLegendTriggerFor']
4870
4951
  }] } });
@@ -4935,7 +5016,7 @@ class GraniteProgressBarComponent {
4935
5016
  }
4936
5017
  }
4937
5018
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteProgressBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4938
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: GraniteProgressBarComponent, selector: "granite-progress-bar", inputs: { progressBarData: "progressBarData", legendData: "legendData", showLabel: "showLabel", showLegend: "showLegend" }, host: { properties: { "class.label-present": "showLabel" } }, exportAs: ["graniteProgressBar"], usesOnChanges: true, ngImport: i0, template: "<div\n role=\"progressbar\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n class=\"progress\"\n [style.background-color]=\"getBackgroundColor()\"\n>\n <div\n *ngFor=\"let bar of progressBarData; let i = index\"\n [style.background-color]=\"getStackColor(bar.backgroundColor)\"\n [style.width]=\"getStringOfWidth(getWidth(bar.value))\"\n [style.color]=\"getFontColor(bar.foregroundColor)\"\n [graniteTooltipTriggerFor]=\"tooltip\"\n class=\"progress-bar\"\n >\n <label *ngIf=\"showLabel\" graniteHideOnOverflow>{{ bar.valueLabel }}</label>\n <granite-tooltip #tooltip> {{ bar.valueLabel }} </granite-tooltip>\n </div>\n</div>\n\n<ng-container *ngIf=\"showLegend\">\n <button\n graniteFlatButton\n [graniteProgressBarLegendTriggerFor]=\"legend\"\n class=\"legend-btn\"\n >\n <granite-icon fontIcon=\"icon-caret-down\"></granite-icon>\n </button>\n</ng-container>\n\n<granite-progress-bar-legend\n #legend\n [legendItems]=\"legendItems\"\n></granite-progress-bar-legend>\n", styles: [":host{width:100%;display:flex;align-items:center;box-sizing:border-box;height:.5rem;border-radius:var(--granite-radius-m);font-size:var(--granite-font-size-body-small);line-height:var(--granite-font-size-body-small)}:host(.label-present){height:auto!important}.progress{display:flex;width:inherit;height:inherit;overflow:hidden;border-radius:inherit;background-color:var(--granite-color-background-selected)}.progress-bar{display:flex;align-items:center;box-sizing:border-box;width:inherit;height:inherit;line-height:inherit;font-size:inherit;vertical-align:middle;text-overflow:ellipsis;white-space:nowrap;color:var(--granite-color-text);overflow:hidden;text-align:center;justify-content:center}.progress-bar label{width:100%;padding:var(--granite-spacing-4) 0}.legend-btn{width:16px;height:16px;margin-inline-start:var(--granite-spacing-16)}\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: GraniteHideOnOverflowDirective, selector: "[graniteHideOnOverflow]", exportAs: ["graniteHideOnOverflow"] }, { kind: "component", type: i3.GraniteTooltipComponent, selector: "granite-tooltip" }, { kind: "directive", type: i3.GraniteTooltipTriggerForDirective, selector: "[graniteTooltipTriggerFor]", inputs: ["graniteTooltipTriggerFor", "hideDelay", "showDelay", "showOnKeyboardFocus", "showOnClick"] }, { kind: "component", type: GraniteIconComponent, selector: "granite-icon", inputs: ["fontIcon"] }, { kind: "component", type: GraniteButtonComponent, selector: "button[graniteButton],\n button[granitePrimaryButton],\n button[graniteFlatButton],\n button[graniteToolbarButton]\n ", inputs: ["disabled", "toggled"], exportAs: ["graniteButton"] }, { kind: "component", type: GraniteProgressBarLegendComponent, selector: "granite-progress-bar-legend", inputs: ["legendItems"] }, { kind: "directive", type: GraniteProgressBarLegendTriggerForDirective, selector: "[graniteProgressBarLegendTriggerFor]", inputs: ["graniteProgressBarLegendTriggerFor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
5019
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: GraniteProgressBarComponent, selector: "granite-progress-bar", inputs: { progressBarData: "progressBarData", legendData: "legendData", showLabel: "showLabel", showLegend: "showLegend" }, host: { properties: { "class.label-present": "showLabel" } }, exportAs: ["graniteProgressBar"], usesOnChanges: true, ngImport: i0, template: "<div\n role=\"progressbar\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n class=\"progress\"\n [style.background-color]=\"getBackgroundColor()\"\n>\n <div\n *ngFor=\"let bar of progressBarData; let i = index\"\n [style.background-color]=\"getStackColor(bar.backgroundColor)\"\n [style.width]=\"getStringOfWidth(getWidth(bar.value))\"\n [style.color]=\"getFontColor(bar.foregroundColor)\"\n [graniteTooltipTriggerFor]=\"tooltip\"\n class=\"progress-bar\"\n >\n <label *ngIf=\"showLabel\" graniteHideOnOverflow>{{ bar.valueLabel }}</label>\n <granite-tooltip #tooltip> {{ bar.valueLabel }} </granite-tooltip>\n </div>\n</div>\n\n<ng-container *ngIf=\"showLegend\">\n <button\n graniteFlatButton\n [graniteProgressBarLegendTriggerFor]=\"legend\"\n class=\"legend-btn\"\n >\n <granite-icon fontIcon=\"icon-caret-down\"></granite-icon>\n </button>\n</ng-container>\n\n<granite-progress-bar-legend\n #legend\n [legendItems]=\"legendItems\"\n></granite-progress-bar-legend>\n", styles: [":host{width:100%;display:flex;align-items:center;box-sizing:border-box;height:.5rem;border-radius:var(--granite-radius-m);font-size:var(--granite-font-size-body-small);line-height:var(--granite-font-size-body-small)}:host(.label-present){height:auto!important}.progress{display:flex;width:inherit;height:inherit;overflow:hidden;border-radius:inherit;background-color:var(--granite-color-background-selected)}.progress-bar{display:flex;align-items:center;box-sizing:border-box;width:inherit;height:inherit;line-height:inherit;font-size:inherit;vertical-align:middle;text-overflow:ellipsis;white-space:nowrap;color:var(--granite-color-text);overflow:hidden;text-align:center;justify-content:center}.progress-bar label{width:100%;padding:var(--granite-spacing-4) 0}.legend-btn{width:16px;height:16px;margin-inline-start:var(--granite-spacing-16)}\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: GraniteHideOnOverflowDirective, selector: "[graniteHideOnOverflow]", exportAs: ["graniteHideOnOverflow"] }, { kind: "component", type: i3$1.GraniteTooltipComponent, selector: "granite-tooltip" }, { kind: "directive", type: i3$1.GraniteTooltipTriggerForDirective, selector: "[graniteTooltipTriggerFor]", inputs: ["graniteTooltipTriggerFor", "hideDelay", "showDelay", "showOnKeyboardFocus", "showOnClick"] }, { kind: "component", type: GraniteIconComponent, selector: "granite-icon", inputs: ["fontIcon"] }, { kind: "component", type: GraniteButtonComponent, selector: "button[graniteButton],\n button[granitePrimaryButton],\n button[graniteFlatButton],\n button[graniteToolbarButton]\n ", inputs: ["disabled", "toggled"], exportAs: ["graniteButton"] }, { kind: "component", type: GraniteProgressBarLegendComponent, selector: "granite-progress-bar-legend", inputs: ["legendItems"] }, { kind: "directive", type: GraniteProgressBarLegendTriggerForDirective, selector: "[graniteProgressBarLegendTriggerFor]", inputs: ["graniteProgressBarLegendTriggerFor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4939
5020
  }
4940
5021
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteProgressBarComponent, decorators: [{
4941
5022
  type: Component,
@@ -5063,7 +5144,8 @@ class GraniteCoreModule {
5063
5144
  ClientOutputTouchDirective,
5064
5145
  ClientInputDesktopDirective,
5065
5146
  ClientInputTouchDirective,
5066
- GraniteHideOnOverflowDirective], exports: [ClientOutputDesktopDirective,
5147
+ GraniteHideOnOverflowDirective,
5148
+ GraniteOverlayTriggerForBaseDirective], exports: [ClientOutputDesktopDirective,
5067
5149
  ClientOutputTouchDirective,
5068
5150
  ClientInputDesktopDirective,
5069
5151
  ClientInputTouchDirective,
@@ -5079,6 +5161,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
5079
5161
  ClientInputDesktopDirective,
5080
5162
  ClientInputTouchDirective,
5081
5163
  GraniteHideOnOverflowDirective,
5164
+ GraniteOverlayTriggerForBaseDirective,
5082
5165
  ],
5083
5166
  exports: [
5084
5167
  ClientOutputDesktopDirective,