|  | 
| 66 | 66 |             })|e('html_attr') }}" | 
| 67 | 67 |             data-placeholder-template="{{ placeholder_list_item|e('html_attr') }}" | 
| 68 | 68 |         > | 
| 69 |  | -            {% if no_items %} | 
| 70 |  | -                {% if not is_dynamic %} | 
| 71 |  | -                    {{ placeholder_list_item }} | 
| 72 |  | -                {% endif %} | 
| 73 |  | -            {% else %} | 
| 74 |  | -                {% if value is empty %} | 
| 75 |  | -                    {% if not multiple %} | 
| 76 |  | -                        {% if placeholder is defined and placeholder is not none %} | 
| 77 |  | -                            {% set default_label = 'dropdown.placeholder.all'|trans()|desc('All') %} | 
| 78 |  | - | 
| 79 |  | -                            {% include selected_item_template_path with { | 
| 80 |  | -                                value: '', | 
| 81 |  | -                                label: _self.get_translated_label(placeholder, translation_domain)|trim|default(default_label), | 
| 82 |  | -                            } %} | 
| 83 |  | -                        {% else %} | 
| 84 |  | -                            {% set first_choice = choices_flat|first %} | 
| 85 |  | - | 
| 86 |  | -                            {% include selected_item_template_path with { | 
| 87 |  | -                                value: first_choice.value, | 
| 88 |  | -                                label: _self.get_translated_label(first_choice.label, translation_domain), | 
| 89 |  | -                                icon: first_choice.icon is defined ? first_choice.icon, | 
| 90 |  | -                            } %} | 
| 91 |  | -                        {% endif %} | 
|  | 69 | +            {% block selection_info_content %} | 
|  | 70 | +                {% if no_items %} | 
|  | 71 | +                    {% if not is_dynamic %} | 
|  | 72 | +                        {{ placeholder_list_item }} | 
| 92 | 73 |                     {% endif %} | 
| 93 | 74 |                 {% else %} | 
| 94 |  | -                    {% for choice in choices_flat %} | 
| 95 |  | -                        {% if custom_form ? choice.value == value : choice is selectedchoice(value) %} | 
| 96 |  | -                            {% set label = selected_item_label is defined | 
| 97 |  | -                                ? selected_item_label | 
| 98 |  | -                                : _self.get_translated_label(choice.label, translation_domain) | 
| 99 |  | -                            %} | 
|  | 75 | +                    {% if value is empty %} | 
|  | 76 | +                        {% if not multiple %} | 
|  | 77 | +                            {% if placeholder is defined and placeholder is not none %} | 
|  | 78 | +                                {% set default_label = 'dropdown.placeholder.all'|trans()|desc('All') %} | 
| 100 | 79 | 
 | 
| 101 |  | -                            {% include selected_item_template_path with { | 
| 102 |  | -                                label, | 
| 103 |  | -                                value: choice.value, | 
| 104 |  | -                                icon: choice.icon is defined ? choice.icon, | 
| 105 |  | -                            } %} | 
| 106 |  | -                        {% endif %} | 
| 107 |  | -                    {% endfor %} | 
| 108 |  | -                {% endif %} | 
| 109 |  | -                {% if multiple %} | 
| 110 |  | -                    <li | 
| 111 |  | -                        class="ibexa-dropdown__selected-item ibexa-dropdown__selected-item--predefined ibexa-dropdown__selected-placeholder" | 
| 112 |  | -                        {% if value is empty %}hidden{% endif %} | 
| 113 |  | -                    > | 
| 114 |  | -                        {% if placeholder is defined and placeholder is not none %} | 
| 115 |  | -                            {{ _self.get_translated_label(placeholder, translation_domain )}} | 
| 116 |  | -                        {% else %} | 
| 117 |  | -                            {{ 'dropdown.placeholder'|trans|desc("Choose an option") }} | 
|  | 80 | +                                {% include selected_item_template_path with { | 
|  | 81 | +                                    value: '', | 
|  | 82 | +                                    label: _self.get_translated_label(placeholder, translation_domain)|trim|default(default_label), | 
|  | 83 | +                                } %} | 
|  | 84 | +                            {% else %} | 
|  | 85 | +                                {% set first_choice = choices_flat|first %} | 
|  | 86 | + | 
|  | 87 | +                                {% include selected_item_template_path with { | 
|  | 88 | +                                    value: first_choice.value, | 
|  | 89 | +                                    label: _self.get_translated_label(first_choice.label, translation_domain), | 
|  | 90 | +                                    icon: first_choice.icon is defined ? first_choice.icon, | 
|  | 91 | +                                } %} | 
|  | 92 | +                            {% endif %} | 
| 118 | 93 |                         {% endif %} | 
| 119 |  | -                    </li> | 
|  | 94 | +                    {% else %} | 
|  | 95 | +                        {% for choice in choices_flat %} | 
|  | 96 | +                            {% if custom_form ? choice.value == value : choice is selectedchoice(value) %} | 
|  | 97 | +                                {% set label = selected_item_label is defined | 
|  | 98 | +                                    ? selected_item_label | 
|  | 99 | +                                    : _self.get_translated_label(choice.label, translation_domain) | 
|  | 100 | +                                %} | 
|  | 101 | + | 
|  | 102 | +                                {% include selected_item_template_path with { | 
|  | 103 | +                                    label, | 
|  | 104 | +                                    value: choice.value, | 
|  | 105 | +                                    icon: choice.icon is defined ? choice.icon, | 
|  | 106 | +                                } %} | 
|  | 107 | +                            {% endif %} | 
|  | 108 | +                        {% endfor %} | 
|  | 109 | +                    {% endif %} | 
|  | 110 | +                    {% if multiple %} | 
|  | 111 | +                        <li | 
|  | 112 | +                            class="ibexa-dropdown__selected-item ibexa-dropdown__selected-item--predefined ibexa-dropdown__selected-placeholder" | 
|  | 113 | +                            {% if value is empty %}hidden{% endif %} | 
|  | 114 | +                        > | 
|  | 115 | +                            {% if placeholder is defined and placeholder is not none %} | 
|  | 116 | +                                {{ _self.get_translated_label(placeholder, translation_domain )}} | 
|  | 117 | +                            {% else %} | 
|  | 118 | +                                {{ 'dropdown.placeholder'|trans|desc("Choose an option") }} | 
|  | 119 | +                            {% endif %} | 
|  | 120 | +                        </li> | 
|  | 121 | +                    {% endif %} | 
| 120 | 122 |                 {% endif %} | 
| 121 |  | -            {% endif %} | 
|  | 123 | +            {% endblock selection_info_content %} | 
| 122 | 124 | 
 | 
| 123 | 125 |             <li class="ibexa-dropdown__selected-item ibexa-dropdown__selected-item--predefined ibexa-dropdown__selected-overflow-number" hidden></li> | 
| 124 | 126 |         </ul> | 
|  | 
0 commit comments