* Generates a selection list input element.
(bind6, el, param, value3)
| 142071 | /** |
| 142072 | * Generates a selection list input element. |
| 142073 | */ function select(bind6, el, param, value3) { |
| 142074 | const node = element("select", { |
| 142075 | name: param.signal |
| 142076 | }), labels = param.labels || []; |
| 142077 | param.options.forEach((option, i)=>{ |
| 142078 | const attr = { |
| 142079 | value: option |
| 142080 | }; |
| 142081 | if (valuesEqual(option, value3)) attr.selected = true; |
| 142082 | node.appendChild(element("option", attr, (labels[i] || option) + "")); |
| 142083 | }); |
| 142084 | el.appendChild(node); |
| 142085 | node.addEventListener("change", ()=>{ |
| 142086 | bind6.update(param.options[node.selectedIndex]); |
| 142087 | }); |
| 142088 | bind6.elements = [ |
| 142089 | node |
| 142090 | ]; |
| 142091 | bind6.set = (value)=>{ |
| 142092 | for(let i = 0, n = param.options.length; i < n; ++i)if (valuesEqual(param.options[i], value)) { |
| 142093 | node.selectedIndex = i; |
| 142094 | return; |
| 142095 | } |
| 142096 | }; |
| 142097 | } |
| 142098 | /** |
| 142099 | * Generates a radio button group. |
| 142100 | */ function radio(bind7, el, param, value4) { |
nothing calls this directly
no test coverage detected