igniteui-angular-charts
Version:
Ignite UI Angular charting components for building rich data visualizations for modern web apps.
188 lines (185 loc) • 8.57 kB
JavaScript
import { __extends } from "tslib";
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.
*/
var IgxUserAnnotationToolTipLayerComponent = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgxUserAnnotationToolTipLayerComponent, _super);
function IgxUserAnnotationToolTipLayerComponent() {
var _this = _super.call(this) || this;
_this._contentUpdating = null;
return _this;
}
IgxUserAnnotationToolTipLayerComponent.prototype.createImplementation = function () {
return new UserAnnotationToolTipLayer();
};
Object.defineProperty(IgxUserAnnotationToolTipLayerComponent.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxUserAnnotationToolTipLayerComponent.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(IgxUserAnnotationToolTipLayerComponent.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.abh;
},
set: function (v) {
this.i.abh = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxUserAnnotationToolTipLayerComponent.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.aa2;
if (r == null) {
return null;
}
if (!r.externalObject) {
var e = IgxSeriesComponent._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.aa2 = null : this.i.aa2 = v.i;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxUserAnnotationToolTipLayerComponent.prototype, "skipUnknownValues", {
/**
* Gets or sets whether to skip past unknown values when searching for series values.
*/
get: function () {
return this.i.abc;
},
set: function (v) {
this.i.abc = ensureBool(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxUserAnnotationToolTipLayerComponent.prototype, "isUserAnnotationToolTipLayer", {
get: function () {
return this.i.ga;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxUserAnnotationToolTipLayerComponent.prototype, "isToolTipLayer", {
get: function () {
return this.i.f7;
},
enumerable: false,
configurable: true
});
IgxUserAnnotationToolTipLayerComponent.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;
};
IgxUserAnnotationToolTipLayerComponent.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.
*/
IgxUserAnnotationToolTipLayerComponent.prototype.hideToolTips = function () {
this.i.ql();
};
/**
* Hides any tooltips presented by the layer, if any.
*/
IgxUserAnnotationToolTipLayerComponent.prototype.hideToolTipsImmediate = function () {
this.i.qm();
};
Object.defineProperty(IgxUserAnnotationToolTipLayerComponent.prototype, "contentUpdating", {
/**
* Called when the content is being created or updated.
*/
get: function () {
var _this = this;
if (this._contentUpdating == null) {
this._contentUpdating = new EventEmitter();
this.i.contentUpdating = delegateCombine(this.i.contentUpdating, function (o, e) {
var outerArgs = new IgxUserAnnotationToolTipContentUpdatingEventArgs();
outerArgs._provideImplementation(e);
if (_this.beforeContentUpdating) {
_this.beforeContentUpdating(_this, outerArgs);
}
_this._contentUpdating.emit({
sender: _this,
args: outerArgs
});
});
}
return this._contentUpdating;
},
enumerable: false,
configurable: true
});
IgxUserAnnotationToolTipLayerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxUserAnnotationToolTipLayerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
IgxUserAnnotationToolTipLayerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: IgxUserAnnotationToolTipLayerComponent, selector: "igx-user-annotation-tool-tip-layer", inputs: { targetSeriesName: "targetSeriesName", targetSeries: "targetSeries", skipUnknownValues: "skipUnknownValues" }, outputs: { contentUpdating: "contentUpdating" }, providers: [{ provide: IgxAnnotationLayerComponent, useExisting: forwardRef(function () { return IgxUserAnnotationToolTipLayerComponent; }) }, { provide: IgxSeriesComponent, useExisting: forwardRef(function () { return IgxUserAnnotationToolTipLayerComponent; }) }], usesInheritance: true, ngImport: i0, template: "", isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
return IgxUserAnnotationToolTipLayerComponent;
}(IgxAnnotationLayerComponent));
export { IgxUserAnnotationToolTipLayerComponent };
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxUserAnnotationToolTipLayerComponent, decorators: [{
type: Component,
args: [{
selector: 'igx-user-annotation-tool-tip-layer',
template: "",
providers: [{ provide: IgxAnnotationLayerComponent, useExisting: forwardRef(function () { return IgxUserAnnotationToolTipLayerComponent; }) }, { provide: IgxSeriesComponent, useExisting: forwardRef(function () { return IgxUserAnnotationToolTipLayerComponent; }) }],
changeDetection: ChangeDetectionStrategy.OnPush
}]
}], ctorParameters: function () { return []; }, propDecorators: { targetSeriesName: [{
type: Input
}], targetSeries: [{
type: Input
}], skipUnknownValues: [{
type: Input
}], contentUpdating: [{
type: Output
}] } });