/*
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 tslib_1 from "tslib";
import { TypeRegistrar } from "./type";
import { html, render } from "./template";
var IgcSimpleDefaultTooltipComponent = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(IgcSimpleDefaultTooltipComponent, _super);
    function IgcSimpleDefaultTooltipComponent() {
        var _this = _super.call(this) || this;
        _this.tooltip = function (context) { return context ? html(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n    <div class='ui-simple-default-tooltip-content'>\n        <span  style=\"white-space: nowrap;font-weight: bold;\" >", "</span>\n    </div>\n"], ["\n    <div class='ui-simple-default-tooltip-content'>\n        <span  style=\"white-space: nowrap;font-weight: bold;\" >", "</span>\n    </div>\n"])), _this.getLabel(context)) : html(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject([""], [""]))); };
        return _this;
    }
    IgcSimpleDefaultTooltipComponent.prototype.ensureDefaultTooltip = function (gauge) {
        if (gauge.showToolTip) {
            gauge.tooltipTemplate = this.tooltip;
        }
        else {
            gauge.tooltipTemplate = null;
        }
    };
    IgcSimpleDefaultTooltipComponent.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;
    };
    IgcSimpleDefaultTooltipComponent.prototype.render = function (context) {
        if (this.tooltip) {
            var templ = this.tooltip(context);
            render(templ, this);
        }
    };
    IgcSimpleDefaultTooltipComponent.prototype.connectedCallback = function () {
        if (this.onContentReady) {
            this.onContentReady();
        }
    };
    IgcSimpleDefaultTooltipComponent.register = function () {
        if (!IgcSimpleDefaultTooltipComponent._registered) {
            IgcSimpleDefaultTooltipComponent._registered = true;
            if (window.customElements) {
                window.customElements.define(IgcSimpleDefaultTooltipComponent.htmlTagName, IgcSimpleDefaultTooltipComponent);
            }
            else {
                document.registerElement(IgcSimpleDefaultTooltipComponent.htmlTagName, IgcSimpleDefaultTooltipComponent);
            }
            TypeRegistrar.registerCons("IgcSimpleDefaultTooltipComponent", IgcSimpleDefaultTooltipComponent);
        }
    };
    IgcSimpleDefaultTooltipComponent._registered = false;
    IgcSimpleDefaultTooltipComponent.htmlTagName = "igc-simple-default-tooltip";
    return IgcSimpleDefaultTooltipComponent;
}(HTMLElement));
export { IgcSimpleDefaultTooltipComponent };
var templateObject_1, templateObject_2;
//# sourceMappingURL=igc-simple-default-tooltip-component.js.map
