(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define(["require", "exports", "../../core/AtomBinder", "../styles/AtomStyle", "./AtomControl"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.AtomContentStyle = exports.AtomContentControl = void 0;
    const AtomBinder_1 = require("../../core/AtomBinder");
    const AtomStyle_1 = require("../styles/AtomStyle");
    const AtomControl_1 = require("./AtomControl");
    class AtomContentControl extends AtomControl_1.AtomControl {
        get content() {
            return this.mContent;
        }
        set content(c) {
            const old = this.mContent;
            if (old) {
                old.element.remove();
            }
            this.mContent = c;
            if (c) {
                this.element.appendChild(c.element);
                const style = c.element.style;
                c.invalidate();
            }
            AtomBinder_1.AtomBinder.refreshValue(this, "content");
        }
        preCreate() {
            super.preCreate();
            this.defaultControlStyle = AtomContentStyle;
            this.runAfterInit(() => {
                this.element.classList.add(this.controlStyle.name);
            });
        }
    }
    exports.AtomContentControl = AtomContentControl;
    class AtomContentStyle extends AtomStyle_1.AtomStyle {
        get root() {
            return {
                subclasses: {
                    " > *": {
                        position: "absolute",
                        top: "0",
                        left: "0",
                        right: "0",
                        bottom: "0",
                    }
                }
            };
        }
    }
    exports.AtomContentStyle = AtomContentStyle;
});
//# sourceMappingURL=AtomContentControl.js.map