| 836 | } |
| 837 | |
| 838 | function buildLabelSection(): HTMLDivElement { |
| 839 | const name = mkInput("label", "midpoint"); |
| 840 | name.style.width = "100px"; |
| 841 | const pos = mkNumInput("pos", "1.5"); |
| 842 | const add = mkBtn("Add", "primary", () => { |
| 843 | const labelName = name.value.trim(); |
| 844 | comp!.dispatch({ type: "addLabel", name: labelName, position: parseFloat(pos.value) }); |
| 845 | logEntry("op", { addLabel: { name: labelName, position: pos.value } }); |
| 846 | }); |
| 847 | const remove = mkBtn("Remove", "danger", () => { |
| 848 | comp!.dispatch({ type: "removeLabel", name: name.value.trim() }); |
| 849 | logEntry("op", { removeLabel: name.value.trim() }); |
| 850 | }); |
| 851 | return opSection("addLabel / removeLabel", opRow(name, pos, add, remove)); |
| 852 | } |
| 853 | |
| 854 | function buildClassStyleSection(): HTMLDivElement { |
| 855 | const sel = mkInput("selector", ".badge"); |