igniteui-webcomponents-charts
Version:
Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.
95 lines (94 loc) • 3.84 kB
JavaScript
import { IgcLegendBaseComponent } from './igc-legend-base-component';
import { Legend } from "./Legend";
import { WebComponentRenderer } from "igniteui-webcomponents-core";
import { DataChartStylingDefaults } from './DataChartStylingDefaults';
import { toSpinal, getAllPropertyNames } from "igniteui-webcomponents-core";
import { RegisterElementHelper } from "igniteui-webcomponents-core";
/**
* Represents a legend that displays information about each series, most often used in financial charting.
*/
export let IgcFinancialLegendComponent = /*@__PURE__*/ (() => {
class IgcFinancialLegendComponent 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-item-legend");
this.classList.add("igc-item-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 (IgcFinancialLegendComponent._observedAttributesIgcFinancialLegendComponent == null) {
let names = getAllPropertyNames(IgcFinancialLegendComponent);
for (let i = 0; i < names.length; i++) {
names[i] = toSpinal(names[i]);
}
IgcFinancialLegendComponent._observedAttributesIgcFinancialLegendComponent = names;
}
return IgcFinancialLegendComponent._observedAttributesIgcFinancialLegendComponent;
}
static register() {
if (!IgcFinancialLegendComponent._isElementRegistered) {
IgcFinancialLegendComponent._isElementRegistered = true;
RegisterElementHelper.registerElement(IgcFinancialLegendComponent.htmlTagName, IgcFinancialLegendComponent);
}
}
/**
* Gets if the legend is a financial legend.
*/
get isFinancial() {
return this.i.isFinancial;
}
}
IgcFinancialLegendComponent._observedAttributesIgcFinancialLegendComponent = null;
IgcFinancialLegendComponent.htmlTagName = "igc-financial-legend";
IgcFinancialLegendComponent._isElementRegistered = false;
return IgcFinancialLegendComponent;
})();