UNPKG

igniteui-webcomponents-charts

Version:

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

121 lines (120 loc) 4.17 kB
import { IgcSeriesComponent } from "./igc-series-component"; import { IgcSeriesMatcher } from "./igc-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 IgcChartSelection = /** @class */ /*@__PURE__*/ (function () { function IgcChartSelection() { this._implementation = this.createImplementation(); this._implementation.externalObject = this; this.onImplementationCreated(); if (this._initializeAdapters) { this._initializeAdapters(); } } IgcChartSelection.prototype.createImplementation = function () { return new ChartSelection_internal(); }; Object.defineProperty(IgcChartSelection.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; }, enumerable: false, configurable: true }); IgcChartSelection.prototype.onImplementationCreated = function () { }; IgcChartSelection.prototype._provideImplementation = function (i) { this._implementation = i; this._implementation.externalObject = this; this.onImplementationCreated(); if (this._initializeAdapters) { this._initializeAdapters(); } }; Object.defineProperty(IgcChartSelection.prototype, "item", { get: function () { return this.i.item; }, set: function (v) { this.i.item = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgcChartSelection.prototype, "series", { get: function () { var r = this.i.series; 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) { v == null ? this.i.series = null : this.i.series = v.i; }, enumerable: false, configurable: true }); Object.defineProperty(IgcChartSelection.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 IgcSeriesMatcher(); 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 }); IgcChartSelection.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; }; IgcChartSelection.prototype.equals = function (other) { var iv = this.i.equals(other); return (iv); }; return IgcChartSelection; }()); export { IgcChartSelection };