/*
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 { IgEvent } from "igniteui-webcomponents-core/ES5/IgEvent";
var IgcComponentRendererContainerComponent = /** @class */ (function () {
    function IgcComponentRendererContainerComponent() {
        this.listeners = [];
        this._currentRoot = null;
    }
    IgcComponentRendererContainerComponent.fromElement = function (ele) {
        if (ele.$$container) {
            return ele.$$container;
        }
        var c = new IgcComponentRendererContainerComponent();
        c.element = ele;
        ele.$$container = c;
        return c;
    };
    IgcComponentRendererContainerComponent.prototype.replaceRootItem = function (t, continueActions) {
        for (var i = this.element.children.length - 1; i >= 0; i--) {
            this.element.children[i].remove();
        }
        var C = t;
        if (C.htmlTagName) {
            t = document.createElement(t.htmlTagName);
        }
        else {
            t = new C();
        }
        this._currentRoot = t;
        this.element.appendChild(this._currentRoot);
        this._currentRoot.width = "100%";
        this._currentRoot.height = "100%";
        continueActions(false);
    };
    IgcComponentRendererContainerComponent.prototype.clearContainer = function (continueActions) {
        for (var i = this.element.children.length - 1; i >= 0; i--) {
            this.element.children[i].remove();
        }
        continueActions(false);
    };
    IgcComponentRendererContainerComponent.prototype.getRootObject = function () {
        return this._currentRoot;
    };
    IgcComponentRendererContainerComponent.isEvent = function (obj) {
        return obj instanceof IgEvent;
    };
    return IgcComponentRendererContainerComponent;
}());
export { IgcComponentRendererContainerComponent };
