({value, setfn, options, disabled})
| 206 | }; |
| 207 | |
| 208 | export function SelectValue({value, setfn, options, disabled}) { |
| 209 | const toInt = x => x == parseInt(x) ? parseInt(x) : x; |
| 210 | const onchange = ev => setfn(toInt(ev.target.value)); |
| 211 | return html` |
| 212 | <select onchange=${onchange} class="w-full rounded font-normal border py-0.5 px-1 text-gray-600 focus:outline-none text-sm disabled:cursor-not-allowed" disabled=${disabled}> |
| 213 | ${options.map(v => html`<option value=${v[0]} selected=${v[0] == value}>${v[1]}<//>`) } |
| 214 | <//>`; |
| 215 | }; |
| 216 | |
| 217 | export function SwitchValue({value, setfn}) { |
| 218 | const onclick = ev => setfn(!value); |
nothing calls this directly
no outgoing calls
no test coverage detected