igniteui-webcomponents-charts
Version:
Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.
160 lines (159 loc) • 6.07 kB
JavaScript
import { __extends } from "tslib";
import { IgcLegendBaseComponent } from './igc-legend-base-component';
import { ItemLegend } from "./ItemLegend";
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 that displays an item for each point in the series.
*
* You can use the `ItemLegend` to display a legend item for each data member bound to the `BubbleSeries`
*/
export var IgcItemLegendComponent = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgcItemLegendComponent, _super);
function IgcItemLegendComponent() {
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;
}
IgcItemLegendComponent.prototype.initializeContent = function () {
};
IgcItemLegendComponent.prototype.destroy = function () {
this._wrapper.destroy();
this.i.provideContainer(null);
};
IgcItemLegendComponent.prototype.createImplementation = function () {
return new ItemLegend();
};
Object.defineProperty(IgcItemLegendComponent.prototype, "i", {
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
IgcItemLegendComponent.prototype.createItemwiseLegendItems = function (legendItems, series) {
this.i.createItemwiseLegendItems(legendItems, series);
};
IgcItemLegendComponent.prototype.exportVisualData = function () {
return this.i.exportVisualData();
};
IgcItemLegendComponent.prototype.exportSerializedVisualData = function () {
return this.i.exportSerializedVisualData();
};
IgcItemLegendComponent.prototype.disconnectedCallback = function () {
this._disconnected = true;
if (this.i) {
this.i.onDetachedFromUI();
}
};
IgcItemLegendComponent.prototype.connectedCallback = function () {
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();
};
Object.defineProperty(IgcItemLegendComponent, "observedAttributes", {
get: function () {
if (IgcItemLegendComponent._observedAttributesIgcItemLegendComponent == null) {
var names = getAllPropertyNames(IgcItemLegendComponent);
for (var i = 0; i < names.length; i++) {
names[i] = toSpinal(names[i]);
}
IgcItemLegendComponent._observedAttributesIgcItemLegendComponent = names;
}
return IgcItemLegendComponent._observedAttributesIgcItemLegendComponent;
},
enumerable: false,
configurable: true
});
IgcItemLegendComponent.register = function () {
if (!IgcItemLegendComponent._isElementRegistered) {
IgcItemLegendComponent._isElementRegistered = true;
RegisterElementHelper.registerElement(IgcItemLegendComponent.htmlTagName, IgcItemLegendComponent);
}
};
Object.defineProperty(IgcItemLegendComponent.prototype, "isItemwise", {
/**
* Gets whether or not this legend supports itemwise visuals
*/
get: function () {
return this.i.isItemwise;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcItemLegendComponent.prototype, "orientation", {
/**
* Gets or sets the current Legend object's orientation.
*/
get: function () {
return this.i.bk;
},
set: function (v) {
this.i.bk = ensureEnum(LegendOrientation_$type, v);
this._a("orientation", enumToString(LegendOrientation_$type, this.i.bk));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcItemLegendComponent.prototype, "textColor", {
/**
* Gets or sets color of text
*/
get: function () {
return this.i.bq;
},
set: function (v) {
this.i.bq = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcItemLegendComponent.prototype, "textStyle", {
/**
* Gets or sets style of text.
*/
get: function () {
return this.i.br;
},
set: function (v) {
this.i.br = v;
},
enumerable: false,
configurable: true
});
IgcItemLegendComponent._observedAttributesIgcItemLegendComponent = null;
IgcItemLegendComponent.htmlTagName = "igc-item-legend";
IgcItemLegendComponent._isElementRegistered = false;
return IgcItemLegendComponent;
}(IgcLegendBaseComponent));