|
8 | 8 | data-field={@field.id} |
9 | 9 | data-debounce={@debounce} |
10 | 10 | > |
11 | | - <div class={class(@style, :tags_container, @tags_container_class, @tags_container_extra_class)}> |
12 | | - <%= if (@mode in [:tags, :quick_tags]) && Enum.any?(@selection) do %> |
13 | | - <%= for {option, idx} <- Enum.with_index(@selection) do %> |
14 | | - <div class={class(@style, :tag, @tag_class, @tag_extra_class)}> |
15 | | - <%= if @tag == [] do %> |
16 | | - <%= option[:tag_label] || option[:label] %> |
| 11 | + <div |
| 12 | + :if={@mode in [:tags, :quick_tags] && Enum.any?(@selection)} |
| 13 | + class={class(@style, :tags_container, @tags_container_class, @tags_container_extra_class)} |
| 14 | + > |
| 15 | + <%= for {option, idx} <- Enum.with_index(@selection) do %> |
| 16 | + <div class={class(@style, :tag, @tag_class, @tag_extra_class)}> |
| 17 | + <%= if @tag == [] do %> |
| 18 | + <%= option[:tag_label] || option[:label] %> |
| 19 | + <% else %> |
| 20 | + <%= render_slot(@tag, option) %> |
| 21 | + <% end %> |
| 22 | + <button |
| 23 | + :if={!option[:sticky] && !@disabled} |
| 24 | + type="button" |
| 25 | + data-idx={idx} |
| 26 | + class={ |
| 27 | + class( |
| 28 | + @style, |
| 29 | + :clear_tag_button, |
| 30 | + @clear_tag_button_class, |
| 31 | + @clear_tag_button_extra_class |
| 32 | + ) ++ |
| 33 | + if @no_basic_styles_for_clear_buttons, do: [], else: ~w(ls-clear-tag-button) |
| 34 | + } |
| 35 | + > |
| 36 | + <%= if @clear_button == [] do %> |
| 37 | + <.x /> |
17 | 38 | <% else %> |
18 | | - <%= render_slot(@tag, option) %> |
| 39 | + <%= render_slot(@clear_button) %> |
19 | 40 | <% end %> |
20 | | - <button |
21 | | - :if={!option[:sticky] && !@disabled} |
22 | | - type="button" |
23 | | - data-idx={idx} |
24 | | - class={ |
25 | | - class( |
26 | | - @style, |
27 | | - :clear_tag_button, |
28 | | - @clear_tag_button_class, |
29 | | - @clear_tag_button_extra_class |
30 | | - ) ++ |
31 | | - if @no_basic_styles_for_clear_buttons, do: [], else: ~w(ls-clear-tag-button) |
32 | | - } |
33 | | - > |
34 | | - <%= if @clear_button == [] do %> |
35 | | - <.x /> |
36 | | - <% else %> |
37 | | - <%= render_slot(@clear_button) %> |
38 | | - <% end %> |
39 | | - </button> |
40 | | - </div> |
41 | | - <% end %> |
| 41 | + </button> |
| 42 | + </div> |
42 | 43 | <% end %> |
43 | 44 | </div> |
44 | 45 |
|
|
0 commit comments