igniteui-webcomponents-charts
Version:
Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.
352 lines (351 loc) • 16.2 kB
JavaScript
/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { __extends } from "tslib";
import { delegateCombine, delegateRemove } from "igniteui-webcomponents-core";
import { IgcSeriesComponent } from "./igc-series-component";
import { IgcUserAnnotationCollection } from "./igc-user-annotation-collection";
import { IgcUserAnnotationInformationEventArgs } from "./igc-user-annotation-information-event-args";
import { IgcUserAxisAnnotationStylingEventArgs } from "./igc-user-axis-annotation-styling-event-args";
import { IgcUserSliceAnnotationStylingEventArgs } from "./igc-user-slice-annotation-styling-event-args";
import { IgcUserStripAnnotationStylingEventArgs } from "./igc-user-strip-annotation-styling-event-args";
import { IgcUserPointAnnotationStylingEventArgs } from "./igc-user-point-annotation-styling-event-args";
import { UserAnnotationLayer } from "./UserAnnotationLayer";
import { UserAnnotationCollection as UserAnnotationCollection_internal } from "./UserAnnotationCollection";
import { UserBaseAnnotation } from "./UserBaseAnnotation";
import { SyncableObservableCollection$1 } from "igniteui-webcomponents-core";
import { getAllPropertyNames, toSpinal } from "igniteui-webcomponents-core";
import { RegisterElementHelper } from "igniteui-webcomponents-core";
/**
* Represents an user annotation layer that can define UserPointAnnotation, UserSliceAnnotation, UserStripAnnotation
*/
export var IgcUserAnnotationLayerComponent = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgcUserAnnotationLayerComponent, _super);
function IgcUserAnnotationLayerComponent() {
var _this = _super.call(this) || this;
_this._annotations = null;
_this._userAnnotationInformationRequested = null;
_this._userAnnotationInformationRequested_wrapped = null;
_this._stylingAxisAnnotation = null;
_this._stylingAxisAnnotation_wrapped = null;
_this._stylingSliceAnnotation = null;
_this._stylingSliceAnnotation_wrapped = null;
_this._stylingStripAnnotation = null;
_this._stylingStripAnnotation_wrapped = null;
_this._stylingPointAnnotation = null;
_this._stylingPointAnnotation_wrapped = null;
return _this;
}
IgcUserAnnotationLayerComponent.prototype.createImplementation = function () {
return new UserAnnotationLayer();
};
IgcUserAnnotationLayerComponent.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();
}
};
IgcUserAnnotationLayerComponent.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(IgcUserAnnotationLayerComponent, "observedAttributes", {
get: function () {
if (IgcUserAnnotationLayerComponent._observedAttributesIgcUserAnnotationLayerComponent == null) {
var names = getAllPropertyNames(IgcUserAnnotationLayerComponent);
for (var i = 0; i < names.length; i++) {
names[i] = toSpinal(names[i]);
}
IgcUserAnnotationLayerComponent._observedAttributesIgcUserAnnotationLayerComponent = names;
}
return IgcUserAnnotationLayerComponent._observedAttributesIgcUserAnnotationLayerComponent;
},
enumerable: false,
configurable: true
});
IgcUserAnnotationLayerComponent.register = function () {
if (!IgcUserAnnotationLayerComponent._isElementRegistered) {
IgcUserAnnotationLayerComponent._isElementRegistered = true;
RegisterElementHelper.registerElement(IgcUserAnnotationLayerComponent.htmlTagName, IgcUserAnnotationLayerComponent);
}
};
Object.defineProperty(IgcUserAnnotationLayerComponent.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcUserAnnotationLayerComponent.prototype, "annotations", {
/**
* Gets user annotations
*/
get: function () {
if (this._annotations === null) {
var coll = new IgcUserAnnotationCollection();
var innerColl = this.i.annotations;
if (!innerColl) {
innerColl = new UserAnnotationCollection_internal();
}
this._annotations = coll._fromInner(innerColl);
}
return this._annotations;
},
set: function (v) {
if (this._annotations !== null) {
this._annotations._setSyncTarget(null);
this._annotations = null;
}
var coll = new IgcUserAnnotationCollection();
this._annotations = coll._fromOuter(v);
var syncColl = new SyncableObservableCollection$1(UserBaseAnnotation.$type);
var innerColl = this.i.annotations;
if (!innerColl) {
innerColl = new UserAnnotationCollection_internal();
}
syncColl._inner = innerColl;
syncColl.clear();
this._annotations._setSyncTarget(syncColl);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcUserAnnotationLayerComponent.prototype, "isAnnotationLayer", {
get: function () {
return this.i.ev;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcUserAnnotationLayerComponent.prototype, "isUserAnnotationLayer", {
get: function () {
return this.i.f9;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcUserAnnotationLayerComponent.prototype, "isUsableInLegend", {
/**
* Gets if the series should appear in any legends.
*/
get: function () {
return this.i.isUsableInLegend;
},
enumerable: false,
configurable: true
});
IgcUserAnnotationLayerComponent.prototype.findByName = function (name) {
var baseResult = _super.prototype.findByName.call(this, name);
if (baseResult) {
return baseResult;
}
if (this.annotations != null && this.annotations.findByName && this.annotations.findByName(name)) {
return this.annotations.findByName(name);
}
return null;
};
IgcUserAnnotationLayerComponent.prototype.loadAnnotationsFromJson = function (jsonString) {
this.i.y6(jsonString);
};
IgcUserAnnotationLayerComponent.prototype.saveAnnotationsToJson = function () {
var iv = this.i.yp();
return (iv);
};
IgcUserAnnotationLayerComponent.prototype.cancelAnnotationFlow = function (annotationFlowID) {
this.i.yw(annotationFlowID);
};
IgcUserAnnotationLayerComponent.prototype.finishAnnotationFlow = function (info) {
this.i.y4((info == null ? null : info.i));
};
IgcUserAnnotationLayerComponent.prototype.bindAxes = function (axes) {
_super.prototype.bindAxes.call(this, axes);
if (this.annotations) {
for (var i = 0; i < this.annotations.count; i++) {
this.annotations[i].bindAxes(axes);
}
}
};
IgcUserAnnotationLayerComponent.prototype.bindSeries = function (series) {
_super.prototype.bindSeries.call(this, series);
if (this.annotations) {
for (var i = 0; i < this.annotations.count; i++) {
this.annotations[i].bindSeries(series);
}
}
};
Object.defineProperty(IgcUserAnnotationLayerComponent.prototype, "userAnnotationInformationRequested", {
get: function () {
return this._userAnnotationInformationRequested;
},
set: function (ev) {
var _this = this;
if (this._userAnnotationInformationRequested_wrapped !== null) {
this.i.userAnnotationInformationRequested = delegateRemove(this.i.userAnnotationInformationRequested, this._userAnnotationInformationRequested_wrapped);
this._userAnnotationInformationRequested_wrapped = null;
this._userAnnotationInformationRequested = null;
}
this._userAnnotationInformationRequested = ev;
this._userAnnotationInformationRequested_wrapped = function (o, e) {
var outerArgs = new IgcUserAnnotationInformationEventArgs();
outerArgs._provideImplementation(e);
if (_this.beforeUserAnnotationInformationRequested) {
_this.beforeUserAnnotationInformationRequested(_this, outerArgs);
}
if (_this._userAnnotationInformationRequested) {
_this._userAnnotationInformationRequested(_this, outerArgs);
}
};
this.i.userAnnotationInformationRequested = delegateCombine(this.i.userAnnotationInformationRequested, this._userAnnotationInformationRequested_wrapped);
;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcUserAnnotationLayerComponent.prototype, "stylingAxisAnnotation", {
/**
* Event raised when updating style of UserAxisAnnotation
*/
get: function () {
return this._stylingAxisAnnotation;
},
set: function (ev) {
var _this = this;
if (this._stylingAxisAnnotation_wrapped !== null) {
this.i.stylingAxisAnnotation = delegateRemove(this.i.stylingAxisAnnotation, this._stylingAxisAnnotation_wrapped);
this._stylingAxisAnnotation_wrapped = null;
this._stylingAxisAnnotation = null;
}
this._stylingAxisAnnotation = ev;
this._stylingAxisAnnotation_wrapped = function (o, e) {
var outerArgs = new IgcUserAxisAnnotationStylingEventArgs();
outerArgs._provideImplementation(e);
if (_this.beforeStylingAxisAnnotation) {
_this.beforeStylingAxisAnnotation(_this, outerArgs);
}
if (_this._stylingAxisAnnotation) {
_this._stylingAxisAnnotation(_this, outerArgs);
}
};
this.i.stylingAxisAnnotation = delegateCombine(this.i.stylingAxisAnnotation, this._stylingAxisAnnotation_wrapped);
;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcUserAnnotationLayerComponent.prototype, "stylingSliceAnnotation", {
/**
* Event raised when updating style of UserSliceAnnotation
*/
get: function () {
return this._stylingSliceAnnotation;
},
set: function (ev) {
var _this = this;
if (this._stylingSliceAnnotation_wrapped !== null) {
this.i.stylingSliceAnnotation = delegateRemove(this.i.stylingSliceAnnotation, this._stylingSliceAnnotation_wrapped);
this._stylingSliceAnnotation_wrapped = null;
this._stylingSliceAnnotation = null;
}
this._stylingSliceAnnotation = ev;
this._stylingSliceAnnotation_wrapped = function (o, e) {
var outerArgs = new IgcUserSliceAnnotationStylingEventArgs();
outerArgs._provideImplementation(e);
if (_this.beforeStylingSliceAnnotation) {
_this.beforeStylingSliceAnnotation(_this, outerArgs);
}
if (_this._stylingSliceAnnotation) {
_this._stylingSliceAnnotation(_this, outerArgs);
}
};
this.i.stylingSliceAnnotation = delegateCombine(this.i.stylingSliceAnnotation, this._stylingSliceAnnotation_wrapped);
;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcUserAnnotationLayerComponent.prototype, "stylingStripAnnotation", {
/**
* Event raised when updating style of UserStripAnnotation
*/
get: function () {
return this._stylingStripAnnotation;
},
set: function (ev) {
var _this = this;
if (this._stylingStripAnnotation_wrapped !== null) {
this.i.stylingStripAnnotation = delegateRemove(this.i.stylingStripAnnotation, this._stylingStripAnnotation_wrapped);
this._stylingStripAnnotation_wrapped = null;
this._stylingStripAnnotation = null;
}
this._stylingStripAnnotation = ev;
this._stylingStripAnnotation_wrapped = function (o, e) {
var outerArgs = new IgcUserStripAnnotationStylingEventArgs();
outerArgs._provideImplementation(e);
if (_this.beforeStylingStripAnnotation) {
_this.beforeStylingStripAnnotation(_this, outerArgs);
}
if (_this._stylingStripAnnotation) {
_this._stylingStripAnnotation(_this, outerArgs);
}
};
this.i.stylingStripAnnotation = delegateCombine(this.i.stylingStripAnnotation, this._stylingStripAnnotation_wrapped);
;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcUserAnnotationLayerComponent.prototype, "stylingPointAnnotation", {
/**
* Event raised when updating style of UserPointAnnotation
*/
get: function () {
return this._stylingPointAnnotation;
},
set: function (ev) {
var _this = this;
if (this._stylingPointAnnotation_wrapped !== null) {
this.i.stylingPointAnnotation = delegateRemove(this.i.stylingPointAnnotation, this._stylingPointAnnotation_wrapped);
this._stylingPointAnnotation_wrapped = null;
this._stylingPointAnnotation = null;
}
this._stylingPointAnnotation = ev;
this._stylingPointAnnotation_wrapped = function (o, e) {
var outerArgs = new IgcUserPointAnnotationStylingEventArgs();
outerArgs._provideImplementation(e);
if (_this.beforeStylingPointAnnotation) {
_this.beforeStylingPointAnnotation(_this, outerArgs);
}
if (_this._stylingPointAnnotation) {
_this._stylingPointAnnotation(_this, outerArgs);
}
};
this.i.stylingPointAnnotation = delegateCombine(this.i.stylingPointAnnotation, this._stylingPointAnnotation_wrapped);
;
},
enumerable: false,
configurable: true
});
IgcUserAnnotationLayerComponent._observedAttributesIgcUserAnnotationLayerComponent = null;
IgcUserAnnotationLayerComponent.htmlTagName = "igc-user-annotation-layer";
IgcUserAnnotationLayerComponent._isElementRegistered = false;
return IgcUserAnnotationLayerComponent;
}(IgcSeriesComponent));