igniteui-react-core
Version:
Ignite UI React Core.
44 lines (43 loc) • 2.05 kB
JavaScript
/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { __extends } from "tslib";
import * as React from 'react';
import { TypeRegistrar } from "./type";
var IgrSimpleDefaultTooltip = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgrSimpleDefaultTooltip, _super);
function IgrSimpleDefaultTooltip(props) {
return _super.call(this, props) || this;
}
IgrSimpleDefaultTooltip.prototype.render = function () {
return (React.createElement("div", { className: "ui-simple-default-tooltip-content" }, React.createElement("span", { style: { whiteSpace: "nowrap", fontWeight: "bold" } }, this.getLabel(this.props.context))));
};
IgrSimpleDefaultTooltip.prototype.ensureDefaultTooltip = function (gauge) {
if (gauge.showToolTip) {
gauge.tooltipTemplate = this.props.tooltip;
}
else {
gauge.tooltipTemplate = null;
}
};
IgrSimpleDefaultTooltip.prototype.getLabel = function (context) {
if (context.itemName == null) {
var label = context.label.split(":");
return label.length < 2 ? context.label : label[1].trim();
}
return context.label;
};
IgrSimpleDefaultTooltip.prototype.willComponentMount = function () {
if (this.onContentReady != null) {
this.onContentReady();
}
};
IgrSimpleDefaultTooltip.register = function () {
TypeRegistrar.registerCons("IgrSimpleDefaultTooltip", IgrSimpleDefaultTooltip);
};
return IgrSimpleDefaultTooltip;
}(React.Component));
export { IgrSimpleDefaultTooltip };