@anglr/common 19.1.0-beta.20231207115247 → 19.1.0-beta.20231214113229

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/changelog.md CHANGED
@@ -1,10 +1,11 @@
1
1
  # Changelog
2
2
 
3
- ## Version 19.1.0 (2023-12-06)
3
+ ## Version 19.1.0 (2023-12-14)
4
4
 
5
5
  ### Bug Fixes
6
6
 
7
7
  - fixed `TooltipDirective` overflowing 'MouseEnter' tooltip on right side of screen
8
+ - fixed `TooltipDirective` rendering tooltip only for non empty content
8
9
  - *subpackage* `@anglr/common/material`
9
10
  - fixed `ConfirmationDialogDirective`, now correctly takes global options
10
11
 
@@ -19,6 +20,7 @@
19
20
  - `ellipsisClass` css class appliet to element
20
21
  - `allowHtml` indication whether are html tags allowed in tooltip text
21
22
  - `ellipsisTooltip` gets or sets HTML element from which is text taken for tooltip
23
+ - new `getHostElement` function, that gets host html element for component
22
24
  - updated `TooltipDirective` directive
23
25
  - is now `standalone`
24
26
  - *subpackage* `@anglr/common/material`
@@ -202,6 +202,10 @@ export class TooltipDirective {
202
202
  * @param event - Mouse event
203
203
  */
204
204
  _showTooltip(event) {
205
+ //no data for tooltip or no template
206
+ if (!this.tooltip && !this.template && !this.tooltipTemplateChild) {
207
+ return;
208
+ }
205
209
  this._createTooltip();
206
210
  //if element was not created do nothing
207
211
  if (!this._tooltipElement) {
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/tooltip/directives/tooltip/tooltip.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,YAAY,EAAE,SAAS,EAAE,UAAU,EAAmB,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAwB,QAAQ,EAAiB,WAAW,EAAE,gBAAgB,EAAC,MAAM,eAAe,CAAC;AACtN,OAAO,EAAC,gBAAgB,EAAmB,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAC,Q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,aACI,eAAe;2FAlHtC,gBAAgB,8YAwGX,wBAAwB;;2FAxG7B,gBAAgB;kBAL5B,SAAS;mBACV;oBACI,QAAQ,EAAE,WAAW;oBACrB,UAAU,EAAE,IAAI;iBACnB;;0BAiHgB,MAAM;2BAAC,QAAQ;;0BACf,MAAM;2BAAC,QAAQ;;0BACf,QAAQ;;0BAAI,MAAM;2BAAC,eAAe;yCAhExC,OAAO;sBADb,KAAK;gBAOC,SAAS;sBADf,KAAK;gBAOC,QAAQ;sBADd,KAAK;gBAOK,cAAc;sBADxB,KAAK;gBAsBC,cAAc;sBADpB,KAAK;gBASC,gBAAgB;sBADtB,KAAK;gBASC,oBAAoB;sBAD1B,YAAY;uBAAC,wBAAwB;gBAkE/B,UAAU;sBADhB,YAAY;uBAAC,YAAY,EAAE,CAAC,QAAQ,CAAC;gBA2B/B,SAAS;sBADf,YAAY;uBAAC,WAAW,EAAE,CAAC,QAAQ,CAAC","sourcesContent":["import {ComponentRef, ContentChild, Directive, ElementRef, EmbeddedViewRef, HostListener, Inject, Injector, Input, OnChanges, OnDestroy, Optional, SimpleChanges, TemplateRef, ViewContainerRef} from '@angular/core';\nimport {AnimationBuilder, AnimationFactory} from '@angular/animations';\nimport {DOCUMENT} from '@angular/common';\nimport {fadeInAnimation, fadeOutAnimation} from '@anglr/animations';\nimport {RecursivePartial, extend, isBlank, isPresent, nameof, renderToBody} from '@jscrpt/common';\nimport {lastValueFrom} from 'rxjs';\n\nimport {TooltipComponent} from '../../components/tooltip/tooltip.component';\nimport {TooltipOptions, TooltipRenderer} from '../../misc/tooltip.interface';\nimport {TOOLTIP_OPTIONS} from '../../misc/tokens';\nimport {applyPositionResult, Position, PositionPlacement} from '../../../../services/position';\nimport {TooltipTemplateDirective} from '../tooltipTemplate/tooltipTemplate.directive';\nimport {TooltipTemplateContext} from '../tooltipTemplate/tooltipTemplate.context';\nimport {POSITION} from '../../../../types/tokens';\n\n/**\n * Default options for tooltip\n */\nconst defaultOptions: TooltipOptions =\n{\n delay: 200,\n position:\n {\n offset: 'MouseEnter',\n placement: PositionPlacement.TopEnd,\n },\n allowSelection: false,\n tooltipRenderer: TooltipComponent,\n tooltipCssClass: null,\n stopPropagation: false,\n enterAnimation: fadeInAnimation,\n exitAnimation: fadeOutAnimation,\n containerElement: undefined,\n};\n\n/**\n * Directive used for rendering tooltip\n */\n@Directive(\n{\n selector: '[tooltip]',\n standalone: true,\n})\nexport class TooltipDirective<TData = any> implements OnChanges, OnDestroy\n{\n //######################### protected fields #########################\n\n /**\n * Instance of component used for rendering tooltip\n */\n protected _tooltipComponent?: ComponentRef<TooltipRenderer<TData>>;\n\n /**\n * Instance of HTML element for tooltip renderer\n */\n protected _tooltipElement?: HTMLElement;\n\n /**\n * Animation factory used for enter animation of tooltip\n */\n protected _enterAnimation: AnimationFactory;\n\n /**\n * Animation factory used for exit animation of tooltip\n */\n protected _exitAnimation: AnimationFactory;\n\n /**\n * Instance of options provided for this tooltip\n */\n protected _options: TooltipOptions;\n\n /**\n * Indication whether there is active show tooltip request\n */\n protected _showRequest: boolean = false;\n\n /**\n * Indication whether keep open tooltip component\n */\n protected _keepOpen: boolean = false;\n\n /**\n * Timeout that is used for handling mouse move\n */\n protected _timeout: number|null = null;\n\n //######################### public properties - inputs #########################\n\n /**\n * Tooltip text that is displayed, or any data that could be passed to template\n */\n @Input()\n public tooltip?: TData;\n\n /**\n * Indication whether are html tags allowed in tooltip text\n */\n @Input()\n public allowHtml: boolean = false;\n\n /**\n * Instance of tooltip template that is used for rendering\n */\n @Input()\n public template?: TemplateRef<TooltipTemplateContext<TData>>;\n\n /**\n * Options used for displaying tooltip\n */\n @Input()\n public get tooltipOptions(): RecursivePartial<TooltipOptions>\n {\n return this._options;\n }\n public set tooltipOptions(value: RecursivePartial<TooltipOptions>)\n {\n this._options = extend(true, {}, this._options, value);\n\n this._enterAnimation = this._animationsPlayer.build(this._options.enterAnimation);\n this._exitAnimation = this._animationsPlayer.build(this._options.exitAnimation);\n\n if(this._options.containerElement && !this.containerElement)\n {\n this.containerElement = this._options.containerElement;\n }\n }\n\n /**\n * Gets or sets indication whether is tooltip visible, if has boolean value, mouse events cant override this\n */\n @Input()\n public tooltipVisible?: boolean;\n\n /**\n * String that defines element in which should be tooltip rendered, if not specified, body is used\n * \n * Allows also css classes to be specified (div.body-box)\n */\n @Input()\n public containerElement: string|undefined|null;\n\n //######################### public properties - children #########################\n\n /**\n * Instance of template from element content, used for rendering\n */\n @ContentChild(TooltipTemplateDirective)\n public tooltipTemplateChild?: TooltipTemplateDirective;\n\n //######################### constructor #########################\n constructor(protected _viewContainerRef: ViewContainerRef,\n protected _injector: Injector,\n protected _element: ElementRef<HTMLElement>,\n protected _animationsPlayer: AnimationBuilder,\n @Inject(DOCUMENT) protected _document: Document,\n @Inject(POSITION) protected _position: Position,\n @Optional() @Inject(TOOLTIP_OPTIONS) options?: Partial<TooltipOptions>,)\n {\n this._options = extend(true, {}, defaultOptions, options);\n\n this._enterAnimation = this._animationsPlayer.build(this._options.enterAnimation);\n this._exitAnimation = this._animationsPlayer.build(this._options.exitAnimation);\n\n if(this._options.containerElement)\n {\n this.containerElement = this._options.containerElement;\n }\n }\n\n //######################### public methods - implementation of OnChanges #########################\n\n /**\n * Called when input value changes\n */\n public ngOnChanges(changes: SimpleChanges): void\n {\n if(nameof<TooltipDirective>('tooltipVisible') in changes)\n {\n if(this.tooltipVisible)\n {\n this._showTooltip();\n }\n else\n {\n this._hideTooltip();\n }\n }\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n\n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n if(this._timeout)\n {\n clearTimeout(this._timeout);\n }\n\n this._destroyTooltip();\n }\n\n //######################### public methods - host #########################\n\n /**\n * Handles mouse leave event, hover ends\n * @param event - Mouse event that occured\n * @internal\n */\n @HostListener('mouseleave', ['$event'])\n public mouseLeave(event: MouseEvent): void\n {\n if(this._options.stopPropagation)\n {\n event.stopPropagation();\n }\n\n if(isBlank(this.tooltipVisible))\n {\n setTimeout(() =>\n {\n if(!this._keepOpen)\n {\n this._showRequest = false;\n this._hideTooltip();\n }\n }, 10);\n }\n }\n\n /**\n * Handles mouse move event, displaying tooltip\n * @param event - Mouse event that occured\n * @internal\n */\n @HostListener('mousemove', ['$event'])\n public mouseMove(event: MouseEvent): void\n {\n if(this._options.stopPropagation)\n {\n event.stopPropagation();\n }\n\n this._showRequest = true;\n\n //do nothing if tooltip is visible\n if(this._tooltipComponent || isPresent(this.tooltipVisible))\n {\n return;\n }\n\n if(isPresent(this._timeout))\n {\n clearTimeout(this._timeout);\n }\n\n this._timeout = setTimeout(() =>\n {\n this._timeout = null;\n\n if(this._showRequest)\n {\n this._showTooltip(event);\n\n this._showRequest = false;\n }\n }, this._options.delay) as any;\n }\n\n //######################### protected methods #########################\n\n /**\n * Shows tooltip\n * @param event - Mouse event\n */\n protected _showTooltip(event?: MouseEvent): void\n {\n this._createTooltip();\n\n //if element was not created do nothing\n if(!this._tooltipElement)\n {\n return;\n }\n\n this._showData();\n\n lastValueFrom(this._position.placeElement(this._tooltipElement,\n this._element.nativeElement,\n {\n placement: this._options.position.placement,\n offset: this._options.position.offset,\n flip: true,\n mouseEvent: event,\n autoUpdate: false\n }))\n .then(result => applyPositionResult(result));\n }\n\n /**\n * Hides tooltip\n */\n protected _hideTooltip(): void\n {\n this._destroyTooltip();\n }\n\n /**\n * Destroys tooltip component\n */\n protected _destroyTooltip(): void\n {\n if(this._tooltipComponent)\n {\n const component = this._tooltipComponent;\n const element = this._tooltipElement;\n\n const exitAnimation = this._exitAnimation.create(element);\n\n exitAnimation.onDone(() =>\n {\n component.destroy();\n exitAnimation.destroy();\n });\n \n this._tooltipComponent = undefined;\n this._tooltipElement = undefined;\n\n exitAnimation.play();\n }\n }\n\n /**\n * Creates tooltip renderer component\n */\n protected _createTooltip(): void\n {\n // 0. Destroys tooltip if it exists\n this._destroyTooltip();\n\n // 1. Create a component reference from the component\n this._tooltipComponent = this._viewContainerRef\n .createComponent(this._options.tooltipRenderer,\n {\n injector: this._injector\n });\n\n // 3. Get DOM element from component\n this._tooltipElement = (this._tooltipComponent.hostView as EmbeddedViewRef<any>)\n .rootNodes[0] as HTMLElement;\n\n // 4. Append DOM element to the body\n renderToBody(this._document, this._tooltipElement, this.containerElement);\n this._enterAnimation.create(this._tooltipElement).play();\n }\n\n /**\n * Sets data to tooltip component and shows them\n */\n protected _showData(): void\n {\n if(this._tooltipComponent)\n {\n this._tooltipComponent.instance.allowHtml = this.allowHtml;\n this._tooltipComponent.instance.data = this.tooltip;\n this._tooltipComponent.instance.template = this.template ?? this.tooltipTemplateChild?.template;\n this._tooltipComponent.instance.cssClass = this._options.tooltipCssClass;\n\n this._tooltipComponent.instance.registerHoverEvents(() =>\n {\n if(this._options.allowSelection)\n {\n this._keepOpen = true;\n this._showRequest = false;\n }\n },\n () =>\n {\n setTimeout(() =>\n {\n this._keepOpen = false;\n\n if(!this._showRequest)\n {\n this._hideTooltip();\n }\n\n this._showRequest = false;\n }, 5);\n });\n\n this._tooltipComponent.instance.invalidateVisuals();\n }\n }\n\n //######################### ng language server #########################\n \n /**\n * Custom input type for `tooltip` input\n */\n public static ngAcceptInputType_tooltip: any;\n}"]}
1
+ {"version":3,"file":"tooltip.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/tooltip/directives/tooltip/tooltip.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,YAAY,EAAE,SAAS,EAAE,UAAU,EAAmB,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAwB,QAAQ,EAAiB,WAAW,EAAE,gBAAgB,EAAC,MAAM,eAAe,CAAC;AACtN,OAAO,EAAC,gBAAgB,EAAmB,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAC,eAAe,EAAE,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAmB,MAAM,EAAE,OAAO,EAAE,SAAS,E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FAlHtC,gBAAgB,8YAwGX,wBAAwB;;2FAxG7B,gBAAgB;kBAL5B,SAAS;mBACV;oBACI,QAAQ,EAAE,WAAW;oBACrB,UAAU,EAAE,IAAI;iBACnB;;0BAiHgB,MAAM;2BAAC,QAAQ;;0BACf,MAAM;2BAAC,QAAQ;;0BACf,QAAQ;;0BAAI,MAAM;2BAAC,eAAe;yCAhExC,OAAO;sBADb,KAAK;gBAOC,SAAS;sBADf,KAAK;gBAOC,QAAQ;sBADd,KAAK;gBAOK,cAAc;sBADxB,KAAK;gBAsBC,cAAc;sBADpB,KAAK;gBASC,gBAAgB;sBADtB,KAAK;gBASC,oBAAoB;sBAD1B,YAAY;uBAAC,wBAAwB;gBAkE/B,UAAU;sBADhB,YAAY;uBAAC,YAAY,EAAE,CAAC,QAAQ,CAAC;gBA2B/B,SAAS;sBADf,YAAY;uBAAC,WAAW,EAAE,CAAC,QAAQ,CAAC","sourcesContent":["import {ComponentRef, ContentChild, Directive, ElementRef, EmbeddedViewRef, HostListener, Inject, Injector, Input, OnChanges, OnDestroy, Optional, SimpleChanges, TemplateRef, ViewContainerRef} from '@angular/core';\nimport {AnimationBuilder, AnimationFactory} from '@angular/animations';\nimport {DOCUMENT} from '@angular/common';\nimport {fadeInAnimation, fadeOutAnimation} from '@anglr/animations';\nimport {RecursivePartial, extend, isBlank, isPresent, nameof, renderToBody} from '@jscrpt/common';\nimport {lastValueFrom} from 'rxjs';\n\nimport {TooltipComponent} from '../../components/tooltip/tooltip.component';\nimport {TooltipOptions, TooltipRenderer} from '../../misc/tooltip.interface';\nimport {TOOLTIP_OPTIONS} from '../../misc/tokens';\nimport {applyPositionResult, Position, PositionPlacement} from '../../../../services/position';\nimport {TooltipTemplateDirective} from '../tooltipTemplate/tooltipTemplate.directive';\nimport {TooltipTemplateContext} from '../tooltipTemplate/tooltipTemplate.context';\nimport {POSITION} from '../../../../types/tokens';\n\n/**\n * Default options for tooltip\n */\nconst defaultOptions: TooltipOptions =\n{\n delay: 200,\n position:\n {\n offset: 'MouseEnter',\n placement: PositionPlacement.TopEnd,\n },\n allowSelection: false,\n tooltipRenderer: TooltipComponent,\n tooltipCssClass: null,\n stopPropagation: false,\n enterAnimation: fadeInAnimation,\n exitAnimation: fadeOutAnimation,\n containerElement: undefined,\n};\n\n/**\n * Directive used for rendering tooltip\n */\n@Directive(\n{\n selector: '[tooltip]',\n standalone: true,\n})\nexport class TooltipDirective<TData = any> implements OnChanges, OnDestroy\n{\n //######################### protected fields #########################\n\n /**\n * Instance of component used for rendering tooltip\n */\n protected _tooltipComponent?: ComponentRef<TooltipRenderer<TData>>;\n\n /**\n * Instance of HTML element for tooltip renderer\n */\n protected _tooltipElement?: HTMLElement;\n\n /**\n * Animation factory used for enter animation of tooltip\n */\n protected _enterAnimation: AnimationFactory;\n\n /**\n * Animation factory used for exit animation of tooltip\n */\n protected _exitAnimation: AnimationFactory;\n\n /**\n * Instance of options provided for this tooltip\n */\n protected _options: TooltipOptions;\n\n /**\n * Indication whether there is active show tooltip request\n */\n protected _showRequest: boolean = false;\n\n /**\n * Indication whether keep open tooltip component\n */\n protected _keepOpen: boolean = false;\n\n /**\n * Timeout that is used for handling mouse move\n */\n protected _timeout: number|null = null;\n\n //######################### public properties - inputs #########################\n\n /**\n * Tooltip text that is displayed, or any data that could be passed to template\n */\n @Input()\n public tooltip?: TData;\n\n /**\n * Indication whether are html tags allowed in tooltip text\n */\n @Input()\n public allowHtml: boolean = false;\n\n /**\n * Instance of tooltip template that is used for rendering\n */\n @Input()\n public template?: TemplateRef<TooltipTemplateContext<TData>>;\n\n /**\n * Options used for displaying tooltip\n */\n @Input()\n public get tooltipOptions(): RecursivePartial<TooltipOptions>\n {\n return this._options;\n }\n public set tooltipOptions(value: RecursivePartial<TooltipOptions>)\n {\n this._options = extend(true, {}, this._options, value);\n\n this._enterAnimation = this._animationsPlayer.build(this._options.enterAnimation);\n this._exitAnimation = this._animationsPlayer.build(this._options.exitAnimation);\n\n if(this._options.containerElement && !this.containerElement)\n {\n this.containerElement = this._options.containerElement;\n }\n }\n\n /**\n * Gets or sets indication whether is tooltip visible, if has boolean value, mouse events cant override this\n */\n @Input()\n public tooltipVisible?: boolean;\n\n /**\n * String that defines element in which should be tooltip rendered, if not specified, body is used\n * \n * Allows also css classes to be specified (div.body-box)\n */\n @Input()\n public containerElement: string|undefined|null;\n\n //######################### public properties - children #########################\n\n /**\n * Instance of template from element content, used for rendering\n */\n @ContentChild(TooltipTemplateDirective)\n public tooltipTemplateChild?: TooltipTemplateDirective;\n\n //######################### constructor #########################\n constructor(protected _viewContainerRef: ViewContainerRef,\n protected _injector: Injector,\n protected _element: ElementRef<HTMLElement>,\n protected _animationsPlayer: AnimationBuilder,\n @Inject(DOCUMENT) protected _document: Document,\n @Inject(POSITION) protected _position: Position,\n @Optional() @Inject(TOOLTIP_OPTIONS) options?: Partial<TooltipOptions>,)\n {\n this._options = extend(true, {}, defaultOptions, options);\n\n this._enterAnimation = this._animationsPlayer.build(this._options.enterAnimation);\n this._exitAnimation = this._animationsPlayer.build(this._options.exitAnimation);\n\n if(this._options.containerElement)\n {\n this.containerElement = this._options.containerElement;\n }\n }\n\n //######################### public methods - implementation of OnChanges #########################\n\n /**\n * Called when input value changes\n */\n public ngOnChanges(changes: SimpleChanges): void\n {\n if(nameof<TooltipDirective>('tooltipVisible') in changes)\n {\n if(this.tooltipVisible)\n {\n this._showTooltip();\n }\n else\n {\n this._hideTooltip();\n }\n }\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n\n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n if(this._timeout)\n {\n clearTimeout(this._timeout);\n }\n\n this._destroyTooltip();\n }\n\n //######################### public methods - host #########################\n\n /**\n * Handles mouse leave event, hover ends\n * @param event - Mouse event that occured\n * @internal\n */\n @HostListener('mouseleave', ['$event'])\n public mouseLeave(event: MouseEvent): void\n {\n if(this._options.stopPropagation)\n {\n event.stopPropagation();\n }\n\n if(isBlank(this.tooltipVisible))\n {\n setTimeout(() =>\n {\n if(!this._keepOpen)\n {\n this._showRequest = false;\n this._hideTooltip();\n }\n }, 10);\n }\n }\n\n /**\n * Handles mouse move event, displaying tooltip\n * @param event - Mouse event that occured\n * @internal\n */\n @HostListener('mousemove', ['$event'])\n public mouseMove(event: MouseEvent): void\n {\n if(this._options.stopPropagation)\n {\n event.stopPropagation();\n }\n\n this._showRequest = true;\n\n //do nothing if tooltip is visible\n if(this._tooltipComponent || isPresent(this.tooltipVisible))\n {\n return;\n }\n\n if(isPresent(this._timeout))\n {\n clearTimeout(this._timeout);\n }\n\n this._timeout = setTimeout(() =>\n {\n this._timeout = null;\n\n if(this._showRequest)\n {\n this._showTooltip(event);\n\n this._showRequest = false;\n }\n }, this._options.delay) as any;\n }\n\n //######################### protected methods #########################\n\n /**\n * Shows tooltip\n * @param event - Mouse event\n */\n protected _showTooltip(event?: MouseEvent): void\n {\n //no data for tooltip or no template\n if(!this.tooltip && !this.template && !this.tooltipTemplateChild)\n {\n return;\n }\n\n this._createTooltip();\n\n //if element was not created do nothing\n if(!this._tooltipElement)\n {\n return;\n }\n\n this._showData();\n\n lastValueFrom(this._position.placeElement(this._tooltipElement,\n this._element.nativeElement,\n {\n placement: this._options.position.placement,\n offset: this._options.position.offset,\n flip: true,\n mouseEvent: event,\n autoUpdate: false\n }))\n .then(result => applyPositionResult(result));\n }\n\n /**\n * Hides tooltip\n */\n protected _hideTooltip(): void\n {\n this._destroyTooltip();\n }\n\n /**\n * Destroys tooltip component\n */\n protected _destroyTooltip(): void\n {\n if(this._tooltipComponent)\n {\n const component = this._tooltipComponent;\n const element = this._tooltipElement;\n\n const exitAnimation = this._exitAnimation.create(element);\n\n exitAnimation.onDone(() =>\n {\n component.destroy();\n exitAnimation.destroy();\n });\n \n this._tooltipComponent = undefined;\n this._tooltipElement = undefined;\n\n exitAnimation.play();\n }\n }\n\n /**\n * Creates tooltip renderer component\n */\n protected _createTooltip(): void\n {\n // 0. Destroys tooltip if it exists\n this._destroyTooltip();\n\n // 1. Create a component reference from the component\n this._tooltipComponent = this._viewContainerRef\n .createComponent(this._options.tooltipRenderer,\n {\n injector: this._injector\n });\n\n // 3. Get DOM element from component\n this._tooltipElement = (this._tooltipComponent.hostView as EmbeddedViewRef<any>)\n .rootNodes[0] as HTMLElement;\n\n // 4. Append DOM element to the body\n renderToBody(this._document, this._tooltipElement, this.containerElement);\n this._enterAnimation.create(this._tooltipElement).play();\n }\n\n /**\n * Sets data to tooltip component and shows them\n */\n protected _showData(): void\n {\n if(this._tooltipComponent)\n {\n this._tooltipComponent.instance.allowHtml = this.allowHtml;\n this._tooltipComponent.instance.data = this.tooltip;\n this._tooltipComponent.instance.template = this.template ?? this.tooltipTemplateChild?.template;\n this._tooltipComponent.instance.cssClass = this._options.tooltipCssClass;\n\n this._tooltipComponent.instance.registerHoverEvents(() =>\n {\n if(this._options.allowSelection)\n {\n this._keepOpen = true;\n this._showRequest = false;\n }\n },\n () =>\n {\n setTimeout(() =>\n {\n this._keepOpen = false;\n\n if(!this._showRequest)\n {\n this._hideTooltip();\n }\n\n this._showRequest = false;\n }, 5);\n });\n\n this._tooltipComponent.instance.invalidateVisuals();\n }\n }\n\n //######################### ng language server #########################\n \n /**\n * Custom input type for `tooltip` input\n */\n public static ngAcceptInputType_tooltip: any;\n}"]}
@@ -70,4 +70,11 @@ export function runWhenModuleStable(moduleRefPromise, callback, angularProfiler)
70
70
  });
71
71
  });
