/*
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 IgcTooltipContainerComponent = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(IgcTooltipContainerComponent, _super);
    function IgcTooltipContainerComponent() {
        var _this = _super.call(this) || this;
        //private _tooltipContent: IgcTemplateContentComponent;
        _this._template = null;
        _this._containerTemplate = null;
        _this._attached = false;
        _this._context = null;
        _this.containerTemplate = function (context) { return html(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["\n        <div class='ui-tooltip-container'\n            style=\"padding: 5px; background-color: white; border-style: solid; border-width: 1px; pointer-events: none; white-space: nowrap; border-color: ", "\">\n            ", "\n        </div>\n"], ["\n        <div class='ui-tooltip-container'\n            style=\"padding: 5px; background-color: white; border-style: solid; border-width: 1px; pointer-events: none; white-space: nowrap; border-color: ", "\">\n            ", "\n        </div>\n"])), context && context.isSubContent ? 'transparent' : '#666', ((context && _this.template) ? _this.template(context) : html(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject([""], [""]))))); };
        return _this;
    }
    Object.defineProperty(IgcTooltipContainerComponent.prototype, "template", {
        get: function () {
            return this._template;
        },
        set: function (value) {
            this._template = value;
            this.onTemplateChanged();
        },
        enumerable: true,
        configurable: true
    });
    IgcTooltipContainerComponent.prototype.connectedCallback = function () {
        this.attachedCallback();
    };
    IgcTooltipContainerComponent.prototype.attachedCallback = function () {
        this._attached = true;
        this.classList.add("ig-tooltip-container");
        this.classList.add("igc-tooltip-container");
        this.render();
    };
    Object.defineProperty(IgcTooltipContainerComponent.prototype, "containerTemplate", {
        get: function () {
            return this._containerTemplate;
        },
        set: function (value) {
            this._containerTemplate = value;
            if (this._attached) {
                this.onContainerTemplateChanged();
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcTooltipContainerComponent.prototype, "context", {
        get: function () {
            return this._context;
        },
        set: function (value) {
            this._context = value;
            this.onContextChanged();
        },
        enumerable: true,
        configurable: true
    });
    IgcTooltipContainerComponent.prototype.onContextChanged = function () {
        this.render();
    };
    IgcTooltipContainerComponent.prototype.onTemplateChanged = function () {
        this.render();
    };
    IgcTooltipContainerComponent.prototype.onContainerTemplateChanged = function () {
        this.render();
    };
    IgcTooltipContainerComponent.prototype.render = function () {
        if (!this.containerTemplate || !this.context) {
            if (this.containerTemplate) {
                render(this.containerTemplate(this.context), this);
            }
            else {
                this.innerHTML = '';
            }
        }
        render(this.containerTemplate(this.context), this);
    };
    IgcTooltipContainerComponent.prototype.destroy = function () {
    };
    IgcTooltipContainerComponent.register = function () {
        if (!IgcTooltipContainerComponent._registered) {
            IgcTooltipContainerComponent._registered = true;
            if (window.customElements) {
                window.customElements.define(IgcTooltipContainerComponent.htmlTagName, IgcTooltipContainerComponent);
            }
            else {
                document.registerElement(IgcTooltipContainerComponent.htmlTagName, IgcTooltipContainerComponent);
            }
            TypeRegistrar.registerCons("IgcTooltipContainerComponent", IgcTooltipContainerComponent);
        }
    };
    IgcTooltipContainerComponent._registered = false;
    IgcTooltipContainerComponent.htmlTagName = "igc-tooltip-container";
    return IgcTooltipContainerComponent;
}(HTMLElement));
export { IgcTooltipContainerComponent };
var templateObject_1, templateObject_2;
//# sourceMappingURL=igc-tooltip-container-component.js.map
