-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathform-field-checklist.html
44 lines (44 loc) · 2.02 KB
/
form-field-checklist.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<!-- <pat-form-field-checklist> -->
<fieldset
{% include patterns/form-field-auto-save-attributes %}
class="
pat-checklist
{{ include.class }}
{% include patterns/form-field-auto-save-classes %}
{% if include.depends %}pat-depends{% endif %}"
{% if include.depends %}data-pat-depends="{{ include.depends }}; transition: slide"{% endif %}>
<legend>
{%- include patterns/form-field-label-conditional.html -%}
</legend>
<div
class="pat-checklist">
{% for sub in include.items %}
<label>
{%- include patterns/i18n id=sub.label %}
<input
{% if include.variation == 'radio' %}
{% if sub.value %}
value="{{ sub.value }}"
{% else %}
value="{{ sub.label | remove: 'label_' | slugify }}"
{% endif %}
{% endif %}
{% if sub.selected == 'selected' %}
checked
{% endif %}
{% if sub.disabled %}
disabled
{% endif %}
tabindex="0"
name="
{%- if include.variation == 'radio' -%}
{{ include.label | slugify | default: 'some_name_for_the_radios' }}
{%- else -%}
{{ sub.label | remove: 'label_' | slugify }}
{%- endif -%}"
type="{{ include.variation | default: 'checkbox' }}">
</label>
{% endfor %}
</div>
</fieldset>
<!-- </pat-form-field-checklist> -->