
<label class="mb-1 sm2 color-gray-dark" title="<%= data.label %>">
  <%= data.label %>
</label>
<div class="form-inline position-relative">
  <input
    <% for (key in data.attrs) { %>
      <%= key + '="' + data.attrs[key] + '"' %>
    <% } %>
    type="<%= data.input %>"
    class="form-control form-control-sm sm2 h-3 w-<%= data.input == 'color' ? 30: 100 %>"
    id="<%= data.id %>"
    name="<%= data.id %>"
    <%  if (data.input == 'color') { %>
      onchange="(function (e){ e.target.nextElementSibling.innerHTML = e.target.value }(event))"
      value="#fffffe"
    <% } %>
    >
  <% if(data.input != 'color') { %>
    <label class="mb-1 sm2 position-absolute pos-tr pr-2 pt-2 h-2" title="<%= data.unit %>">
      <%= data.unit %>
    </label>
  <% } else { %>
    <button class="btn btn-sm btn-light py-0 sm2 cursor-default"></button>
  <% } %>
</div>
