igniteui-webcomponents-charts
Version:
Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.
244 lines (241 loc) • 9.13 kB
JavaScript
import { __extends } from "tslib";
import { IgcSeriesComponent } from "./igc-series-component";
import { IgcAnnotationLayerComponent } from "./igc-annotation-layer-component";
import { ItemToolTipLayer } from "./ItemToolTipLayer";
import { getAllPropertyNames, toSpinal, ensureBool, brushToString, stringToBrush } from "igniteui-webcomponents-core";
import { RegisterElementHelper } from "igniteui-webcomponents-core";
/**
* Represents an annotation layer that displays tooltips for all target series individually.
*/
export var IgcItemToolTipLayerComponent = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgcItemToolTipLayerComponent, _super);
function IgcItemToolTipLayerComponent() {
return _super.call(this) || this;
}
IgcItemToolTipLayerComponent.prototype.createImplementation = function () {
return new ItemToolTipLayer();
};
Object.defineProperty(IgcItemToolTipLayerComponent.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
IgcItemToolTipLayerComponent.prototype.connectedCallback = function () {
if (_super.prototype["connectedCallback"]) {
_super.prototype["connectedCallback"].call(this);
}
if (this.i.connectedCallback) {
this.i.connectedCallback();
}
if (!this._attached) {
this._attached = true;
this._flushQueuedAttributes();
}
};
IgcItemToolTipLayerComponent.prototype.disconnectedCallback = function () {
if (_super.prototype["disconnectedCallback"]) {
_super.prototype["disconnectedCallback"].call(this);
}
if (this.i.disconnectedCallback) {
this.i.disconnectedCallback();
}
if (this._attached) {
this._attached = false;
}
};
Object.defineProperty(IgcItemToolTipLayerComponent, "observedAttributes", {
get: function () {
if (IgcItemToolTipLayerComponent._observedAttributesIgcItemToolTipLayerComponent == null) {
var names = getAllPropertyNames(IgcItemToolTipLayerComponent);
for (var i = 0; i < names.length; i++) {
names[i] = toSpinal(names[i]);
}
IgcItemToolTipLayerComponent._observedAttributesIgcItemToolTipLayerComponent = names;
}
return IgcItemToolTipLayerComponent._observedAttributesIgcItemToolTipLayerComponent;
},
enumerable: false,
configurable: true
});
IgcItemToolTipLayerComponent.register = function () {
if (!IgcItemToolTipLayerComponent._isElementRegistered) {
IgcItemToolTipLayerComponent._isElementRegistered = true;
RegisterElementHelper.registerElement(IgcItemToolTipLayerComponent.htmlTagName, IgcItemToolTipLayerComponent);
}
};
Object.defineProperty(IgcItemToolTipLayerComponent.prototype, "isAnnotationHoverLayer", {
/**
* Gets whether the series is an annotation layer displayed only when hovering over the chart.
*/
get: function () {
return this.i.eu;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcItemToolTipLayerComponent.prototype, "isToolTipLayer", {
get: function () {
return this.i.f7;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcItemToolTipLayerComponent.prototype, "isDefaultTooltipBehaviorDisabled", {
/**
* Gets whether the default tooltip behaviors for the chart are disabled if this layer is present.
*/
get: function () {
return this.i.e5;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcItemToolTipLayerComponent.prototype, "targetSeriesName", {
/**
* Gets or sets the name of the series series to target this annotation to. If null, this annotation targets all series simultaneously.
*/
get: function () {
return this.i.aa0;
},
set: function (v) {
this.i.aa0 = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcItemToolTipLayerComponent.prototype, "targetSeries", {
/**
* Gets or sets the series to target this annotation to. If null, this annotation targets all series simultaneously.
*/
get: function () {
var r = this.i.aat;
if (r == null) {
return null;
}
if (!r.externalObject) {
var e = IgcSeriesComponent._createFromInternal(r);
if (e) {
e._implementation = r;
}
r.externalObject = e;
}
return r.externalObject;
},
set: function (v) {
if (v != null && this._stylingContainer && v._styling)
v._styling(this._stylingContainer, this, this);
v == null ? this.i.aat = null : this.i.aat = v.i;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcItemToolTipLayerComponent.prototype, "useInterpolation", {
/**
* Gets or sets whether to use value interpolation when drawing the tooltips.
*/
get: function () {
return this.i.aaw;
},
set: function (v) {
this.i.aaw = ensureBool(v);
this._a("useInterpolation", this.i.aaw);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcItemToolTipLayerComponent.prototype, "skipUnknownValues", {
/**
* Gets or sets whether to skip past unknown values when searching for series values.
*/
get: function () {
return this.i.aav;
},
set: function (v) {
this.i.aav = ensureBool(v);
this._a("skipUnknownValues", this.i.aav);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcItemToolTipLayerComponent.prototype, "toolTipBackground", {
/**
* Gets or sets the background of the tooltip containers.
*/
get: function () {
return brushToString(this.i.abg);
},
set: function (v) {
this.i.abg = stringToBrush(v);
this._a("toolTipBackground", brushToString(this.i.abg));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcItemToolTipLayerComponent.prototype, "toolTipBorderBrush", {
/**
* Gets or sets the border color of the tooltip containers.
*/
get: function () {
return brushToString(this.i.abh);
},
set: function (v) {
this.i.abh = stringToBrush(v);
this._a("toolTipBorderBrush", brushToString(this.i.abh));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcItemToolTipLayerComponent.prototype, "toolTipBorderThickness", {
/**
* Gets or sets the border thickness of the tooltip containers.
*/
get: function () {
return this.i.aax;
},
set: function (v) {
this.i.aax = +v;
this._a("toolTipBorderThickness", this.i.aax);
},
enumerable: false,
configurable: true
});
IgcItemToolTipLayerComponent.prototype.findByName = function (name) {
var baseResult = _super.prototype.findByName.call(this, name);
if (baseResult) {
return baseResult;
}
if (this.targetSeries && this.targetSeries.name && this.targetSeries.name == name) {
return this.targetSeries;
}
return null;
};
IgcItemToolTipLayerComponent.prototype._styling = function (container, component, parent) {
_super.prototype._styling.call(this, 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.
*/
IgcItemToolTipLayerComponent.prototype.hideToolTips = function () {
this.i.ql();
};
/**
* Hides any tooltips presented by the layer, if any.
*/
IgcItemToolTipLayerComponent.prototype.hideToolTipsImmediate = function () {
this.i.qm();
};
IgcItemToolTipLayerComponent._observedAttributesIgcItemToolTipLayerComponent = null;
IgcItemToolTipLayerComponent.htmlTagName = "igc-item-tool-tip-layer";
IgcItemToolTipLayerComponent._isElementRegistered = false;
return IgcItemToolTipLayerComponent;
}(IgcAnnotationLayerComponent));