{% if name is defined and name %}
    {{ hiddenInput(name, '') }}
{% endif -%}

{% set elements = (elements is defined ? elements : []) -%}
{% set criteria = (criteria is defined and criteria ? criteria : null) -%}
{% set sourceElementId = (sourceElementId is defined and sourceElementId ? sourceElementId : null) -%}

{% from "_includes/forms" import text %}

<div id="{{ id }}" class="elementselect tagselect">
    <div class="elements">
        {% for element in elements %}
            {% include "_elements/