igniteui-webcomponents-charts
Version:
Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.
141 lines (140 loc) • 5.21 kB
JavaScript
import { __extends } from "tslib";
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";
/**
* Represents a legend in a IgxDataChartComponent control.
*
* The `Legend` helps end-user identify visuals of chart series with contextual information related to the data plotted in the chart control.
*/
export var IgcLegendComponent = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgcLegendComponent, _super);
function IgcLegendComponent() {
var _this = _super.call(this) || this;
_this._disconnected = false;
var 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);
return _this;
}
IgcLegendComponent.prototype.initializeContent = function () {
};
IgcLegendComponent.prototype.destroy = function () {
this._wrapper.destroy();
this.i.provideContainer(null);
};
IgcLegendComponent.prototype.createImplementation = function () {
return new Legend();
};
Object.defineProperty(IgcLegendComponent.prototype, "i", {
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
IgcLegendComponent.prototype.disconnectedCallback = function () {
this._disconnected = true;
if (this.i) {
this.i.onDetachedFromUI();
}
};
IgcLegendComponent.prototype.connectedCallback = function () {
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();
};
Object.defineProperty(IgcLegendComponent, "observedAttributes", {
get: function () {
if (IgcLegendComponent._observedAttributesIgcLegendComponent == null) {
var names = getAllPropertyNames(IgcLegendComponent);
for (var i = 0; i < names.length; i++) {
names[i] = toSpinal(names[i]);
}
IgcLegendComponent._observedAttributesIgcLegendComponent = names;
}
return IgcLegendComponent._observedAttributesIgcLegendComponent;
},
enumerable: false,
configurable: true
});
IgcLegendComponent.register = function () {
if (!IgcLegendComponent._isElementRegistered) {
IgcLegendComponent._isElementRegistered = true;
RegisterElementHelper.registerElement(IgcLegendComponent.htmlTagName, IgcLegendComponent);
}
};
Object.defineProperty(IgcLegendComponent.prototype, "orientation", {
/**
* Gets or sets the current Legend object's orientation.
*/
get: function () {
return this.i.bj;
},
set: function (v) {
this.i.bj = ensureEnum(LegendOrientation_$type, v);
this._a("orientation", enumToString(LegendOrientation_$type, this.i.bj));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcLegendComponent.prototype, "textColor", {
/**
* Gets or sets color of text
*/
get: function () {
return this.i.bp;
},
set: function (v) {
this.i.bp = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcLegendComponent.prototype, "textStyle", {
/**
* Gets or sets style of text.
*/
get: function () {
return this.i.bq;
},
set: function (v) {
this.i.bq = v;
},
enumerable: false,
configurable: true
});
IgcLegendComponent._observedAttributesIgcLegendComponent = null;
IgcLegendComponent.htmlTagName = "igc-legend";
IgcLegendComponent._isElementRegistered = false;
return IgcLegendComponent;
}(IgcLegendBaseComponent));