@ifsworld/granite-components 17.0.0 → 18.0.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 +29 -0
- package/fesm2022/ifsworld-granite-components-core.mjs +27 -0
- package/fesm2022/ifsworld-granite-components-core.mjs.map +1 -0
- package/fesm2022/ifsworld-granite-components-tooltip.mjs +5 -1
- package/fesm2022/ifsworld-granite-components-tooltip.mjs.map +1 -1
- package/fesm2022/ifsworld-granite-components.mjs +5 -29
- package/fesm2022/ifsworld-granite-components.mjs.map +1 -1
- package/index.d.ts +5 -30
- package/package.json +5 -1
- package/tooltip/index.d.ts +1 -0
package/core/index.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Injection token used to provide components knowledge of what device types
|
|
5
|
+
* are being used for input.
|
|
6
|
+
*/
|
|
7
|
+
declare const GRANITE_CLIENT_INPUT: InjectionToken<ClientInputInterface>;
|
|
8
|
+
/**
|
|
9
|
+
* Injection token used to provide components knowledge of what device type
|
|
10
|
+
* is being used for output.
|
|
11
|
+
*/
|
|
12
|
+
declare const GRANITE_CLIENT_OUTPUT: InjectionToken<ClientOutputInterface>;
|
|
13
|
+
type InputDeviceTypes = void | 'touch' | 'mouse' | 'keyboard' | 'onscreen-keyboard';
|
|
14
|
+
type OutputDeviceTypes = void | 'touch' | 'desktop';
|
|
15
|
+
interface ClientInputInterface {
|
|
16
|
+
devices: InputDeviceTypes[];
|
|
17
|
+
}
|
|
18
|
+
interface ClientOutputInterface {
|
|
19
|
+
device: OutputDeviceTypes;
|
|
20
|
+
}
|
|
21
|
+
interface DevicePrefabInterface {
|
|
22
|
+
input: ClientInputInterface;
|
|
23
|
+
output: ClientOutputInterface;
|
|
24
|
+
}
|
|
25
|
+
declare const deviceDesktop: DevicePrefabInterface;
|
|
26
|
+
declare const deviceTouch: DevicePrefabInterface;
|
|
27
|
+
|
|
28
|
+
export { GRANITE_CLIENT_INPUT, GRANITE_CLIENT_OUTPUT, deviceDesktop, deviceTouch };
|
|
29
|
+
export type { ClientInputInterface, ClientOutputInterface, InputDeviceTypes, OutputDeviceTypes };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Injection token used to provide components knowledge of what device types
|
|
5
|
+
* are being used for input.
|
|
6
|
+
*/
|
|
7
|
+
const GRANITE_CLIENT_INPUT = new InjectionToken('GRANITE_CLIENT_INPUT');
|
|
8
|
+
/**
|
|
9
|
+
* Injection token used to provide components knowledge of what device type
|
|
10
|
+
* is being used for output.
|
|
11
|
+
*/
|
|
12
|
+
const GRANITE_CLIENT_OUTPUT = new InjectionToken('GRANITE_CLIENT_OUTPUT');
|
|
13
|
+
const deviceDesktop = {
|
|
14
|
+
input: { devices: ['mouse', 'keyboard'] },
|
|
15
|
+
output: { device: 'desktop' },
|
|
16
|
+
};
|
|
17
|
+
const deviceTouch = {
|
|
18
|
+
input: { devices: ['touch', 'onscreen-keyboard'] },
|
|
19
|
+
output: { device: 'touch' },
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Generated bundle index. Do not edit.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
export { GRANITE_CLIENT_INPUT, GRANITE_CLIENT_OUTPUT, deviceDesktop, deviceTouch };
|
|
27
|
+
//# 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\n/**\n * Injection token used to provide components knowledge of what device types\n * are being used for input.\n */\nexport const GRANITE_CLIENT_INPUT = new InjectionToken<ClientInputInterface>(\n 'GRANITE_CLIENT_INPUT'\n);\n\n/**\n * Injection token used to provide components knowledge of what device type\n * is being used for output.\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 =\n | void\n | 'touch' // TODO: Change to 'touch-screen' for touch\n | 'desktop'; // TODO: Change to 'screen' for 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":";;AAEA;;;AAGG;MACU,oBAAoB,GAAG,IAAI,cAAc,CACpD,sBAAsB;AAGxB;;;AAGG;MACU,qBAAqB,GAAG,IAAI,cAAc,CACrD,uBAAuB;AA4BlB,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;;;AClD7B;;AAEG;;;;"}
|
|
@@ -6,6 +6,7 @@ import { Overlay, ConnectionPositionPair } from '@angular/cdk/overlay';
|
|
|
6
6
|
import { TemplatePortal } from '@angular/cdk/portal';
|
|
7
7
|
import { Subject, fromEvent } from 'rxjs';
|
|
8
8
|
import { takeUntil } from 'rxjs/operators';
|
|
9
|
+
import { GRANITE_CLIENT_OUTPUT } from '@ifsworld/granite-components/core';
|
|
9
10
|
|
|
10
11
|
class GraniteTooltipComponent {
|
|
11
12
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: GraniteTooltipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
@@ -61,6 +62,7 @@ class GraniteTooltipTriggerForDirective {
|
|
|
61
62
|
this._viewContainerRef = inject(ViewContainerRef);
|
|
62
63
|
this._focusMonitor = inject(FocusMonitor);
|
|
63
64
|
this._tooltipService = inject(GraniteTooltipService);
|
|
65
|
+
this._clientOutput = inject(GRANITE_CLIENT_OUTPUT, { optional: true });
|
|
64
66
|
this._destroy = new Subject();
|
|
65
67
|
}
|
|
66
68
|
ngOnInit() {
|
|
@@ -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())
|
|
@@ -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_X: number = 8;\n static readonly OFFSET_Y: number = 8;\n}\n","import { Injectable } from '@angular/core';\nimport { GraniteTooltipComponent } from '../tooltip.component';\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 HorizontalConnectionPos,\n Overlay,\n OverlayRef,\n VerticalConnectionPos,\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 inject,\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 _elementRef = inject(ElementRef);\n private _overlay = inject(Overlay);\n private _viewContainerRef = inject(ViewContainerRef);\n private _focusMonitor = inject(FocusMonitor);\n private _tooltipService = inject(GraniteTooltipService);\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 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(this._getTooltipPositions())\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 private _createPositionPair(\n originX: HorizontalConnectionPos,\n originY: VerticalConnectionPos,\n overlayX: HorizontalConnectionPos,\n overlayY: VerticalConnectionPos,\n offsetX: number | undefined,\n offsetY: number | undefined,\n positionName: string\n ): ConnectionPositionPair {\n return new ConnectionPositionPair(\n { originX, originY },\n { overlayX, overlayY },\n offsetX,\n offsetY,\n `granite-tooltip-position-${positionName}`\n );\n }\n\n private _getTooltipPositions(): ConnectionPositionPair[] {\n const offsetX = GraniteTooltipConstants.OFFSET_X;\n const offsetY = GraniteTooltipConstants.OFFSET_Y;\n\n return [\n // below\n this._createPositionPair(\n 'center',\n 'bottom',\n 'center',\n 'top',\n undefined,\n offsetY,\n 'below'\n ),\n // above\n this._createPositionPair(\n 'center',\n 'top',\n 'center',\n 'bottom',\n undefined,\n -offsetY,\n 'above'\n ),\n // right\n this._createPositionPair(\n 'end',\n 'center',\n 'start',\n 'center',\n offsetX,\n undefined,\n 'right'\n ),\n // left\n this._createPositionPair(\n 'start',\n 'center',\n 'end',\n 'center',\n -offsetX,\n undefined,\n 'left'\n ),\n // below-start\n this._createPositionPair(\n 'start',\n 'bottom',\n 'start',\n 'top',\n undefined,\n offsetY,\n 'below-start'\n ),\n // below-end\n this._createPositionPair(\n 'end',\n 'bottom',\n 'end',\n 'top',\n undefined,\n offsetY,\n 'below-end'\n ),\n // above-start\n this._createPositionPair(\n 'start',\n 'top',\n 'start',\n 'bottom',\n undefined,\n -offsetY,\n 'above-start'\n ),\n // above-end\n this._createPositionPair(\n 'end',\n 'top',\n 'end',\n 'bottom',\n undefined,\n -offsetY,\n 'above-end'\n ),\n // right-start\n this._createPositionPair(\n 'end',\n 'top',\n 'start',\n 'top',\n offsetX,\n undefined,\n 'right-start'\n ),\n // right-end\n this._createPositionPair(\n 'end',\n 'bottom',\n 'start',\n 'bottom',\n offsetX,\n undefined,\n 'right-end'\n ),\n // left-start\n this._createPositionPair(\n 'start',\n 'top',\n 'end',\n 'top',\n -offsetX,\n undefined,\n 'left-start'\n ),\n // left-end\n this._createPositionPair(\n 'start',\n 'bottom',\n 'end',\n 'bottom',\n -offsetX,\n undefined,\n 'left-end'\n ),\n ];\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 */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AAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,YAJrB,YAAY,CAAA,EAAA,CAAA,CAAA;;2FAIX,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBALhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,YAAY,CAAC;AACvB,oBAAA,YAAY,EAAE,CAAC,uBAAuB,EAAE,iCAAiC,CAAC;AAC1E,oBAAA,OAAO,EAAE,CAAC,uBAAuB,EAAE,iCAAiC,CAAC;AACtE,iBAAA;;;ACTD;;AAEG;;;;"}
|
|
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_X: number = 8;\n static readonly OFFSET_Y: number = 8;\n}\n","import { Injectable } from '@angular/core';\nimport { GraniteTooltipComponent } from '../tooltip.component';\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 HorizontalConnectionPos,\n Overlay,\n OverlayRef,\n VerticalConnectionPos,\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 inject,\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 { GRANITE_CLIENT_OUTPUT } 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 _elementRef = inject(ElementRef);\n private _overlay = inject(Overlay);\n private _viewContainerRef = inject(ViewContainerRef);\n private _focusMonitor = inject(FocusMonitor);\n private _tooltipService = inject(GraniteTooltipService);\n private _clientOutput = inject(GRANITE_CLIENT_OUTPUT, { optional: true });\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 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 const positionStrategy = this._overlay\n .position()\n .flexibleConnectedTo(this._getTriggerElement())\n .withPositions(this._getTooltipPositions())\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 private _createPositionPair(\n originX: HorizontalConnectionPos,\n originY: VerticalConnectionPos,\n overlayX: HorizontalConnectionPos,\n overlayY: VerticalConnectionPos,\n offsetX: number | undefined,\n offsetY: number | undefined,\n positionName: string\n ): ConnectionPositionPair {\n return new ConnectionPositionPair(\n { originX, originY },\n { overlayX, overlayY },\n offsetX,\n offsetY,\n `granite-tooltip-position-${positionName}`\n );\n }\n\n private _getTooltipPositions(): ConnectionPositionPair[] {\n const offsetX = GraniteTooltipConstants.OFFSET_X;\n const offsetY = GraniteTooltipConstants.OFFSET_Y;\n\n return [\n // below\n this._createPositionPair(\n 'center',\n 'bottom',\n 'center',\n 'top',\n undefined,\n offsetY,\n 'below'\n ),\n // above\n this._createPositionPair(\n 'center',\n 'top',\n 'center',\n 'bottom',\n undefined,\n -offsetY,\n 'above'\n ),\n // right\n this._createPositionPair(\n 'end',\n 'center',\n 'start',\n 'center',\n offsetX,\n undefined,\n 'right'\n ),\n // left\n this._createPositionPair(\n 'start',\n 'center',\n 'end',\n 'center',\n -offsetX,\n undefined,\n 'left'\n ),\n // below-start\n this._createPositionPair(\n 'start',\n 'bottom',\n 'start',\n 'top',\n undefined,\n offsetY,\n 'below-start'\n ),\n // below-end\n this._createPositionPair(\n 'end',\n 'bottom',\n 'end',\n 'top',\n undefined,\n offsetY,\n 'below-end'\n ),\n // above-start\n this._createPositionPair(\n 'start',\n 'top',\n 'start',\n 'bottom',\n undefined,\n -offsetY,\n 'above-start'\n ),\n // above-end\n this._createPositionPair(\n 'end',\n 'top',\n 'end',\n 'bottom',\n undefined,\n -offsetY,\n 'above-end'\n ),\n // right-start\n this._createPositionPair(\n 'end',\n 'top',\n 'start',\n 'top',\n offsetX,\n undefined,\n 'right-start'\n ),\n // right-end\n this._createPositionPair(\n 'end',\n 'bottom',\n 'start',\n 'bottom',\n offsetX,\n undefined,\n 'right-end'\n ),\n // left-start\n this._createPositionPair(\n 'start',\n 'top',\n 'end',\n 'top',\n -offsetX,\n undefined,\n 'left-start'\n ),\n // left-end\n this._createPositionPair(\n 'start',\n 'bottom',\n 'end',\n 'bottom',\n -offsetX,\n undefined,\n 'left-end'\n ),\n ];\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,CA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;2FAIX,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBALhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,YAAY,CAAC;AACvB,oBAAA,YAAY,EAAE,CAAC,uBAAuB,EAAE,iCAAiC,CAAC;AAC1E,oBAAA,OAAO,EAAE,CAAC,uBAAuB,EAAE,iCAAiC,CAAC;AACtE,iBAAA;;;ACTD;;AAEG;;;;"}
|
|
@@ -14,6 +14,8 @@ import { FocusMonitor, FocusKeyManager, isFakeMousedownFromScreenReader } from '
|
|
|
14
14
|
import { hasModifierKey, ENTER, SPACE, BACKSPACE, DELETE, TAB } from '@angular/cdk/keycodes';
|
|
15
15
|
import { Directionality } from '@angular/cdk/bidi';
|
|
16
16
|
import { normalizePassiveListenerOptions } from '@angular/cdk/platform';
|
|
17
|
+
import { GRANITE_CLIENT_INPUT, GRANITE_CLIENT_OUTPUT, deviceDesktop, deviceTouch } from '@ifsworld/granite-components/core';
|
|
18
|
+
export * from '@ifsworld/granite-components/core';
|
|
17
19
|
import { UniqueSelectionDispatcher, SelectionModel } from '@angular/cdk/collections';
|
|
18
20
|
import { NgForm, FormGroupDirective, NgControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
19
21
|
import * as i3 from '@ifsworld/granite-components/tooltip';
|
|
@@ -1324,25 +1326,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImpor
|
|
|
1324
1326
|
], 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"] }]
|
|
1325
1327
|
}] });
|
|
1326
1328
|
|
|
1327
|
-
/**
|
|
1328
|
-
* Injection token used to provide components knowledge of what device types
|
|
1329
|
-
* are being used for input.
|
|
1330
|
-
*/
|
|
1331
|
-
const GRANITE_CLIENT_INPUT = new InjectionToken('GRANITE_CLIENT_INPUT');
|
|
1332
|
-
/**
|
|
1333
|
-
* Injection token used to provide components knowledge of what device type
|
|
1334
|
-
* is being used for output.
|
|
1335
|
-
*/
|
|
1336
|
-
const GRANITE_CLIENT_OUTPUT = new InjectionToken('GRANITE_CLIENT_OUTPUT');
|
|
1337
|
-
const deviceDesktop = {
|
|
1338
|
-
input: { devices: ['mouse', 'keyboard'] },
|
|
1339
|
-
output: { device: 'desktop' },
|
|
1340
|
-
};
|
|
1341
|
-
const deviceTouch = {
|
|
1342
|
-
input: { devices: ['touch', 'onscreen-keyboard'] },
|
|
1343
|
-
output: { device: 'touch' },
|
|
1344
|
-
};
|
|
1345
|
-
|
|
1346
1329
|
/** Options for binding a passive event listener. */
|
|
1347
1330
|
const passiveEventListenerOptions = normalizePassiveListenerOptions({
|
|
1348
1331
|
passive: true,
|
|
@@ -2794,7 +2777,6 @@ class GraniteInputFieldComponent {
|
|
|
2794
2777
|
this._hasSuffixButton = false;
|
|
2795
2778
|
this._currentCharCount = 0;
|
|
2796
2779
|
this._passwordToggled = false;
|
|
2797
|
-
this._lastEmittedValue = '';
|
|
2798
2780
|
this._focusMonitor = inject(FocusMonitor);
|
|
2799
2781
|
this._cdr = inject(ChangeDetectorRef);
|
|
2800
2782
|
this._elementRef = inject(ElementRef);
|
|
@@ -2858,7 +2840,7 @@ class GraniteInputFieldComponent {
|
|
|
2858
2840
|
const inputEvent = event.target;
|
|
2859
2841
|
this._applyCharacterCount(inputEvent.value);
|
|
2860
2842
|
this._empty = inputEvent.value == null || inputEvent.value === '';
|
|
2861
|
-
this.
|
|
2843
|
+
this.valueChange.emit(inputEvent.value);
|
|
2862
2844
|
}
|
|
2863
2845
|
_validateType() {
|
|
2864
2846
|
if (GRANITE_INPUT_INCLUDES.indexOf(this.type) < 0) {
|
|
@@ -2881,7 +2863,7 @@ class GraniteInputFieldComponent {
|
|
|
2881
2863
|
if (this._currentCharCount > this.maxlength) {
|
|
2882
2864
|
inputString = inputString.slice(0, this.maxlength);
|
|
2883
2865
|
this.value = inputString;
|
|
2884
|
-
this.
|
|
2866
|
+
this.valueChange.emit(inputString);
|
|
2885
2867
|
this._currentCharCount = this.maxlength;
|
|
2886
2868
|
}
|
|
2887
2869
|
}
|
|
@@ -2892,12 +2874,6 @@ class GraniteInputFieldComponent {
|
|
|
2892
2874
|
_getTextareaElement() {
|
|
2893
2875
|
return this._textareaElement.nativeElement;
|
|
2894
2876
|
}
|
|
2895
|
-
_emitValueIfChanged(value) {
|
|
2896
|
-
if (value !== this._lastEmittedValue) {
|
|
2897
|
-
this._lastEmittedValue = value;
|
|
2898
|
-
this.valueChange.emit(value);
|
|
2899
|
-
}
|
|
2900
|
-
}
|
|
2901
2877
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: GraniteInputFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2902
2878
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.9", type: GraniteInputFieldComponent, isStandalone: false, selector: "granite-input-field", inputs: { id: "id", name: "name", type: "type", value: "value", required: "required", readonly: "readonly", invalid: "invalid", disabled: "disabled", placeholder: "placeholder", prefixicon: "prefixicon", maxlength: "maxlength", countcharacters: "countcharacters", ariaLabel: ["aria-label", "ariaLabel"], ariaLabelledby: ["aria-labelledby", "ariaLabelledby"] }, outputs: { valueChange: "valueChange" }, host: { classAttribute: "granite-input-field" }, viewQueries: [{ propertyName: "_inputElement", first: true, predicate: ["input"], descendants: true }, { propertyName: "_textareaElement", first: true, predicate: ["textarea"], descendants: true }], exportAs: ["graniteInputField"], usesOnChanges: true, ngImport: i0, template: "<div\n *ngIf=\"_supported\"\n class=\"granite-input-container\"\n [class.granite-input-disabled]=\"disabled\"\n [class.granite-input-readonly]=\"readonly\"\n [class.granite-input-disabled]=\"disabled\"\n [class.granite-input-readonly]=\"readonly\"\n>\n <div\n class=\"granite-input-top-row\"\n [class.granite-input-required]=\"required\"\n [class.granite-input-empty]=\"_empty\"\n [class.granite-input-disabled]=\"disabled\"\n [class.granite-input-readonly]=\"readonly\"\n [class.granite-input-invalid]=\"invalid\"\n >\n <div\n *ngIf=\"prefixicon\"\n class=\"granite-input-prepend\"\n [class.granite-input-required]=\"required\"\n [class.granite-input-empty]=\"_empty\"\n >\n <granite-icon class=\"granite-input-prepend-icon\">\n {{ prefixicon }}\n </granite-icon>\n </div>\n\n <ng-container\n *ngIf=\"type !== 'textarea'; then inputElement; else textareaElement\"\n ></ng-container>\n\n <ng-template #inputElement>\n <input\n #input\n [id]=\"id\"\n class=\"granite-input-base\"\n [class.granite-input-invalid]=\"invalid\"\n [class.granite-input-empty]=\"_empty\"\n [class.granite-input-base--with-append]=\"\n _passwordField || _hasSuffixButton\n \"\n [class.granite-input-base--with-prefix]=\"prefixicon\"\n [name]=\"name\"\n [attr.type]=\"type\"\n [required]=\"required\"\n [readonly]=\"readonly\"\n [disabled]=\"disabled\"\n [placeholder]=\"placeholder\"\n [attr.maxlength]=\"maxlength\"\n [value]=\"value\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [attr.aria-invalid]=\"invalid\"\n (input)=\"_onInput($event)\"\n />\n </ng-template>\n\n <button\n *ngIf=\"_passwordField\"\n class=\"granite-input-append\"\n [class.granite-input-required]=\"required\"\n [class.granite-input-empty]=\"_empty\"\n (click)=\"_togglePassword()\"\n >\n <granite-icon class=\"granite-input-password-toggle-icon\">\n {{ _passwordFieldIcon }}\n </granite-icon>\n </button>\n\n <ng-container *ngIf=\"!_passwordField\">\n <ng-content select=\"[graniteInputSuffixButton]\"></ng-content>\n </ng-container>\n\n <ng-template #textareaElement>\n <textarea\n #textarea\n [id]=\"id\"\n class=\"granite-input-base granite-text-area\"\n [class.granite-input-invalid]=\"invalid\"\n [class.granite-input-empty]=\"_empty\"\n rows=\"1\"\n [name]=\"name\"\n [attr.type]=\"type\"\n [required]=\"required\"\n [readonly]=\"readonly\"\n [disabled]=\"disabled\"\n [placeholder]=\"placeholder\"\n [value]=\"value\"\n [attr.maxlength]=\"maxlength\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [attr.aria-required]=\"required\"\n [attr.aria-invalid]=\"invalid\"\n (input)=\"_onInput($event)\"\n ></textarea>\n </ng-template>\n </div>\n\n <div *ngIf=\"countcharacters\" class=\"granite-input-bottom-row\">\n <div class=\"granite-input-char-count\">\n {{ _currentCharCount }}/{{ maxlength }}\n </div>\n </div>\n</div>\n", styles: [":host{transition:all .2s ease-out;width:14.5rem;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}.granite-input-container{width:inherit;font-size:var(--granite-font-size-body-small)}.granite-input-container:has(.granite-text-area){width:100%}.granite-input-container .granite-input-top-row{display:inline-flex;width:inherit;position:relative;background:var(--granite-color-background);border-radius:var(--granite-radius-s)}.granite-input-container .granite-input-top-row:has(.granite-text-area){width:auto;max-width:100%}.granite-input-container .granite-input-top-row:not(:focus-within){outline:var(--granite-border-width-regular) solid var(--granite-color-border-medium)}.granite-input-container .granite-input-top-row:hover:not(:focus-within){outline:var(--granite-border-width-regular) solid var(--granite-color-border-hard)}.granite-input-container .granite-input-top-row .granite-text-area{min-width:14.5rem;min-height:2rem;resize:both}.granite-input-container .granite-input-top-row.granite-input-disabled,.granite-input-container .granite-input-top-row.granite-input-readonly{background-color:transparent;box-shadow:none}.granite-input-container .granite-input-top-row.granite-input-invalid:not(:focus-within){outline:var(--granite-border-width-regular) solid var(--granite-color-signal-failure)}.granite-input-container .granite-input-top-row .granite-input-base{appearance:none;outline:none;border:none;background-color:var(--granite-color-background-input);padding:var(--granite-spacing-8);width:inherit;color:var(--granite-color-text);font:inherit;font-weight:var(--granite-font-weight-regular);line-height:var(--granite-line-height-regular);border-radius:var(--granite-radius-s)}.granite-input-container .granite-input-top-row .granite-input-base--with-append{border-start-end-radius:0;border-end-end-radius:0}.granite-input-container .granite-input-top-row .granite-input-base--with-prefix{border-start-start-radius:0;border-end-start-radius:0}.granite-input-container .granite-input-top-row .granite-input-base::placeholder{color:var(--granite-color-text-hint)}.granite-input-container .granite-input-top-row .granite-input-base:required.granite-input-empty{background-color:var(--granite-color-background-failure)}.granite-input-container .granite-input-top-row .granite-input-base:required::placeholder{color:var(--granite-color-text-weak)}.granite-input-container .granite-input-top-row .granite-input-base:read-only{background-color:transparent}.granite-input-container .granite-input-top-row .granite-input-base:disabled{opacity:.3}.granite-input-container .granite-input-top-row .granite-input-base:hover::placeholder{color:var(--granite-color-text)}.granite-input-container .granite-input-top-row .granite-input-base:focus{box-shadow:inset 0 .125rem var(--granite-color-focus),inset .125rem 0 var(--granite-color-focus),inset -.125rem 0 var(--granite-color-focus),inset 0 -.125rem var(--granite-color-focus)}.granite-input-container .granite-input-top-row .granite-input-base:focus.granite-input-invalid{box-shadow:inset 0 -.125rem var(--granite-color-signal-failure),inset 0 .125rem var(--granite-color-signal-failure),inset .125rem 0 var(--granite-color-signal-failure),inset -.125rem 0 var(--granite-color-signal-failure)}.granite-input-container .granite-input-top-row .granite-input-base:focus::placeholder{color:transparent}.granite-input-container .granite-input-prepend{display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;align-items:center;padding:0 var(--granite-spacing-8);background:var(--granite-color-background-input)}.granite-input-container .granite-input-prepend .granite-input-prepend-icon{width:1rem;height:1rem;color:var(--granite-color-text);box-shadow:none}.granite-input-container .granite-input-prepend.granite-input-required.granite-input-empty{background-color:var(--granite-color-background-failure)}.granite-input-container .granite-input-append{-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;border:none;background-color:var(--granite-color-background-input);position:relative;border-end-end-radius:var(--granite-radius-s);border-start-end-radius:var(--granite-radius-s)}.granite-input-container .granite-input-append:focus{box-shadow:inset 0 .125rem var(--granite-color-focus),inset .125rem 0 var(--granite-color-focus),inset -.125rem 0 var(--granite-color-focus),inset 0 -.125rem var(--granite-color-focus)}.granite-input-container .granite-input-append .granite-input-password-toggle-icon{width:max-content;height:max-content;color:var(--granite-color-text);box-shadow:none}.granite-input-container .granite-input-append.granite-input-required.granite-input-empty{background-color:var(--granite-color-background-failure)}.granite-input-container .granite-input-bottom-row{box-shadow:none}.granite-input-container .granite-input-char-count{background:var(--granite-color-background-warning);border-radius:0 0 .25rem .25rem;padding:var(--granite-spacing-8);background-size:contain;width:fit-content;box-shadow:none}.granite-input-container.granite-input-disabled,.granite-input-container.granite-input-readonly{background-color:transparent}:host ::ng-deep button[graniteInputSuffixButton]{-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;border:none;background-color:var(--granite-color-background-input);margin:0;border-radius:var(--granite-radius-s)}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: GraniteIconComponent, selector: "granite-icon", inputs: ["fontIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2903
2879
|
}
|
|
@@ -5648,5 +5624,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImpor
|
|
|
5648
5624
|
* Generated bundle index. Do not edit.
|
|
5649
5625
|
*/
|
|
5650
5626
|
|
|
5651
|
-
export { AVATAR_DEFAULT_STATUS, ButtonSelectors, CONTACT_DEFAULT_STATUS, ClientInputDesktopDirective, ClientInputTouchDirective, ClientOutputDesktopDirective, ClientOutputTouchDirective, ContactItemDefaultStatusComponent,
|
|
5627
|
+
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 };
|
|
5652
5628
|
//# sourceMappingURL=ifsworld-granite-components.mjs.map
|