import UI from "../ui.js"; class Form extends UI { constructor(width, height) { super(document.createElement("div"), width, height); this.element.classList.add("form"); this._lines = []; this._linesById = Object.create(null); } addLine(id, label, editor) { let line = document.createElement("div"); let labelCell = document.createElement("div"); let editorCell = document.createElement("div"); labelCell.innerText = label; editorCell.appendChild(editor.element); editor.element.style.float = "right"; line.appendChild(labelCell); line.appendChild(editorCell); let obj = { id: id, label: label, editor: editor, visible: true, line: line }; this._lines.push(obj); this._linesById[id] = obj; this.element.appendChild(line); } } export default Form;