UNPKG

igniteui-webcomponents-charts

Version:

Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.

163 lines (160 loc) 6.02 kB
import { IgcSeriesComponent } from "./igc-series-component"; import { IgcAnnotationLayerComponent } from "./igc-annotation-layer-component"; import { ItemToolTipLayer } from "./ItemToolTipLayer"; import { getAllPropertyNames, toSpinal, ensureBool } from "igniteui-webcomponents-core"; import { RegisterElementHelper } from "igniteui-webcomponents-core"; /** * Represents an annotation layer that displays tooltips for all target series individually. */ export let IgcItemToolTipLayerComponent = /*@__PURE__*/ (() => { class IgcItemToolTipLayerComponent extends IgcAnnotationLayerComponent { createImplementation() { return new ItemToolTipLayer(); } /** * @hidden */ get i() { return this._implementation; } constructor() { super(); } connectedCallback() { if (super["connectedCallback"]) { super["connectedCallback"](); } if (this.i.connectedCallback) { this.i.connectedCallback(); } if (!this._attached) { this._attached = true; this._flushQueuedAttributes(); } } disconnectedCallback() { if (super["disconnectedCallback"]) { super["disconnectedCallback"](); } if (this.i.disconnectedCallback) { this.i.disconnectedCallback(); } if (this._attached) { this._attached = false; } } static get observedAttributes() { if (IgcItemToolTipLayerComponent._observedAttributesIgcItemToolTipLayerComponent == null) { let names = getAllPropertyNames(IgcItemToolTipLayerComponent); for (let i = 0; i < names.length; i++) { names[i] = toSpinal(names[i]); } IgcItemToolTipLayerComponent._observedAttributesIgcItemToolTipLayerComponent = names; } return IgcItemToolTipLayerComponent._observedAttributesIgcItemToolTipLayerComponent; } static register() { if (!IgcItemToolTipLayerComponent._isElementRegistered) { IgcItemToolTipLayerComponent._isElementRegistered = true; RegisterElementHelper.registerElement(IgcItemToolTipLayerComponent.htmlTagName, IgcItemToolTipLayerComponent); } } /** * Gets whether the series is an annotation layer displayed only when hovering over the chart. */ get isAnnotationHoverLayer() { return this.i.et; } /** * Gets whether the default tooltip behaviors for the chart are disabled if this layer is present. */ get isDefaultTooltipBehaviorDisabled() { return this.i.e4; } /** * 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.aah; } set targetSeriesName(v) { this.i.aah = 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.aab; if (r == null) { return null; } if (!r.externalObject) { let e = IgcSeriesComponent._createFromInternal(r); if (e) { e._implementation = r; } r.externalObject = e; } return r.externalObject; } set targetSeries(v) { if (v != null && this._stylingContainer && v._styling) v._styling(this._stylingContainer, this, this); v == null ? this.i.aab = null : this.i.aab = v.i; } /** * Gets or sets whether to use value interpolation when drawing the tooltips. */ get useInterpolation() { return this.i.aae; } set useInterpolation(v) { this.i.aae = ensureBool(v); this._a("useInterpolation", this.i.aae); } /** * Gets or sets whether to skip past unknown values when searching for series values. */ get skipUnknownValues() { return this.i.aad; } set skipUnknownValues(v) { this.i.aad = ensureBool(v); this._a("skipUnknownValues", this.i.aad); } 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.p9(); } /** * Hides any tooltips presented by the layer, if any. */ hideToolTipsImmediate() { this.i.qa(); } } IgcItemToolTipLayerComponent._observedAttributesIgcItemToolTipLayerComponent = null; IgcItemToolTipLayerComponent.htmlTagName = "igc-item-tool-tip-layer"; IgcItemToolTipLayerComponent._isElementRegistered = false; return IgcItemToolTipLayerComponent; })();