72
72
  }
73
+ /**
74
+ * Gets host html element for component
75
+ * @param component - Component ref of dynamically created component
76
+ */
77
+ export function getHostElement(component) {
78
+ return component?.hostView?.rootNodes?.[0];
79
+ }
73
80
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,cAAc,EAAE,cAAc,EAAC,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAC,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EA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C;AACP,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,gBAA+C,EAAE,QAAmD,EAAE,eAAyB;IAE/J,eAAe,GAAG,eAAe,IAAI,KAAK,CAAC;IAE3C,gBAAgB,CAAC,IAAI,CAAC,CAAC,SAA+B,EAAE,EAAE;QAEtD,MAAM,MAAM,GAAmB,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAEtE,MAAM,CAAC,QAAQ;aACV,IAAI,CAAC,MAAM,CAAC,CAAC,QAAiB,EAAE,EAAE,CAAC,QAAQ,CAAC,EACvC,KAAK,EAAE,CAAC;aACb,SAAS,CAAC,GAAG,EAAE;YAEZ,MAAM,gBAAgB,GAAG,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YAE5D,IAAG,eAAe,EAClB;gBACI,gBAAgB,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;aAC1C;YAED,QAAQ,CAAC,SAAS,CAAC,CAAC;YAEpB,IAAG,gBAAgB,EACnB;gBACI,MAAM,eAAe,GAAG,uBAAuB,CAAC,gBAAgB,CAAC,CAAC;gBAElE,eAAe,EAAE,CAAC;aACrB;QACL,CAAC,CAAC,CAAC;IACX,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import {NgModuleRef, ApplicationRef, InjectionToken} from '@angular/core';\nimport {enableDebugTools} from '@angular/platform-browser';\nimport {Action1} from '@jscrpt/common';\nimport {filter, first} from 'rxjs';\n\n/**\n * Method used for extraction of resolve method for promise\n * @param appStablePromise - Promise which contains resolve method that is going to be extracted\n */\nexport function extractAppStableResolve(appStablePromise: Promise<void>): () => void\n{\n return (appStablePromise as any).__resolve;\n}\n\n/**\n * Factory used for creating APP_STABLE promise\n * \n * @internal\n */\nexport function appStablePromiseFactory(): Promise<void>\n{\n let appStableResolve;\n const appStablePromise = new Promise<void>(resolve => appStableResolve = resolve);\n\n (appStablePromise as any).__resolve = appStableResolve;\n\n return appStablePromise;\n}\n\n/**\n * Injection token used for obtaining promise that is resolved when application is first time stable\n */\nexport const APP_STABLE: InjectionToken<Promise<void>> = new InjectionToken<Promise<void>>('APP_STABLE', {providedIn: 'root', factory: appStablePromiseFactory});\n\n/**\n * Runs callback function when angular app is bootstrapped and stable\n * @param appRefPromise -Promise for application reference that was bootstrapped\n * @param callback -Callback that is called when app is stable\n * @param angularProfiler - Indication that angular profiler should be enabled\n */\nexport function runWhenAppStable(appRefPromise: Promise<ApplicationRef>, callback: Action1<ApplicationRef>, angularProfiler?: boolean): void\n{\n angularProfiler = angularProfiler ?? false;\n\n appRefPromise.then(appRef => \n {\n appRef.isStable\n .pipe(filter(isStable => isStable),\n first())\n .subscribe(() => \n {\n const appStablePromise = appRef.injector.get(APP_STABLE);\n\n if(angularProfiler)\n {\n enableDebugTools(appRef.components[0]);\n }\n\n callback(appRef);\n\n const resolveAsStable = extractAppStableResolve(appStablePromise);\n resolveAsStable();\n });\n });\n}\n\n/**\n * Runs callback function when angular module is bootstrapped and stable\n * @param moduleRefPromise - Promise for module that was bootstrapped\n * @param callback - Callback that is called\n * @param angularProfiler - Indication that angular profiler should be enabled\n */\nexport function runWhenModuleStable(moduleRefPromise: Promise<NgModuleRef<unknown>>, callback: (moduleRef: NgModuleRef<unknown>) => void, angularProfiler?: boolean): void\n{\n angularProfiler = angularProfiler || false;\n\n moduleRefPromise.then((moduleRef: NgModuleRef<unknown>) => \n {\n const appRef: ApplicationRef = moduleRef.injector.get(ApplicationRef);\n\n appRef.isStable\n .pipe(filter((isStable: boolean) => isStable),\n first())\n .subscribe(() => \n {\n const appStablePromise = moduleRef.injector.get(APP_STABLE);\n\n if(angularProfiler)\n {\n enableDebugTools(appRef.components[0]);\n }\n\n callback(moduleRef);\n\n if(appStablePromise)\n {\n const resolveAsStable = extractAppStableResolve(appStablePromise);\n\n resolveAsStable();\n }\n });\n });\n}"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":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,QAAQ,CAAC,MAAM,CAAC,CAAC;YAEjB,MAAM,eAAe,GAAG,uBAAuB,CAAC,gBAAgB,CAAC,CAAC;YAClE,eAAe,EAAE,CAAC;QACtB,CAAC,CAAC,CAAC;IACX,CAAC,CAAC,CAAC;AACP,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,gBAA+C,EAAE,QAAmD,EAAE,eAAyB;IAE/J,eAAe,GAAG,eAAe,IAAI,KAAK,CAAC;IAE3C,gBAAgB,CAAC,IAAI,CAAC,CAAC,SAA+B,EAAE,EAAE;QAEtD,MAAM,MAAM,GAAmB,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAEtE,MAAM,CAAC,QAAQ;aACV,IAAI,CAAC,MAAM,CAAC,CAAC,QAAiB,EAAE,EAAE,CAAC,QAAQ,CAAC,EACvC,KAAK,EAAE,CAAC;aACb,SAAS,CAAC,GAAG,EAAE;YAEZ,MAAM,gBAAgB,GAAG,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YAE5D,IAAG,eAAe,EAClB;gBACI,gBAAgB,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;aAC1C;YAED,QAAQ,CAAC,SAAS,CAAC,CAAC;YAEpB,IAAG,gBAAgB,EACnB;gBACI,MAAM,eAAe,GAAG,uBAAuB,CAAC,gBAAgB,CAAC,CAAC;gBAElE,eAAe,EAAE,CAAC;aACrB;QACL,CAAC,CAAC,CAAC;IACX,CAAC,CAAC,CAAC;AACP,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAQ,SAA6C;IAE/E,OAAQ,SAAS,EAAE,QAAqC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;AAC7E,CAAC","sourcesContent":["import {NgModuleRef, ApplicationRef, InjectionToken, ComponentRef, EmbeddedViewRef} from '@angular/core';\nimport {enableDebugTools} from '@angular/platform-browser';\nimport {Action1} from '@jscrpt/common';\nimport {filter, first} from 'rxjs';\n\n/**\n * Method used for extraction of resolve method for promise\n * @param appStablePromise - Promise which contains resolve method that is going to be extracted\n */\nexport function extractAppStableResolve(appStablePromise: Promise<void>): () => void\n{\n return (appStablePromise as any).__resolve;\n}\n\n/**\n * Factory used for creating APP_STABLE promise\n * \n * @internal\n */\nexport function appStablePromiseFactory(): Promise<void>\n{\n let appStableResolve;\n const appStablePromise = new Promise<void>(resolve => appStableResolve = resolve);\n\n (appStablePromise as any).__resolve = appStableResolve;\n\n return appStablePromise;\n}\n\n/**\n * Injection token used for obtaining promise that is resolved when application is first time stable\n */\nexport const APP_STABLE: InjectionToken<Promise<void>> = new InjectionToken<Promise<void>>('APP_STABLE', {providedIn: 'root', factory: appStablePromiseFactory});\n\n/**\n * Runs callback function when angular app is bootstrapped and stable\n * @param appRefPromise -Promise for application reference that was bootstrapped\n * @param callback -Callback that is called when app is stable\n * @param angularProfiler - Indication that angular profiler should be enabled\n */\nexport function runWhenAppStable(appRefPromise: Promise<ApplicationRef>, callback: Action1<ApplicationRef>, angularProfiler?: boolean): void\n{\n angularProfiler = angularProfiler ?? false;\n\n appRefPromise.then(appRef => \n {\n appRef.isStable\n .pipe(filter(isStable => isStable),\n first())\n .subscribe(() => \n {\n const appStablePromise = appRef.injector.get(APP_STABLE);\n\n if(angularProfiler)\n {\n enableDebugTools(appRef.components[0]);\n }\n\n callback(appRef);\n\n const resolveAsStable = extractAppStableResolve(appStablePromise);\n resolveAsStable();\n });\n });\n}\n\n/**\n * Runs callback function when angular module is bootstrapped and stable\n * @param moduleRefPromise - Promise for module that was bootstrapped\n * @param callback - Callback that is called\n * @param angularProfiler - Indication that angular profiler should be enabled\n */\nexport function runWhenModuleStable(moduleRefPromise: Promise<NgModuleRef<unknown>>, callback: (moduleRef: NgModuleRef<unknown>) => void, angularProfiler?: boolean): void\n{\n angularProfiler = angularProfiler || false;\n\n moduleRefPromise.then((moduleRef: NgModuleRef<unknown>) => \n {\n const appRef: ApplicationRef = moduleRef.injector.get(ApplicationRef);\n\n appRef.isStable\n .pipe(filter((isStable: boolean) => isStable),\n first())\n .subscribe(() => \n {\n const appStablePromise = moduleRef.injector.get(APP_STABLE);\n\n if(angularProfiler)\n {\n enableDebugTools(appRef.components[0]);\n }\n\n callback(moduleRef);\n\n if(appStablePromise)\n {\n const resolveAsStable = extractAppStableResolve(appStablePromise);\n\n resolveAsStable();\n }\n });\n });\n}\n\n/**\n * Gets host html element for component\n * @param component - Component ref of dynamically created component\n */\nexport function getHostElement<TType>(component: ComponentRef<TType>|undefined|null): HTMLElement|undefined|null\n{\n return (component?.hostView as EmbeddedViewRef<unknown>)?.rootNodes?.[0];\n}"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anglr/common",
3
- "version": "19.1.0-beta.20231207115247",
3
+ "version": "19.1.0-beta.20231214113229",
4
4
  "description": "Angular module for common angular stuff",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.directive.d.ts","sourceRoot":"","sources":["tooltip.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAA2B,UAAU,EAAyC,QAAQ,EAAS,SAAS,EAAE,SAAS,EAAY,aAAa,EAAE,WAAW,EAAE,gBAAgB,EAAC,MAAM,eAAe,CAAC;AACtN,OAAO,EAAC,gBAAgB,EAAE,gBAAgB,EAAC,MAAM,qBAAqB,CAAC;AAGvE,OAAO,EAAC,gBAAgB,EAAmD,MAAM,gBAAgB,CAAC;AAIlG,OAAO,EAAC,cAAc,EAAE,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAE7E,OAAO,EAAsB,QAAQ,EAAoB,MAAM,+BAA+B,CAAC;AAC/F,OAAO,EAAC,wBAAwB,EAAC,MAAM,8CAA8C,CAAC;AACtF,OAAO,EAAC,sBAAsB,EAAC,MAAM,4CAA4C,CAAC;;AAuBlF;;GAEG;AACH,qBAKa,gBAAgB,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 +1,4 @@
