UNPKG

igniteui-react-core

Version:
40 lines (39 loc) 1.6 kB
/* 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 * as React from 'react'; import { TypeRegistrar } from "./type"; export class IgrSimpleDefaultTooltip extends React.Component { render() { return (React.createElement("div", { className: "ui-simple-default-tooltip-content" }, React.createElement("span", { style: { whiteSpace: "nowrap", fontWeight: "bold" } }, this.getLabel(this.props.context)))); } constructor(props) { super(props); } ensureDefaultTooltip(gauge) { if (gauge.showToolTip) { gauge.tooltipTemplate = this.props.tooltip; } else { gauge.tooltipTemplate = null; } } getLabel(context) { if (context.itemName == null) { let label = context.label.split(":"); return label.length < 2 ? context.label : label[1].trim(); } return context.label; } willComponentMount() { if (this.onContentReady != null) { this.onContentReady(); } } static register() { TypeRegistrar.registerCons("IgrSimpleDefaultTooltip", IgrSimpleDefaultTooltip); } }