UNPKG

igniteui-angular-charts

Version:

Ignite UI Angular charting components for building rich data visualizations for modern web apps.

150 lines (147 loc) 6.3 kB
import { EventEmitter, Output, Component, forwardRef, Input, ChangeDetectionStrategy } from '@angular/core'; import { delegateCombine } from "igniteui-angular-core"; import { IgxSeriesComponent } from "./igx-series-component"; import { IgxUserAnnotationToolTipContentUpdatingEventArgs } from "./igx-user-annotation-tool-tip-content-updating-event-args"; import { IgxAnnotationLayerComponent } from "./igx-annotation-layer-component"; import { UserAnnotationToolTipLayer } from "./UserAnnotationToolTipLayer"; import { ensureBool } from "igniteui-angular-core"; import * as i0 from "@angular/core"; /** * Represents an annotation layer that displays tooltips for all target series individually. */ export class IgxUserAnnotationToolTipLayerComponent extends IgxAnnotationLayerComponent { createImplementation() { return new UserAnnotationToolTipLayer(); } /** * @hidden */ get i() { return this._implementation; } constructor() { super(); this._contentUpdating = null; } /** * Gets whether the series is an annotation layer displayed only when hovering over the chart. */ get isAnnotationHoverLayer() { return this.i.eu; } /** * Gets or sets the name of the series series to target this annotation to. If null, this annotation targets all series simultaneously. */ get targetSeriesName() { return this.i.abj; } set targetSeriesName(v) { this.i.abj = v; } /** * Gets or sets the series to target this annotation to. If null, this annotation targets all series simultaneously. */ get targetSeries() { const r = this.i.aa4; if (r == null) { return null; } if (!r.externalObject) { let e = IgxSeriesComponent._createFromInternal(r); if (e) { e._implementation = r; } Object.defineProperty(r, 'externalObject', { value: e, enumerable: false, configurable: true, writable: true }); } return r.externalObject; } set targetSeries(v) { if (v != null && this._stylingContainer && v._styling) v._styling(this._stylingContainer, this, this); v == null ? this.i.aa4 = null : this.i.aa4 = v.i; } /** * Gets or sets whether to skip past unknown values when searching for series values. */ get skipUnknownValues() { return this.i.abe; } set skipUnknownValues(v) { this.i.abe = ensureBool(v); } get isUserAnnotationToolTipLayer() { return this.i.gb; } get isToolTipLayer() { return this.i.f8; } findByName(name) { var baseResult = super.findByName(name); if (baseResult) { return baseResult; } if (this.targetSeries && this.targetSeries.name && this.targetSeries.name == name) { return this.targetSeries; } return null; } _styling(container, component, parent) { super._styling(container, component, parent); this._inStyling = true; if (this.targetSeries && this.targetSeries._styling) { this.targetSeries._styling(container, component, this); } this._inStyling = false; } /** * Hides any tooltips presented by the layer, if any. */ hideToolTips() { this.i.qn(); } /** * Hides any tooltips presented by the layer, if any. */ hideToolTipsImmediate() { this.i.qo(); } /** * Called when the content is being created or updated. */ get contentUpdating() { if (this._contentUpdating == null) { this._contentUpdating = new EventEmitter(); this.i.contentUpdating = delegateCombine(this.i.contentUpdating, (o, e) => { let outerArgs = new IgxUserAnnotationToolTipContentUpdatingEventArgs(); outerArgs._provideImplementation(e); if (this.beforeContentUpdating) { this.beforeContentUpdating(this, outerArgs); } this._contentUpdating.emit({ sender: this, args: outerArgs }); }); } return this._contentUpdating; } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0-rc.1", ngImport: i0, type: IgxUserAnnotationToolTipLayerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); } static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.0-rc.1", type: IgxUserAnnotationToolTipLayerComponent, isStandalone: true, selector: "igx-user-annotation-tool-tip-layer", inputs: { targetSeriesName: "targetSeriesName", targetSeries: "targetSeries", skipUnknownValues: "skipUnknownValues" }, outputs: { contentUpdating: "contentUpdating" }, providers: [{ provide: IgxAnnotationLayerComponent, useExisting: forwardRef(() => IgxUserAnnotationToolTipLayerComponent) }, { provide: IgxSeriesComponent, useExisting: forwardRef(() => IgxUserAnnotationToolTipLayerComponent) }], usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0-rc.1", ngImport: i0, type: IgxUserAnnotationToolTipLayerComponent, decorators: [{ type: Component, args: [{ selector: 'igx-user-annotation-tool-tip-layer', template: ``, providers: [{ provide: IgxAnnotationLayerComponent, useExisting: forwardRef(() => IgxUserAnnotationToolTipLayerComponent) }, { provide: IgxSeriesComponent, useExisting: forwardRef(() => IgxUserAnnotationToolTipLayerComponent) }], changeDetection: ChangeDetectionStrategy.OnPush }] }], ctorParameters: () => [], propDecorators: { targetSeriesName: [{ type: Input }], targetSeries: [{ type: Input }], skipUnknownValues: [{ type: Input }], contentUpdating: [{ type: Output }] } });