UNPKG

@web-atoms/core

Version:
61 lines (60 loc) 1.83 kB
System.register(["../../core/AtomBinder", "../styles/AtomStyle", "./AtomControl"], function (_export, _context) { "use strict"; var AtomBinder, AtomStyle, AtomControl, AtomContentControl, AtomContentStyle; _export({ AtomContentControl: void 0, AtomContentStyle: void 0 }); return { setters: [function (_coreAtomBinder) { AtomBinder = _coreAtomBinder.AtomBinder; }, function (_stylesAtomStyle) { AtomStyle = _stylesAtomStyle.AtomStyle; }, function (_AtomControl) { AtomControl = _AtomControl.AtomControl; }], execute: function () { _export("AtomContentControl", AtomContentControl = class AtomContentControl extends 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.refreshValue(this, "content"); } preCreate() { super.preCreate(); this.defaultControlStyle = AtomContentStyle; this.runAfterInit(() => { this.element.classList.add(this.controlStyle.name); }); } }); _export("AtomContentStyle", AtomContentStyle = class AtomContentStyle extends AtomStyle { get root() { return { subclasses: { " > *": { position: "absolute", top: "0", left: "0", right: "0", bottom: "0" } } }; } }); } }; }); //# sourceMappingURL=AtomContentControl.js.map