/*
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 { TypeRegistrar } from './type';
import { html, render } from './template';
export let IgcTooltipContainerComponent = /*@__PURE__*/ (() => {
    class IgcTooltipContainerComponent extends HTMLElement {
        constructor() {
            super();
            //private _tooltipContent: IgcTemplateContentComponent;
            this._template = null;
            this._containerTemplate = null;
            this._attached = false;
            this._context = null;
            this.containerTemplate = (context) => html `
        <div class='ui-tooltip-container'
            style="padding: 5px; background-color: white; border-style: solid; border-width: 1px; pointer-events: none; white-space: nowrap; border-color: ${context && context.isSubContent ? 'transparent' : '#666'}">
            ${((context && this.template) ? this.template(context) : html ``)}
        </div>
`;
        }
        set template(value) {
            this._template = value;
            this.onTemplateChanged();
        }
        get template() {
            return this._template;
        }
        connectedCallback() {
            this.attachedCallback();
        }
        attachedCallback() {
            this._attached = true;
            this.classList.add("ig-tooltip-container");
            this.classList.add("igc-tooltip-container");
            this.render();
        }
        set containerTemplate(value) {
            this._containerTemplate = value;
            if (this._attached) {
                this.onContainerTemplateChanged();
            }
        }
        get containerTemplate() {
            return this._containerTemplate;
        }
        set context(value) {
            this._context = value;
            this.onContextChanged();
        }
        get context() {
            return this._context;
        }
        onContextChanged() {
            this.render();
        }
        onTemplateChanged() {
            this.render();
        }
        onContainerTemplateChanged() {
            this.render();
        }
        render() {
            if (!this.containerTemplate || !this.context) {
                if (this.containerTemplate) {
                    render(this.containerTemplate(this.context), this);
                }
                else {
                    this.innerHTML = '';
                }
            }
            render(this.containerTemplate(this.context), this);
        }
        destroy() {
        }
        static register() {
            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;
})();
//# sourceMappingURL=igc-tooltip-container-component.js.map
