UNPKG

igniteui-react-charts

Version:

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

133 lines (132 loc) 4.53 kB
import { IgrSeries } from "./igr-series"; import { IgrSeriesMatcher } from "./igr-series-matcher"; import { ChartSelection as ChartSelection_internal } from "./ChartSelection"; /** * Represents a selected item within the chart. This should be treated as immutable while in the selected items collection. Changes while part of the collection will not be respected. */ var IgrChartSelection = /** @class */ /*@__PURE__*/ (function () { function IgrChartSelection() { this.mounted = false; this._implementation = this.createImplementation(); this._implementation.externalObject = this; this.onImplementationCreated(); if (this._initializeAdapters) { this._initializeAdapters(); } } IgrChartSelection.prototype.createImplementation = function () { return new ChartSelection_internal(); }; Object.defineProperty(IgrChartSelection.prototype, "nativeElement", { get: function () { return this._implementation.nativeElement; }, enumerable: false, configurable: true }); Object.defineProperty(IgrChartSelection.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; }, enumerable: false, configurable: true }); IgrChartSelection.prototype.onImplementationCreated = function () { }; IgrChartSelection.prototype._provideImplementation = function (i) { this._implementation = i; this._implementation.externalObject = this; this.onImplementationCreated(); if (this._initializeAdapters) { this._initializeAdapters(); } }; Object.defineProperty(IgrChartSelection.prototype, "item", { get: function () { return this.i.item; }, set: function (v) { this.i.item = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrChartSelection.prototype, "series", { get: function () { var r = this.i.series; if (r == null) { return null; } if (!r.externalObject) { var e = IgrSeries._createFromInternal(r); if (e) { e._implementation = r; } r.externalObject = e; } return r.externalObject; }, set: function (v) { v == null ? this.i.series = null : this.i.series = v.i; }, enumerable: false, configurable: true }); Object.defineProperty(IgrChartSelection.prototype, "matcher", { /** * If set, allows for selecting a series based on a matcher. This should resolve to a single static series at the time that the chart selection is added to selected items. * It will not be re-evaluated while the ChartSelection is in the selected items. */ get: function () { var r = this.i.c; if (r == null) { return null; } if (!r.externalObject) { var e = new IgrSeriesMatcher(); if (r.$type) { e._implementation = r; } else { if (e.i.setNativeElement) { e.i.setNativeElement(r); } } r.externalObject = e; } return r.externalObject; }, set: function (v) { v == null ? this.i.c = null : this.i.c = v.i; }, enumerable: false, configurable: true }); IgrChartSelection.prototype.findByName = function (name) { if (this.findEphemera) { if (name && name.indexOf("@@e:") == 0) { return this.findEphemera(name); } } if (this.series && this.series.name && this.series.name == name) { return this.series; } if (this.matcher && this.matcher.name && this.matcher.name == name) { return this.matcher; } return null; }; IgrChartSelection.prototype.equals = function (other) { var iv = this.i.equals(other); return (iv); }; IgrChartSelection.prototype.getHashCode = function () { var iv = this.i.getHashCode(); return (iv); }; return IgrChartSelection; }()); export { IgrChartSelection };