UNPKG

igniteui-webcomponents-charts

Version:

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

196 lines (195 loc) 7.74 kB
import { IgcRing } from "./igc-ring"; import { IgcRingSeriesBaseComponent } from "./igc-ring-series-base-component"; import { RingSeries } from "./RingSeries"; import { IgcIndexCollection } from "./igc-index-collection"; import { IndexCollection as IndexCollection_internal } from "./IndexCollection"; import { Number_$type } from "igniteui-webcomponents-core"; import { SyncableObservableCollection$1 } from "igniteui-webcomponents-core"; import { getAllPropertyNames, toSpinal } from "igniteui-webcomponents-core"; import { RegisterElementHelper } from "igniteui-webcomponents-core"; let IgcRingSeriesComponent = /*@__PURE__*/ (() => { class IgcRingSeriesComponent extends IgcRingSeriesBaseComponent { createImplementation() { return new RingSeries(); } get i() { return this._implementation; } constructor() { super(); this._explodedSlices = null; this._selectedSlices = null; } /** * Gets or sets the collection of exploded slice indices. */ get explodedSlices() { if (this._explodedSlices === null) { let coll = new IgcIndexCollection(); let innerColl; if (this.ring.i.ringControl.arcs.count == 0) { innerColl = new IndexCollection_internal(); } else { innerColl = this.ring.i.ringControl.arcs.item(0).explodedSlices; } this._explodedSlices = coll._fromInner(innerColl); } return this._explodedSlices; } set explodedSlices(v) { if (this._explodedSlices !== null) { this._explodedSlices._setSyncTarget(null); this._explodedSlices = null; } let coll = new IgcIndexCollection(); this._explodedSlices = coll._fromOuter(v); let syncColl = new SyncableObservableCollection$1(Number_$type); let innerColl; if (this.ring.i.ringControl.arcs.count == 0) { innerColl = new IndexCollection_internal(); } else { innerColl = this.ring.i.ringControl.arcs.item(0).explodedSlices; } syncColl._inner = innerColl; syncColl.clear(); this._explodedSlices._setSyncTarget(syncColl); } /** * Gets or sets the collection of selected slice indices. */ get selectedSlices() { if (this._selectedSlices === null) { let coll = new IgcIndexCollection(); let innerColl; if (this.ring.i.ringControl.arcs.count == 0) { innerColl = new IndexCollection_internal(); } else { innerColl = this.ring.i.ringControl.arcs.item(0).selectedSlices; } this._selectedSlices = coll._fromInner(innerColl); } return this._selectedSlices; } set selectedSlices(v) { if (this._selectedSlices !== null) { this._selectedSlices._setSyncTarget(null); this._selectedSlices = null; } let coll = new IgcIndexCollection(); this._selectedSlices = coll._fromOuter(v); let syncColl = new SyncableObservableCollection$1(Number_$type); let innerColl; if (this.ring.i.ringControl.arcs.count == 0) { innerColl = new IndexCollection_internal(); } else { innerColl = this.ring.i.ringControl.arcs.item(0).selectedSlices; } syncColl._inner = innerColl; syncColl.clear(); this._selectedSlices._setSyncTarget(syncColl); } sychronizeCollections() { if (this._explodedSlices) { let inner = this._explodedSlices._inner; if (inner && inner !== this.ring.i.ringControl.arcs.item(0).explodedSlices) { this._explodedSlices._inner = this.ring.i.ringControl.arcs.item(0).explodedSlices; for (var i = 0; i < inner.count; i++) { this._explodedSlices.add(inner.item(i)); } } } if (this._selectedSlices) { let inner = this._selectedSlices._inner; if (inner && inner !== this.ring.i.ringControl.arcs.item(0).selectedSlices) { this._selectedSlices._inner = this.ring.i.ringControl.arcs.item(0).selectedSlices; for (var i = 0; i < inner.count; i++) { this._selectedSlices.add(inner.item(i)); } } } } connectedCallback() { if (super["connectedCallback"]) { super["connectedCallback"](); } if (this.i.connectedCallback) { this.i.connectedCallback(); } if (!this._attached) { this._attached = true; this._flushQueuedAttributes(); } } disconnectedCallback() { if (super["disconnectedCallback"]) { super["disconnectedCallback"](); } if (this.i.disconnectedCallback) { this.i.disconnectedCallback(); } if (this._attached) { this._attached = false; } } static get observedAttributes() { if (IgcRingSeriesComponent._observedAttributesIgcRingSeriesComponent == null) { let names = getAllPropertyNames(IgcRingSeriesComponent); for (let i = 0; i < names.length; i++) { names[i] = toSpinal(names[i]); } IgcRingSeriesComponent._observedAttributesIgcRingSeriesComponent = names; } return IgcRingSeriesComponent._observedAttributesIgcRingSeriesComponent; } static register() { if (!IgcRingSeriesComponent._isElementRegistered) { IgcRingSeriesComponent._isElementRegistered = true; RegisterElementHelper.registerElement(IgcRingSeriesComponent.htmlTagName, IgcRingSeriesComponent); } } /** * Gets reference to the ring data. */ get ring() { const r = this.i.eo; if (r == null) { return null; } if (!r.externalObject) { let e = new IgcRing(); if (r.$type) { e._implementation = r; } else { if (e.i.setNativeElement) { e.i.setNativeElement(r); } } r.externalObject = e; } return r.externalObject; } set ring(v) { v == null ? this.i.eo = null : this.i.eo = v.i; } findByName(name) { var baseResult = super.findByName(name); if (baseResult) { return baseResult; } if (this.ring && this.ring.name && this.ring.name == name) { return this.ring; } return null; } } IgcRingSeriesComponent._observedAttributesIgcRingSeriesComponent = null; IgcRingSeriesComponent.htmlTagName = "igc-ring-series"; IgcRingSeriesComponent._isElementRegistered = false; return IgcRingSeriesComponent; })(); export { IgcRingSeriesComponent };