@web-atoms/core
Version:
35 lines (34 loc) • 1.23 kB
JavaScript
System.register(["./AtomControl"], function (_export, _context) {
"use strict";
var AtomControl, AtomViewStack;
_export("AtomViewStack", void 0);
return {
setters: [function (_AtomControl) {
AtomControl = _AtomControl.AtomControl;
}],
execute: function () {
_export("AtomViewStack", AtomViewStack = class AtomViewStack extends AtomControl {
append(e) {
const ee = e instanceof AtomControl ? e.element : e;
ee._logicalParent = this.element;
this.children = this.children || [];
const index = this.children.length;
this.children.push(e instanceof AtomControl ? e.element : e);
if (this.selectedIndex === undefined) {
this.selectedIndex = 0;
}
const style = ee.style;
style.position = "absolute";
style.top = style.left = style.right = style.bottom = "0";
this.bind(ee, "styleVisibility", [["selectedIndex"]], false, v => v === index ? "visible" : "hidden");
this.element.appendChild(ee);
return this;
}
preCreate() {
this.selectedIndex = -1;
}
});
}
};
});
//# sourceMappingURL=AtomViewStack.js.map