1
- import { NgModuleRef, ApplicationRef, InjectionToken } from '@angular/core';
1
+ import { NgModuleRef, ApplicationRef, InjectionToken, ComponentRef } from '@angular/core';
2
2
  import { Action1 } from '@jscrpt/common';
3
3
  /**
4
4
  * Method used for extraction of resolve method for promise
@@ -29,4 +29,9 @@ export declare function runWhenAppStable(appRefPromise: Promise<ApplicationRef>,
29
29
  * @param angularProfiler - Indication that angular profiler should be enabled
30
30
  */
31
31
  export declare function runWhenModuleStable(moduleRefPromise: Promise<NgModuleRef<unknown>>, callback: (moduleRef: NgModuleRef<unknown>) => void, angularProfiler?: boolean): void;
32
+ /**
33
+ * Gets host html element for component
34
+ * @param component - Component ref of dynamically created component
35
+ */
36
+ export declare function getHostElement<TType>(component: ComponentRef<TType> | undefined | null): HTMLElement | undefined | null;
32
37
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAE,cAAc,EAAE,cAAc,EAAC,MAAM,eAAe,CAAC;AAE1E,OAAO,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAGvC;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,gBAAgB,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,IAAI,CAGnF;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC,CAQvD;AAED;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,CAA2G,CAAC;AAEjK;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,OAAO,CAAC,cAAc,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,cAAc,CAAC,EAAE,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI,CAwB3I;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,gBAAgB,EA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