xmpp.chapril.org-conversejs/src/templates/form_select.js

12 lines
422 B
JavaScript
Raw Normal View History

2020-12-28 17:48:25 +01:00
import { html } from "lit-html";
const tpl_option = (o) => html`<option value="${o.value}" ?selected="${o.selected}">${o.label}</option>`;
export default (o) => html`
<div class="form-group">
<label for="${o.id}">${o.label}</label>
<select class="form-control" id="${o.id}" name="${o.name}" ?multiple="${o.multiple}">
${o.options?.map(o => tpl_option(o))}
</select>
</div>`;