@ng-doc/app
Version:
<!-- PROJECT LOGO --> <br /> <div align="center"> <a href="https://github.com/ng-doc/ng-doc"> <img src="https://ng-doc.com/assets/images/ng-doc.svg?raw=true" alt="Logo" height="150px"> </a>
64 lines (60 loc) • 3.4 kB
JavaScript
import * as i0 from '@angular/core';
import { inject, ChangeDetectorRef, ElementRef, ViewChild, Input, ChangeDetectionStrategy, Component } from '@angular/core';
import { NgDocTooltipDirective } from '@ng-doc/ui-kit';
class NgDocTooltipWrapperComponent {
constructor() {
this.changeDetectorRef = inject(ChangeDetectorRef);
this.tooltipElement = null;
}
ngAfterViewInit() {
if (this.contentProjection) {
const element = this.contentProjection.nativeElement.querySelector('[ngDocTooltip]');
this.tooltipElement = element instanceof HTMLElement ? element : null;
this.changeDetectorRef.detectChanges();
}
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgDocTooltipWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: NgDocTooltipWrapperComponent, isStandalone: true, selector: "ng-doc-tooltip-wrapper", inputs: { content: "content" }, viewQueries: [{ propertyName: "contentProjection", first: true, predicate: ["contentProjection"], descendants: true, read: ElementRef, static: true }], ngImport: i0, template: `
<div
class="content-projection"
[ngDocTooltip]="content ?? ''"
[displayOrigin]="tooltipElement ?? contentProjection"
[pointerOrigin]="tooltipElement ?? contentProjection"
#contentProjection>
<ng-content></ng-content>
</div>
`, isInline: true, styles: [".content-projection{display:unset}\n"], dependencies: [{ kind: "directive", type: NgDocTooltipDirective, selector: "[ngDocTooltip]", inputs: ["ngDocTooltip", "delay", "displayOrigin", "pointerOrigin", "positions", "canOpen", "panelClass", "minHeight", "maxHeight", "height", "minWidth", "maxWidth", "width"], outputs: ["beforeOpen", "afterOpen", "beforeClose", "afterClose"], exportAs: ["ngDocTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgDocTooltipWrapperComponent, decorators: [{
type: Component,
args: [{ selector: 'ng-doc-tooltip-wrapper', template: `
<div
class="content-projection"
[ngDocTooltip]="content ?? ''"
[displayOrigin]="tooltipElement ?? contentProjection"
[pointerOrigin]="tooltipElement ?? contentProjection"
#contentProjection>
<ng-content></ng-content>
</div>
`, changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgDocTooltipDirective], styles: [".content-projection{display:unset}\n"] }]
}], ctorParameters: () => [], propDecorators: { content: [{
type: Input
}], contentProjection: [{
type: ViewChild,
args: ['contentProjection', { read: ElementRef, static: true }]
}] } });
const tooltipProcessor = {
component: NgDocTooltipWrapperComponent,
selector: '[ngDocTooltip]',
extractOptions: (element) => ({
inputs: {
content: element.getAttribute('ngDocTooltip') ?? '',
},
content: [[element.cloneNode(true)]],
}),
};
/**
* Generated bundle index. Do not edit.
*/
export { tooltipProcessor };
//# sourceMappingURL=ng-doc-app-processors-processors-tooltip.mjs.map