{% set name = full_name|default(name|default('form-control')) %}
{% set toggleDisabled = toggleDisabled|default %}
{% set inputAttributes = inputAttributes|default([])
|merge({ 'id': id|default('form-control-id') })
|merge({ 'type': type|default('text') })
|merge({ 'name': name })
|merge(placeholder is defined ? {placeholder: placeholder}: {})
|merge(value is defined ? {value: value}: {})
|merge(required|default(false) ? { 'required': '' } : {})
|merge(disabled|default(false) ? { 'disabled': '' } : {})
|merge(readonly|default(false) ? { 'readonly': '' } : {})
|merge(helpText is defined ? {'aria-describedby': id ~'-help-block'}: {}) %}
<div class="js-form-validation__group {{ (errors|default([])|length > 0) ? 'has-error': '' }} {{ styleModifier|default('') }} {{ className|default('') }}">
<div class="{{ inputWrapperModifier|default('') }}">
{% block label %}
{{ include('includes/form/partials/form-control-label.html.twig', {
'className' : 'form-label ' ~ labelModifier|default('')
}) }}
{% endblock %}
{% block input %}
<input class="form-control {{ (errors|default([])|length > 0) ? 'is-invalid': '' }} {{ inputModifier|default('') }} {{ toggleDisabled ? 'js-toggle-disabled__input' : '' }}"
{% for key, value in inputAttributes %}
{{ key }}="{{ value }}"
{% endfor %}
>
{% if toggleDisabled %}
<button class="js-toggle-disabled__toggle form-control__button" type="button" data-toggle="disabled" data-target="#{{ id }}">
<span class="icon icon-edit form-control__button-icon" aria-label="Edit"></span>
{{ 'form.edit'|trans }}
</button>
{% endif %}
{% if additionalButton|default %}
<button class="form-control__button {{ additionalButton.classNames.button }}"
{% for key, value in additionalButton.buttonAttributes|default %}
{{ key }}="{{ value }}"
{% endfor %}
type="button">
<span class="{{ additionalButton.classNames.icon }} form-control__button-icon" aria-label="Edit"></span>
{{ additionalButton.classNames.text }}
</button>
{% endif %}
{% endblock %}
</div>
{% block errors %}
{{ include('includes/form/partials/form-errors.html.twig', {
'className': errorModifier|default('')
}) }}
{% endblock %}
{% block help %}
{{ include('includes/form/partials/form-control-help-text.html.twig', {
'className': helpTextModifier|default('')
}) }}
{% endblock %}
</div>