UNPKG

igniteui-webcomponents-charts

Version:

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

116 lines (115 loc) 4.23 kB
import { IgcLegendBaseComponent } from './igc-legend-base-component'; import { Legend } from "./Legend"; import { LegendOrientation_$type } from './LegendOrientation'; import { WebComponentRenderer } from "igniteui-webcomponents-core"; import { DataChartStylingDefaults } from './DataChartStylingDefaults'; import { ensureEnum, toSpinal, enumToString, getAllPropertyNames } from "igniteui-webcomponents-core"; import { RegisterElementHelper } from "igniteui-webcomponents-core"; let IgcLegendComponent = /*@__PURE__*/ (() => { class IgcLegendComponent extends IgcLegendBaseComponent { initializeContent() { } constructor() { super(); this._disconnected = false; let container; if (document) { container = document.createElement("div"); container.style.display = "block"; container.style.width = "100%"; container.style.height = "100%"; } var root; root = container; var ren = new WebComponentRenderer(root, document, true, DataChartStylingDefaults); this.container = ren.getWrapper(container); this._wrapper = ren; this.i.provideContainer(ren); } destroy() { this._wrapper.destroy(); this.i.provideContainer(null); } createImplementation() { return new Legend(); } get i() { return this._implementation; } disconnectedCallback() { this._disconnected = true; if (this.i) { this.i.onDetachedFromUI(); } } connectedCallback() { if (this._disconnected) { this._disconnected = false; if (this.i) { this.i.onAttachedToUI(); } return; } this.classList.add("ig-legend"); this.classList.add("igc-legend"); this.appendChild(this._wrapper.rootWrapper.getNativeElement()); this._attached = true; this.style.display = "block"; //this.style.height = this._height; //this.style.width = this._width; this._flushQueuedAttributes(); // supports themes or custom properties set in CSS //this._styling(this, this); this.initializeContent(); } static get observedAttributes() { if (IgcLegendComponent._observedAttributesIgcLegendComponent == null) { let names = getAllPropertyNames(IgcLegendComponent); for (let i = 0; i < names.length; i++) { names[i] = toSpinal(names[i]); } IgcLegendComponent._observedAttributesIgcLegendComponent = names; } return IgcLegendComponent._observedAttributesIgcLegendComponent; } static register() { if (!IgcLegendComponent._isElementRegistered) { IgcLegendComponent._isElementRegistered = true; RegisterElementHelper.registerElement(IgcLegendComponent.htmlTagName, IgcLegendComponent); } } /** * Gets or sets the current Legend object's orientation. */ get orientation() { return this.i.bj; } set orientation(v) { this.i.bj = ensureEnum(LegendOrientation_$type, v); this._a("orientation", enumToString(LegendOrientation_$type, this.i.bj)); } /** * Gets or sets color of text */ get textColor() { return this.i.bp; } set textColor(v) { this.i.bp = v; } /** * Gets or sets style of text. */ get textStyle() { return this.i.bq; } set textStyle(v) { this.i.bq = v; } } IgcLegendComponent._observedAttributesIgcLegendComponent = null; IgcLegendComponent.htmlTagName = "igc-legend"; IgcLegendComponent._isElementRegistered = false; return IgcLegendComponent; })(); export { IgcLegendComponent };