atst/templates/components/checkbox_input.html

34 lines
932 B
HTML

{% macro CheckboxInput(
field,
label=field.label,
inline=False,
classes="") -%}
<checkboxinput
name='{{ field.name }}'
inline-template
key='{{ field.name }}'
v-bind:initial-checked='{{ field.data|string|lower }}'
>
<div>
<div class='usa-input {{ classes }} {% if field.errors %}usa-input--error{% endif %}'>
<fieldset data-ally-disabled="true" v-on:change="onInput" class="usa-input__choices {% if inline %}usa-input__choices--inline{% endif %}">
<legend>
{{ field(**{"v-model": "isChecked"}) }}
{{ label | safe }}
{% if field.description %}
<p class='usa-input__help'>
{{ field.description | safe }}
</p>
{% endif %}
</legend>
</fieldset>
</div>
{% if caller %}
{{ caller() }}
{% endif %}
</div>
</checkboxinput>
{%- endmacro %}