@ifsworld/granite-components 16.1.0-beta.1 → 17.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/index.d.ts +1 -0
- package/core/lib/client-environment.d.ts +18 -0
- package/fesm2022/ifsworld-granite-components-core.mjs +19 -0
- package/fesm2022/ifsworld-granite-components-core.mjs.map +1 -0
- package/fesm2022/ifsworld-granite-components-tooltip.mjs +14 -5
- package/fesm2022/ifsworld-granite-components-tooltip.mjs.map +1 -1
- package/fesm2022/ifsworld-granite-components.mjs +51 -34
- package/fesm2022/ifsworld-granite-components.mjs.map +1 -1
- package/index.d.ts +1 -1
- package/lib/core/client-environment.d.ts +1 -26
- package/lib/menu/menu-base.d.ts +9 -1
- package/lib/menu/menu-errors.d.ts +2 -2
- package/lib/menu/menu-positions.d.ts +2 -2
- package/package.json +5 -1
- package/tooltip/lib/tooltip-trigger-for.directive.d.ts +4 -2
package/core/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './lib/client-environment';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
export declare const GRANITE_CLIENT_INPUT: InjectionToken<ClientInputInterface>;
|
|
3
|
+
export declare const GRANITE_CLIENT_OUTPUT: InjectionToken<ClientOutputInterface>;
|
|
4
|
+
export type InputDeviceTypes = void | 'touch' | 'mouse' | 'keyboard' | 'onscreen-keyboard';
|
|
5
|
+
export type OutputDeviceTypes = void | 'touch' | 'desktop';
|
|
6
|
+
export interface ClientInputInterface {
|
|
7
|
+
devices: InputDeviceTypes[];
|
|
8
|
+
}
|
|
9
|
+
export interface ClientOutputInterface {
|
|
10
|
+
device: OutputDeviceTypes;
|
|
11
|
+
}
|
|
12
|
+
interface DevicePrefabInterface {
|
|
13
|
+
input: ClientInputInterface;
|
|
14
|
+
output: ClientOutputInterface;
|
|
15
|
+
}
|
|
16
|
+
export declare const deviceDesktop: DevicePrefabInterface;
|
|
17
|
+
export declare const deviceTouch: DevicePrefabInterface;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
const GRANITE_CLIENT_INPUT = new InjectionToken('GRANITE_CLIENT_INPUT');
|
|
4
|
+
const GRANITE_CLIENT_OUTPUT = new InjectionToken('GRANITE_CLIENT_OUTPUT');
|
|
5
|
+
const deviceDesktop = {
|
|
6
|
+
input: { devices: ['mouse', 'keyboard'] },
|
|
7
|
+
output: { device: 'desktop' },
|
|
8
|
+
};
|
|
9
|
+
const deviceTouch = {
|
|
10
|
+
input: { devices: ['touch', 'onscreen-keyboard'] },
|
|
11
|
+
output: { device: 'touch' },
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Generated bundle index. Do not edit.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
export { GRANITE_CLIENT_INPUT, GRANITE_CLIENT_OUTPUT, deviceDesktop, deviceTouch };
|
|
19
|
+
//# sourceMappingURL=ifsworld-granite-components-core.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ifsworld-granite-components-core.mjs","sources":["../../../../libs/granite-components/core/src/lib/client-environment.ts","../../../../libs/granite-components/core/src/ifsworld-granite-components-core.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport const GRANITE_CLIENT_INPUT = new InjectionToken<ClientInputInterface>(\n 'GRANITE_CLIENT_INPUT'\n);\n\nexport const GRANITE_CLIENT_OUTPUT = new InjectionToken<ClientOutputInterface>(\n 'GRANITE_CLIENT_OUTPUT'\n);\n\nexport type InputDeviceTypes =\n | void\n | 'touch'\n | 'mouse'\n | 'keyboard'\n | 'onscreen-keyboard';\n\nexport type OutputDeviceTypes = void | 'touch' | 'desktop';\n\nexport interface ClientInputInterface {\n devices: InputDeviceTypes[];\n}\n\nexport interface ClientOutputInterface {\n device: OutputDeviceTypes;\n}\n\ninterface DevicePrefabInterface {\n input: ClientInputInterface;\n output: ClientOutputInterface;\n}\n\nexport const deviceDesktop: DevicePrefabInterface = {\n input: { devices: ['mouse', 'keyboard'] },\n output: { device: 'desktop' },\n};\n\nexport const deviceTouch: DevicePrefabInterface = {\n input: { devices: ['touch', 'onscreen-keyboard'] },\n output: { device: 'touch' },\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;MAEa,oBAAoB,GAAG,IAAI,cAAc,CACpD,sBAAsB;MAGX,qBAAqB,GAAG,IAAI,cAAc,CACrD,uBAAuB;AAyBlB,MAAM,aAAa,GAA0B;IAClD,KAAK,EAAE,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE;AACzC,IAAA,MAAM,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE;;AAGxB,MAAM,WAAW,GAA0B;IAChD,KAAK,EAAE,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,mBAAmB,CAAC,EAAE;AAClD,IAAA,MAAM,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE;;;ACvC7B;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { TemplateRef, ViewChild, ChangeDetectionStrategy, Component, Injectable, Input, Directive, NgModule } from '@angular/core';
|
|
2
|
+
import { TemplateRef, ViewChild, ChangeDetectionStrategy, Component, Injectable, Input, Inject, Optional, Directive, NgModule } from '@angular/core';
|
|
3
3
|
import { CommonModule } from '@angular/common';
|
|
4
4
|
import * as i2 from '@angular/cdk/a11y';
|
|
5
5
|
import * as i1 from '@angular/cdk/overlay';
|
|
@@ -7,6 +7,7 @@ import { ConnectionPositionPair } from '@angular/cdk/overlay';
|
|
|
7
7
|
import { TemplatePortal } from '@angular/cdk/portal';
|
|
8
8
|
import { Subject, fromEvent } from 'rxjs';
|
|
9
9
|
import { takeUntil } from 'rxjs/operators';
|
|
10
|
+
import { GRANITE_CLIENT_OUTPUT } from '@ifsworld/granite-components/core';
|
|
10
11
|
|
|
11
12
|
class GraniteTooltipComponent {
|
|
12
13
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: GraniteTooltipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
@@ -51,12 +52,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImpor
|
|
|
51
52
|
}] });
|
|
52
53
|
|
|
53
54
|
class GraniteTooltipTriggerForDirective {
|
|
54
|
-
constructor(_elementRef, _overlay, _viewContainerRef, _focusMonitor, _tooltipService) {
|
|
55
|
+
constructor(_elementRef, _overlay, _viewContainerRef, _focusMonitor, _tooltipService, _clientOutput) {
|
|
55
56
|
this._elementRef = _elementRef;
|
|
56
57
|
this._overlay = _overlay;
|
|
57
58
|
this._viewContainerRef = _viewContainerRef;
|
|
58
59
|
this._focusMonitor = _focusMonitor;
|
|
59
60
|
this._tooltipService = _tooltipService;
|
|
61
|
+
this._clientOutput = _clientOutput;
|
|
60
62
|
this.hideDelay = 0;
|
|
61
63
|
this.showDelay = 500;
|
|
62
64
|
this.showOnKeyboardFocus = false;
|
|
@@ -111,7 +113,9 @@ class GraniteTooltipTriggerForDirective {
|
|
|
111
113
|
});
|
|
112
114
|
}
|
|
113
115
|
_createOverlay() {
|
|
114
|
-
const scrollStrategy = this.
|
|
116
|
+
const scrollStrategy = this._clientOutput.device !== 'touch'
|
|
117
|
+
? this._overlay.scrollStrategies.reposition()
|
|
118
|
+
: this._overlay.scrollStrategies.close();
|
|
115
119
|
const positionStrategy = this._overlay
|
|
116
120
|
.position()
|
|
117
121
|
.flexibleConnectedTo(this._getTriggerElement())
|
|
@@ -158,7 +162,7 @@ class GraniteTooltipTriggerForDirective {
|
|
|
158
162
|
_getTriggerElement() {
|
|
159
163
|
return this._elementRef.nativeElement;
|
|
160
164
|
}
|
|
161
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: GraniteTooltipTriggerForDirective, deps: [{ token: i0.ElementRef }, { token: i1.Overlay }, { token: i0.ViewContainerRef }, { token: i2.FocusMonitor }, { token: GraniteTooltipService }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
165
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: GraniteTooltipTriggerForDirective, deps: [{ token: i0.ElementRef }, { token: i1.Overlay }, { token: i0.ViewContainerRef }, { token: i2.FocusMonitor }, { token: GraniteTooltipService }, { token: GRANITE_CLIENT_OUTPUT, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
162
166
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.4", type: GraniteTooltipTriggerForDirective, isStandalone: false, selector: "[graniteTooltipTriggerFor]", inputs: { tooltip: ["graniteTooltipTriggerFor", "tooltip"], hideDelay: "hideDelay", showDelay: "showDelay", showOnKeyboardFocus: "showOnKeyboardFocus", showOnClick: "showOnClick" }, host: { listeners: { "mouseenter": "_handleMouseenter($event)", "mouseleave": "_handleMouseleave($event)", "blur": "_handleBlur($event)" } }, usesOnChanges: true, ngImport: i0 }); }
|
|
163
167
|
}
|
|
164
168
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: GraniteTooltipTriggerForDirective, decorators: [{
|
|
@@ -172,7 +176,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImpor
|
|
|
172
176
|
},
|
|
173
177
|
standalone: false,
|
|
174
178
|
}]
|
|
175
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.Overlay }, { type: i0.ViewContainerRef }, { type: i2.FocusMonitor }, { type: GraniteTooltipService }
|
|
179
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.Overlay }, { type: i0.ViewContainerRef }, { type: i2.FocusMonitor }, { type: GraniteTooltipService }, { type: undefined, decorators: [{
|
|
180
|
+
type: Inject,
|
|
181
|
+
args: [GRANITE_CLIENT_OUTPUT]
|
|
182
|
+
}, {
|
|
183
|
+
type: Optional
|
|
184
|
+
}] }], propDecorators: { tooltip: [{
|
|
176
185
|
type: Input,
|
|
177
186
|
args: ['graniteTooltipTriggerFor']
|
|
178
187
|
}], hideDelay: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ifsworld-granite-components-tooltip.mjs","sources":["../../../../libs/granite-components/tooltip/src/lib/tooltip.component.ts","../../../../libs/granite-components/tooltip/src/lib/tooltip.component.html","../../../../libs/granite-components/tooltip/src/lib/tooltip-constants.library.ts","../../../../libs/granite-components/tooltip/src/lib/Services/granite-tooltip.service.ts","../../../../libs/granite-components/tooltip/src/lib/tooltip-trigger-for.directive.ts","../../../../libs/granite-components/tooltip/src/lib/tooltip.module.ts","../../../../libs/granite-components/tooltip/src/ifsworld-granite-components-tooltip.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\n\n@Component({\n selector: 'granite-tooltip',\n templateUrl: './tooltip.component.html',\n styleUrls: ['./tooltip.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: false,\n})\nexport class GraniteTooltipComponent {\n @ViewChild(TemplateRef) _templateRef: TemplateRef<any>;\n}\n","<ng-template>\n <div class=\"granite-tooltip\">\n <ng-content></ng-content>\n </div>\n</ng-template>\n","export class GraniteTooltipConstants {\n static readonly OFFSET_Y: number = 8;\n}\n","import { Injectable } from '@angular/core';\nimport { GraniteTooltipComponent } from '../tooltip.component';\nimport { GraniteTooltipTriggerForDirective } from '../tooltip-trigger-for.directive';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class GraniteTooltipService {\n private _activeTooltip: GraniteTooltipComponent | null = null;\n\n setActiveTooltip(tooltip: GraniteTooltipComponent): void {\n if (this._activeTooltip && this._activeTooltip !== tooltip) {\n this.clearActiveTooltip();\n }\n this._activeTooltip = tooltip;\n }\n\n clearActiveTooltip(): void {\n this._activeTooltip = null;\n }\n\n get activeTooltip(): GraniteTooltipComponent | null {\n return this._activeTooltip;\n }\n}\n","import { FocusMonitor } from '@angular/cdk/a11y';\nimport {\n ConnectionPositionPair,\n Overlay,\n OverlayRef,\n} from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport {\n Directive,\n ElementRef,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n SimpleChanges,\n ViewContainerRef,\n} from '@angular/core';\nimport { fromEvent, Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { GraniteTooltipConstants } from './tooltip-constants.library';\nimport { GraniteTooltipComponent } from './tooltip.component';\nimport { GraniteTooltipService } from './Services/granite-tooltip.service';\n\n@Directive({\n selector: '[graniteTooltipTriggerFor]',\n host: {\n '(mouseenter)': '_handleMouseenter($event)',\n '(mouseleave)': '_handleMouseleave($event)',\n '(blur)': '_handleBlur($event)',\n },\n standalone: false,\n})\nexport class GraniteTooltipTriggerForDirective\n implements OnDestroy, OnInit, OnChanges\n{\n @Input('graniteTooltipTriggerFor')\n tooltip: GraniteTooltipComponent;\n\n @Input()\n hideDelay: number = 0;\n\n @Input()\n showDelay: number = 500;\n\n @Input()\n showOnKeyboardFocus: boolean = false;\n\n @Input()\n showOnClick: boolean = false;\n\n private _overlayRef: OverlayRef;\n private _destroy: Subject<void> = new Subject();\n\n private _detachOverlayTimeoutId: number | null;\n private _attachOverlayTimeoutId: number | null;\n\n constructor(\n private _elementRef: ElementRef,\n private _overlay: Overlay,\n private _viewContainerRef: ViewContainerRef,\n private _focusMonitor: FocusMonitor,\n private _tooltipService: GraniteTooltipService\n ) {}\n\n ngOnInit(): void {\n this._createOverlay();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.showOnKeyboardFocus) {\n this._handleKeyboardFocus();\n }\n if (changes.showOnClick) {\n this._handleClick();\n }\n }\n\n ngOnDestroy(): void {\n this._detachOverlay(this.hideDelay);\n this._destroy.next();\n this._destroy.complete();\n }\n\n _handleMouseenter(): void {\n if (!this.showOnClick) {\n this._attachOverlay(this.showDelay);\n }\n }\n\n _handleMouseleave(): void {\n this._detachOverlay(this.hideDelay);\n }\n\n _handleBlur(): void {\n this._detachOverlay(this.hideDelay);\n }\n\n private _handleClick(): void {\n fromEvent(this._getTriggerElement(), 'click')\n .pipe(takeUntil(this._destroy))\n .subscribe(() => {\n this._attachOverlay(this.showDelay);\n });\n }\n\n private _handleKeyboardFocus(): void {\n this._focusMonitor\n .monitor(this._getTriggerElement())\n .pipe(takeUntil(this._destroy))\n .subscribe((origin) => {\n if (!origin) {\n this._detachOverlay(this.hideDelay);\n } else if (origin === 'keyboard') {\n this._attachOverlay(this.hideDelay);\n }\n });\n }\n\n private _createOverlay(): void {\n const scrollStrategy = this._overlay.scrollStrategies.reposition();\n const positionStrategy = this._overlay\n .position()\n .flexibleConnectedTo(this._getTriggerElement())\n .withPositions([\n new ConnectionPositionPair(\n { originX: 'center', originY: 'bottom' },\n { overlayX: 'center', overlayY: 'top' },\n undefined,\n GraniteTooltipConstants.OFFSET_Y,\n 'granite-tooltip-position-below'\n ),\n new ConnectionPositionPair(\n { originX: 'center', originY: 'top' },\n { overlayX: 'center', overlayY: 'bottom' },\n undefined,\n -GraniteTooltipConstants.OFFSET_Y,\n 'granite-tooltip-position-above'\n ),\n ])\n .withPush(true);\n\n this._overlayRef = this._overlay.create({\n positionStrategy,\n scrollStrategy,\n });\n\n this._overlayRef\n .backdropClick()\n .pipe(takeUntil(this._destroy))\n .subscribe(() => {\n this._detachOverlay(this.hideDelay);\n });\n }\n\n private _attachOverlay(delay: number): void {\n clearTimeout(this._detachOverlayTimeoutId);\n\n if (\n this._tooltipService.activeTooltip === this.tooltip &&\n this._overlayRef.hasAttached()\n ) {\n return;\n }\n this._tooltipService.setActiveTooltip(this.tooltip);\n\n this._attachOverlayTimeoutId = window.setTimeout(() => {\n if (!this._overlayRef.hasAttached()) {\n const portal = new TemplatePortal(\n this.tooltip._templateRef,\n this._viewContainerRef\n );\n this._overlayRef.attach(portal);\n }\n }, delay);\n }\n\n private _detachOverlay(delay: number): void {\n clearTimeout(this._attachOverlayTimeoutId);\n\n this._detachOverlayTimeoutId = window.setTimeout(() => {\n if (this._overlayRef.hasAttached()) {\n this._overlayRef.detach();\n this._detachOverlayTimeoutId = null;\n this._tooltipService.clearActiveTooltip();\n }\n }, delay);\n }\n\n private _getTriggerElement(): HTMLInputElement {\n return this._elementRef.nativeElement;\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { GraniteTooltipComponent } from './tooltip.component';\nimport { GraniteTooltipTriggerForDirective } from './tooltip-trigger-for.directive';\n\n@NgModule({\n imports: [CommonModule],\n declarations: [GraniteTooltipComponent, GraniteTooltipTriggerForDirective],\n exports: [GraniteTooltipComponent, GraniteTooltipTriggerForDirective],\n})\nexport class GraniteTooltipModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i3.GraniteTooltipService"],"mappings":";;;;;;;;;;MAca,uBAAuB,CAAA;8GAAvB,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAvB,uBAAuB,EAAA,YAAA,EAAA,KAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,WAAA,EAAA,CAAA,EAAA,YAAA,EAAA,cAAA,EAAA,KAAA,EAAA,IAAA,EAAA,SAAA,EACvB,WAAW,EAAA,WAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECfxB,6GAKA,EAAA,MAAA,EAAA,CAAA,6YAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,E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ources":["../../../../libs/granite-components/tooltip/src/lib/tooltip.component.ts","../../../../libs/granite-components/tooltip/src/lib/tooltip.component.html","../../../../libs/granite-components/tooltip/src/lib/tooltip-constants.library.ts","../../../../libs/granite-components/tooltip/src/lib/Services/granite-tooltip.service.ts","../../../../libs/granite-components/tooltip/src/lib/tooltip-trigger-for.directive.ts","../../../../libs/granite-components/tooltip/src/lib/tooltip.module.ts","../../../../libs/granite-components/tooltip/src/ifsworld-granite-components-tooltip.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\n\n@Component({\n selector: 'granite-tooltip',\n templateUrl: './tooltip.component.html',\n styleUrls: ['./tooltip.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: false,\n})\nexport class GraniteTooltipComponent {\n @ViewChild(TemplateRef) _templateRef: TemplateRef<any>;\n}\n","<ng-template>\n <div class=\"granite-tooltip\">\n <ng-content></ng-content>\n </div>\n</ng-template>\n","export class GraniteTooltipConstants {\n static readonly OFFSET_Y: number = 8;\n}\n","import { Injectable } from '@angular/core';\nimport { GraniteTooltipComponent } from '../tooltip.component';\nimport { GraniteTooltipTriggerForDirective } from '../tooltip-trigger-for.directive';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class GraniteTooltipService {\n private _activeTooltip: GraniteTooltipComponent | null = null;\n\n setActiveTooltip(tooltip: GraniteTooltipComponent): void {\n if (this._activeTooltip && this._activeTooltip !== tooltip) {\n this.clearActiveTooltip();\n }\n this._activeTooltip = tooltip;\n }\n\n clearActiveTooltip(): void {\n this._activeTooltip = null;\n }\n\n get activeTooltip(): GraniteTooltipComponent | null {\n return this._activeTooltip;\n }\n}\n","import { FocusMonitor } from '@angular/cdk/a11y';\nimport {\n ConnectionPositionPair,\n Overlay,\n OverlayRef,\n} from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport {\n Directive,\n ElementRef,\n Inject,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Optional,\n SimpleChanges,\n ViewContainerRef,\n} from '@angular/core';\nimport { fromEvent, Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { GraniteTooltipConstants } from './tooltip-constants.library';\nimport { GraniteTooltipComponent } from './tooltip.component';\nimport { GraniteTooltipService } from './Services/granite-tooltip.service';\nimport {\n ClientOutputInterface,\n GRANITE_CLIENT_OUTPUT,\n} from '@ifsworld/granite-components/core';\n\n@Directive({\n selector: '[graniteTooltipTriggerFor]',\n host: {\n '(mouseenter)': '_handleMouseenter($event)',\n '(mouseleave)': '_handleMouseleave($event)',\n '(blur)': '_handleBlur($event)',\n },\n standalone: false,\n})\nexport class GraniteTooltipTriggerForDirective\n implements OnDestroy, OnInit, OnChanges\n{\n @Input('graniteTooltipTriggerFor')\n tooltip: GraniteTooltipComponent;\n\n @Input()\n hideDelay: number = 0;\n\n @Input()\n showDelay: number = 500;\n\n @Input()\n showOnKeyboardFocus: boolean = false;\n\n @Input()\n showOnClick: boolean = false;\n\n private _overlayRef: OverlayRef;\n private _destroy: Subject<void> = new Subject();\n\n private _detachOverlayTimeoutId: number | null;\n private _attachOverlayTimeoutId: number | null;\n\n constructor(\n private _elementRef: ElementRef,\n private _overlay: Overlay,\n private _viewContainerRef: ViewContainerRef,\n private _focusMonitor: FocusMonitor,\n private _tooltipService: GraniteTooltipService,\n\n @Inject(GRANITE_CLIENT_OUTPUT)\n @Optional()\n public _clientOutput: ClientOutputInterface\n ) {}\n\n ngOnInit(): void {\n this._createOverlay();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.showOnKeyboardFocus) {\n this._handleKeyboardFocus();\n }\n if (changes.showOnClick) {\n this._handleClick();\n }\n }\n\n ngOnDestroy(): void {\n this._detachOverlay(this.hideDelay);\n this._destroy.next();\n this._destroy.complete();\n }\n\n _handleMouseenter(): void {\n if (!this.showOnClick) {\n this._attachOverlay(this.showDelay);\n }\n }\n\n _handleMouseleave(): void {\n this._detachOverlay(this.hideDelay);\n }\n\n _handleBlur(): void {\n this._detachOverlay(this.hideDelay);\n }\n\n private _handleClick(): void {\n fromEvent(this._getTriggerElement(), 'click')\n .pipe(takeUntil(this._destroy))\n .subscribe(() => {\n this._attachOverlay(this.showDelay);\n });\n }\n\n private _handleKeyboardFocus(): void {\n this._focusMonitor\n .monitor(this._getTriggerElement())\n .pipe(takeUntil(this._destroy))\n .subscribe((origin) => {\n if (!origin) {\n this._detachOverlay(this.hideDelay);\n } else if (origin === 'keyboard') {\n this._attachOverlay(this.hideDelay);\n }\n });\n }\n\n private _createOverlay(): void {\n const scrollStrategy =\n this._clientOutput.device !== 'touch'\n ? this._overlay.scrollStrategies.reposition()\n : this._overlay.scrollStrategies.close();\n\n const positionStrategy = this._overlay\n .position()\n .flexibleConnectedTo(this._getTriggerElement())\n .withPositions([\n new ConnectionPositionPair(\n { originX: 'center', originY: 'bottom' },\n { overlayX: 'center', overlayY: 'top' },\n undefined,\n GraniteTooltipConstants.OFFSET_Y,\n 'granite-tooltip-position-below'\n ),\n new ConnectionPositionPair(\n { originX: 'center', originY: 'top' },\n { overlayX: 'center', overlayY: 'bottom' },\n undefined,\n -GraniteTooltipConstants.OFFSET_Y,\n 'granite-tooltip-position-above'\n ),\n ])\n .withPush(true);\n\n this._overlayRef = this._overlay.create({\n positionStrategy,\n scrollStrategy,\n });\n\n this._overlayRef\n .backdropClick()\n .pipe(takeUntil(this._destroy))\n .subscribe(() => {\n this._detachOverlay(this.hideDelay);\n });\n }\n\n private _attachOverlay(delay: number): void {\n clearTimeout(this._detachOverlayTimeoutId);\n\n if (\n this._tooltipService.activeTooltip === this.tooltip &&\n this._overlayRef.hasAttached()\n ) {\n return;\n }\n this._tooltipService.setActiveTooltip(this.tooltip);\n\n this._attachOverlayTimeoutId = window.setTimeout(() => {\n if (!this._overlayRef.hasAttached()) {\n const portal = new TemplatePortal(\n this.tooltip._templateRef,\n this._viewContainerRef\n );\n this._overlayRef.attach(portal);\n }\n }, delay);\n }\n\n private _detachOverlay(delay: number): void {\n clearTimeout(this._attachOverlayTimeoutId);\n\n this._detachOverlayTimeoutId = window.setTimeout(() => {\n if (this._overlayRef.hasAttached()) {\n this._overlayRef.detach();\n this._detachOverlayTimeoutId = null;\n this._tooltipService.clearActiveTooltip();\n }\n }, delay);\n }\n\n private _getTriggerElement(): HTMLInputElement {\n return this._elementRef.nativeElement;\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { GraniteTooltipComponent } from './tooltip.component';\nimport { GraniteTooltipTriggerForDirective } from './tooltip-trigger-for.directive';\n\n@NgModule({\n imports: [CommonModule],\n declarations: [GraniteTooltipComponent, GraniteTooltipTriggerForDirective],\n exports: [GraniteTooltipComponent, GraniteTooltipTriggerForDirective],\n})\nexport class GraniteTooltipModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;MAca,uBAAuB,CAAA;8GAAvB,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAvB,uBAAuB,EAAA,YAAA,EAAA,KAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,WAAA,EAAA,CAAA,EAAA,YAAA,EAAA,cAAA,EAAA,KAAA,EAAA,IAAA,EAAA,SAAA,EACvB,WAAW,EAAA,WAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECfxB,6GAKA,EAAA,MAAA,EAAA,CAAA,6YAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FDSa,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAPnC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,EAAA,eAAA,EAGV,uBAAuB,CAAC,MAAM,cACnC,KAAK,EAAA,QAAA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from '@angular/cdk/bidi';
|
|
17
17
|
import { Directionality } from '@angular/cdk/bidi';
|
|
18
18
|
import { normalizePassiveListenerOptions } from '@angular/cdk/platform';
|
|
19
|
+
import { GRANITE_CLIENT_INPUT, GRANITE_CLIENT_OUTPUT, deviceDesktop, deviceTouch } from '@ifsworld/granite-components/core';
|
|
20
|
+
export * from '@ifsworld/granite-components/core';
|
|
19
21
|
import * as i2 from '@angular/cdk/collections';
|
|
20
22
|
import { SelectionModel } from '@angular/cdk/collections';
|
|
21
23
|
import * as i2$1 from '@angular/forms';
|
|
@@ -689,20 +691,20 @@ function throwGraniteMenuMissingError() {
|
|
|
689
691
|
}
|
|
690
692
|
/**
|
|
691
693
|
* Throws an exception for the case when menu's x-position value isn't valid.
|
|
692
|
-
* In other words, it doesn't match 'before' or '
|
|
694
|
+
* In other words, it doesn't match 'before', 'after', or 'center'.
|
|
693
695
|
* @docs-private
|
|
694
696
|
*/
|
|
695
697
|
function throwGraniteMenuInvalidPositionX() {
|
|
696
|
-
throw Error(`xPosition value must be either 'before' or
|
|
698
|
+
throw Error(`xPosition value must be either 'before', 'after', or 'center'.
|
|
697
699
|
Example: <granite-menu xPosition="before" #menu="graniteMenu"></granite-menu>`);
|
|
698
700
|
}
|
|
699
701
|
/**
|
|
700
702
|
* Throws an exception for the case when menu's y-position value isn't valid.
|
|
701
|
-
* In other words, it doesn't match 'above' or '
|
|
703
|
+
* In other words, it doesn't match 'above', 'below', or 'center'.
|
|
702
704
|
* @docs-private
|
|
703
705
|
*/
|
|
704
706
|
function throwGraniteMenuInvalidPositionY() {
|
|
705
|
-
throw Error(`yPosition value must be either 'above' or
|
|
707
|
+
throw Error(`yPosition value must be either 'above', 'below', or 'center'.
|
|
706
708
|
Example: <granite-menu yPosition="above" #menu="graniteMenu"></granite-menu>`);
|
|
707
709
|
}
|
|
708
710
|
|
|
@@ -885,7 +887,7 @@ class _MenuBaseComponent {
|
|
|
885
887
|
return this._xPosition;
|
|
886
888
|
}
|
|
887
889
|
set xPosition(value) {
|
|
888
|
-
if (value !== 'before' && value !== 'after') {
|
|
890
|
+
if (value !== 'before' && value !== 'after' && value !== 'center') {
|
|
889
891
|
throwGraniteMenuInvalidPositionX();
|
|
890
892
|
}
|
|
891
893
|
this._xPosition = value;
|
|
@@ -895,7 +897,7 @@ class _MenuBaseComponent {
|
|
|
895
897
|
return this._yPosition;
|
|
896
898
|
}
|
|
897
899
|
set yPosition(value) {
|
|
898
|
-
if (value !== 'above' && value !== 'below') {
|
|
900
|
+
if (value !== 'above' && value !== 'below' && value !== 'center') {
|
|
899
901
|
throwGraniteMenuInvalidPositionY();
|
|
900
902
|
}
|
|
901
903
|
this._yPosition = value;
|
|
@@ -909,6 +911,13 @@ class _MenuBaseComponent {
|
|
|
909
911
|
}
|
|
910
912
|
constructor(_changeDetectorRef) {
|
|
911
913
|
this._changeDetectorRef = _changeDetectorRef;
|
|
914
|
+
/**
|
|
915
|
+
* Custom position configuration for the overlay.
|
|
916
|
+
* When provided, this overrides the default positioning logic based on
|
|
917
|
+
* xPosition and yPosition. Uses Angular CDK ConnectedPosition format.
|
|
918
|
+
* If empty or not provided, falls back to default positioning behavior.
|
|
919
|
+
*/
|
|
920
|
+
this.cdkConnectedOverlayPosition = [];
|
|
912
921
|
this.openOnHover = true;
|
|
913
922
|
this.scrollStrategy = 'reposition';
|
|
914
923
|
/**
|
|
@@ -1206,7 +1215,7 @@ class _MenuBaseComponent {
|
|
|
1206
1215
|
});
|
|
1207
1216
|
}
|
|
1208
1217
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: _MenuBaseComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1209
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.4", type: _MenuBaseComponent, isStandalone: true, inputs: { xPosition: "xPosition", yPosition: "yPosition", title: "title", closeLabel: "closeLabel", openOnHover: "openOnHover", scrollStrategy: "scrollStrategy", styles: "styles", touchStyles: "touchStyles", preventParentClose: "preventParentClose" }, outputs: { closed: "closed", opened: "opened" }, queries: [{ propertyName: "customTemplate", first: true, predicate: GraniteMenuCustomTemplateDirective, descendants: true }, { propertyName: "_allItems", predicate: GraniteMenuItemComponent, descendants: true }], viewQueries: [{ propertyName: "templateRef", first: true, predicate: TemplateRef, descendants: true }], ngImport: i0 }); }
|
|
1218
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.4", type: _MenuBaseComponent, isStandalone: true, inputs: { xPosition: "xPosition", yPosition: "yPosition", cdkConnectedOverlayPosition: "cdkConnectedOverlayPosition", title: "title", closeLabel: "closeLabel", openOnHover: "openOnHover", scrollStrategy: "scrollStrategy", styles: "styles", touchStyles: "touchStyles", preventParentClose: "preventParentClose" }, outputs: { closed: "closed", opened: "opened" }, queries: [{ propertyName: "customTemplate", first: true, predicate: GraniteMenuCustomTemplateDirective, descendants: true }, { propertyName: "_allItems", predicate: GraniteMenuItemComponent, descendants: true }], viewQueries: [{ propertyName: "templateRef", first: true, predicate: TemplateRef, descendants: true }], ngImport: i0 }); }
|
|
1210
1219
|
}
|
|
1211
1220
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: _MenuBaseComponent, decorators: [{
|
|
1212
1221
|
type: Directive
|
|
@@ -1214,6 +1223,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImpor
|
|
|
1214
1223
|
type: Input
|
|
1215
1224
|
}], yPosition: [{
|
|
1216
1225
|
type: Input
|
|
1226
|
+
}], cdkConnectedOverlayPosition: [{
|
|
1227
|
+
type: Input
|
|
1217
1228
|
}], title: [{
|
|
1218
1229
|
type: Input
|
|
1219
1230
|
}], closeLabel: [{
|
|
@@ -1327,25 +1338,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImpor
|
|
|
1327
1338
|
], template: "<!--\n Using separate template part for desktop and touch output, because of\n animation triggers and slightly different content.\n-->\n<ng-template>\n <!-- Desktop -->\n <ng-container *ngIf=\"_clientOutput.device === 'desktop'\">\n <div\n #menu\n class=\"granite-menu\"\n [class.is-menu-empty]=\"_isMenuEmpty$ | async\"\n tabindex=\"-1\"\n [id]=\"panelId\"\n [@transformMenuDesktop]=\"_transformMenu | async\"\n (@transformMenuDesktop.start)=\"_onAnimationStart($event)\"\n (@transformMenuDesktop.done)=\"_onAnimationDone($event)\"\n [style]=\"styles\"\n (click)=\"_handleClick($event)\"\n (keydown)=\"_handleKeydown($event)\"\n >\n <div class=\"granite-menu-content\">\n <ng-container [ngTemplateOutlet]=\"content\"></ng-container>\n </div>\n </div>\n </ng-container>\n\n <!-- Touch -->\n <ng-container *ngIf=\"_clientOutput?.device === 'touch'\">\n <div\n #menu\n class=\"granite-menu granite-device-output-touch\"\n tabindex=\"-1\"\n [id]=\"panelId\"\n [style]=\"touchStyles\"\n [@transformMenuTouch]=\"_transformMenu | async\"\n (@transformMenuTouch.start)=\"_onAnimationStart($event)\"\n (@transformMenuTouch.done)=\"_onAnimationDone($event)\"\n (click)=\"_handleClick($event)\"\n (keydown)=\"_handleKeydown($event)\"\n >\n <div class=\"granite-menu-content\">\n <div *ngIf=\"showTitle\" class=\"header-container\">\n <button\n [disabled]=\"!showBackButton\"\n graniteMenuTouchTitleItem\n (click)=\"_handleBackClick($event)\"\n >\n {{ title }}\n </button>\n </div>\n\n <ng-container [ngTemplateOutlet]=\"content\"></ng-container>\n\n <div class=\"footer-container\"></div>\n </div>\n </div>\n\n <!-- Close button -->\n <div class=\"close\" [@transformCloseButton]=\"_transformMenu | async\">\n <button\n *ngIf=\"showCloseButton\"\n graniteMenuTouchCloseItem\n (click)=\"_handleCloseClick()\"\n >\n {{ closeLabel }}\n </button>\n </div>\n </ng-container>\n\n <!--\n Content template shared between desktop and touch parts, as <ng-content>\n can't be used in two places in the same template\n -->\n <ng-template #content>\n <ng-content></ng-content>\n </ng-template>\n</ng-template>\n", styles: [".granite-menu:not(.granite-device-output-touch){background-color:var(--granite-color-background-variant);color:var(--granite-color-text);overflow:auto;-webkit-overflow-scrolling:touch;outline:0;-webkit-user-select:none;user-select:none;box-shadow:var(--granite-shadow-l);min-width:7rem;overflow-x:hidden;overflow-y:hidden}.granite-menu:not(.granite-device-output-touch).ng-animating{pointer-events:none}.granite-menu:not(.granite-device-output-touch):not(.is-menu-empty){min-height:2rem}.granite-menu:not(.granite-device-output-touch):hover{overflow-y:auto}.granite-menu:not(.granite-device-output-touch)::-webkit-scrollbar{width:var(--granite-spacing-4)}.granite-menu:not(.granite-device-output-touch)::-webkit-scrollbar-thumb{background-color:var(--granite-color-border-hard);border-radius:calc(var(--granite-spacing-16) * .125)}.granite-menu:not(.granite-device-output-touch)::-webkit-scrollbar-track{background-color:var(--granite-color-background-hover)}.granite-menu.granite-device-output-touch{background-color:var(--granite-color-background-variant);color:var(--granite-color-text);overflow:auto;-webkit-overflow-scrolling:touch;outline:0;-webkit-user-select:none;user-select:none;box-shadow:var(--granite-shadow-l);border-radius:.25rem}.granite-menu.granite-device-output-touch.ng-animating{pointer-events:none}.granite-menu.granite-device-output-touch:not(.is-menu-empty){min-height:3rem}.granite-menu.granite-device-output-touch:not(.close){margin:var(--granite-spacing-4)}.granite-menu.granite-device-output-touch.close{margin-inline-start:var(--granite-spacing-4);margin-inline-end:var(--granite-spacing-4);margin-block-end:var(--granite-spacing-4)}.granite-menu.granite-device-output-touch .header-container{position:sticky;top:0;background-color:var(--granite-color-background-variant);z-index:1}.granite-menu.granite-device-output-touch .footer-container{position:sticky;bottom:0;height:0}.close:not(:empty){background-color:var(--granite-color-background-variant);color:var(--granite-color-text);overflow:auto;-webkit-overflow-scrolling:touch;outline:0;-webkit-user-select:none;user-select:none;box-shadow:var(--granite-shadow-l);border-radius:.25rem}.close:not(:empty).ng-animating{pointer-events:none}.close:not(:empty):not(.is-menu-empty){min-height:3rem}.close:not(:empty):not(.close){margin:var(--granite-spacing-4)}.close:not(:empty).close{margin-inline-start:var(--granite-spacing-4);margin-inline-end:var(--granite-spacing-4);margin-block-end:var(--granite-spacing-4)}.granite-menu-custom-template{display:block}.granite-menu-custom-template:not(button){cursor:default}\n"] }]
|
|
1328
1339
|
}] });
|
|
1329
1340
|
|
|
1330
|
-
/**
|
|
1331
|
-
* Injection token used to provide components knowledge of what device types
|
|
1332
|
-
* are being used for input.
|
|
1333
|
-
*/
|
|
1334
|
-
const GRANITE_CLIENT_INPUT = new InjectionToken('GRANITE_CLIENT_INPUT');
|
|
1335
|
-
/**
|
|
1336
|
-
* Injection token used to provide components knowledge of what device type
|
|
1337
|
-
* is being used for output.
|
|
1338
|
-
*/
|
|
1339
|
-
const GRANITE_CLIENT_OUTPUT = new InjectionToken('GRANITE_CLIENT_OUTPUT');
|
|
1340
|
-
const deviceDesktop = {
|
|
1341
|
-
input: { devices: ['mouse', 'keyboard'] },
|
|
1342
|
-
output: { device: 'desktop' },
|
|
1343
|
-
};
|
|
1344
|
-
const deviceTouch = {
|
|
1345
|
-
input: { devices: ['touch', 'onscreen-keyboard'] },
|
|
1346
|
-
output: { device: 'touch' },
|
|
1347
|
-
};
|
|
1348
|
-
|
|
1349
1341
|
/** Options for binding a passive event listener. */
|
|
1350
1342
|
const passiveEventListenerOptions = normalizePassiveListenerOptions({
|
|
1351
1343
|
passive: true,
|
|
@@ -1816,26 +1808,51 @@ class GraniteMenuTriggerForDirective {
|
|
|
1816
1808
|
* @param positionStrategy Strategy whose position to update.
|
|
1817
1809
|
*/
|
|
1818
1810
|
_setPosition(positionStrategy) {
|
|
1811
|
+
if (this.menu.cdkConnectedOverlayPosition &&
|
|
1812
|
+
this.menu.cdkConnectedOverlayPosition.length > 0) {
|
|
1813
|
+
positionStrategy.withPositions(this.menu.cdkConnectedOverlayPosition);
|
|
1814
|
+
return;
|
|
1815
|
+
}
|
|
1819
1816
|
const MENU_PANEL_TOP_PADDING = 0;
|
|
1820
|
-
let [originX, originFallbackX] = this.menu.xPosition === 'before'
|
|
1821
|
-
|
|
1817
|
+
let [originX, originFallbackX] = this.menu.xPosition === 'before'
|
|
1818
|
+
? ['end', 'start']
|
|
1819
|
+
: this.menu.xPosition === 'center'
|
|
1820
|
+
? ['center', 'center']
|
|
1821
|
+
: ['start', 'end'];
|
|
1822
|
+
const [overlayY, overlayFallbackY] = this.menu.yPosition === 'above'
|
|
1823
|
+
? ['bottom', 'top']
|
|
1824
|
+
: this.menu.yPosition === 'center'
|
|
1825
|
+
? ['center', 'center']
|
|
1826
|
+
: ['top', 'bottom'];
|
|
1822
1827
|
let [originY, originFallbackY] = [overlayY, overlayFallbackY];
|
|
1823
1828
|
let [overlayX, overlayFallbackX] = [originX, originFallbackX];
|
|
1824
1829
|
let offsetY = 0;
|
|
1825
1830
|
if (this.triggersSubmenu()) {
|
|
1826
1831
|
// When the menu is a sub-menu, it should always align itself
|
|
1827
1832
|
// to the edges of the trigger, instead of overlapping it.
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1833
|
+
if (this.menu.xPosition === 'center') {
|
|
1834
|
+
overlayFallbackX = originX = 'center';
|
|
1835
|
+
originFallbackX = overlayX = 'center';
|
|
1836
|
+
}
|
|
1837
|
+
else {
|
|
1838
|
+
overlayFallbackX = originX =
|
|
1839
|
+
this.menu.xPosition === 'before' ? 'start' : 'end';
|
|
1840
|
+
originFallbackX = overlayX = originX === 'end' ? 'start' : 'end';
|
|
1841
|
+
}
|
|
1831
1842
|
offsetY =
|
|
1832
1843
|
overlayY === 'bottom'
|
|
1833
1844
|
? MENU_PANEL_TOP_PADDING
|
|
1834
1845
|
: -MENU_PANEL_TOP_PADDING;
|
|
1835
1846
|
}
|
|
1836
1847
|
else {
|
|
1837
|
-
|
|
1838
|
-
|
|
1848
|
+
if (this.menu.yPosition === 'center') {
|
|
1849
|
+
originY = 'center';
|
|
1850
|
+
originFallbackY = 'center';
|
|
1851
|
+
}
|
|
1852
|
+
else {
|
|
1853
|
+
originY = overlayY === 'top' ? 'bottom' : 'top';
|
|
1854
|
+
originFallbackY = overlayFallbackY === 'top' ? 'bottom' : 'top';
|
|
1855
|
+
}
|
|
1839
1856
|
}
|
|
1840
1857
|
positionStrategy.withPositions([
|
|
1841
1858
|
{ originX, originY, overlayX, overlayY, offsetY },
|
|
@@ -5681,5 +5698,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImpor
|
|
|
5681
5698
|
* Generated bundle index. Do not edit.
|
|
5682
5699
|
*/
|
|
5683
5700
|
|
|
5684
|
-
export { AVATAR_DEFAULT_STATUS, ButtonSelectors, CONTACT_DEFAULT_STATUS, ClientInputDesktopDirective, ClientInputTouchDirective, ClientOutputDesktopDirective, ClientOutputTouchDirective, ContactItemDefaultStatusComponent,
|
|
5701
|
+
export { AVATAR_DEFAULT_STATUS, ButtonSelectors, CONTACT_DEFAULT_STATUS, ClientInputDesktopDirective, ClientInputTouchDirective, ClientOutputDesktopDirective, ClientOutputTouchDirective, ContactItemDefaultStatusComponent, GraniteAnchorComponent, GraniteArrangeGridComponent, GraniteArrangeGridItemComponent, GraniteArrangeGridModule, GraniteArrangeGridOrientation, GraniteAvatarComponent, GraniteAvatarDefaultStatusComponent, GraniteAvatarModule, 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, GraniteCustomAvatarStatusDirective, GraniteCustomProfileDirective, GraniteCustomStatusDirective, GraniteDividerDirective, GraniteEmptyAvatarComponent, GraniteGridComponent, GraniteGridItemComponent, GraniteGridModule, GraniteHideOnOverflowDirective, GraniteIconComponent, GraniteIconModule, GraniteInputFieldComponent, GraniteInputFieldModule, GraniteLabelComponent, GraniteLabelModule, GraniteMenuComponent, GraniteMenuCustomTemplateDirective, GraniteMenuHarness, GraniteMenuItemComponent, GraniteMenuItemHarness, GraniteMenuModule, GraniteMenuTouchCloseComponent, GraniteMenuTouchTitleItemComponent, GraniteMenuTriggerForDirective, GraniteProgressBarComponent, GraniteProgressBarModule, GraniteRadioButtonComponent, GraniteRadioButtonModule, GraniteRadioGroupComponent, GraniteTitleDirective, GraniteTitlePipe, GraniteToggleSwitchComponent, GraniteToggleSwitchModule, PurePipesModule, disabledMixin, graniteMenuDesktopAnimations, graniteMenuTouchAnimations };
|
|
5685
5702
|
//# sourceMappingURL=ifsworld-granite-components.mjs.map
|