Sha256: be55a8797b7698eb844d046f8aa39cf07f85dcc995ca51789ba2dd57e052643c
Contents?: true
Size: 1.97 KB
Versions: 35
Compression:
Stored size: 1.97 KB
Contents
<%= render component_tag(:div, x: { data: x_data("button", alpine_data), "@click": on_click, dropdown: dropdown_opts, bind: "root" }, class: component_classes, ) do %> <%= coco_tag(button_tag_name, **button_attrs, class: "button-element", x: { "dropdown:trigger": (true if dropdown?), "@click": ("checkConfirmation" if confirm?), ":disabled": "disabled" } ) do %> <span class="button-inner"> <% states.each do |name, props| %> <% if props[:icon].present? %> <% if states.many? %> <span class="button-icon" x-ref="<%= name %>Icon" x-show="showIcon('<%= name %>')" <%= "x-cloak" unless name.to_sym == :default %>> <%= props[:icon] %> </span> <% else %> <span class="button-icon" x-ref="defaultIcon"> <%= props[:icon] %> </span> <% end %> <% end %> <% end %> <% unless icon_only? %> <% states.each do |name, props| %> <% if states.many? %> <span class="button-content" x-ref="<%= name %>Content" x-show="showContent('<%= name %>')" <%= "x-cloak" unless name.to_sym == :default %>> <%= props[:text] %> </span> <% else %> <span class="button-content" x-ref="defaultContent"> <%= props[:text] %> </span> <% end %> <% end %> <% end %> <% if toggle? %> <% if toggle_direction == :horizontal %> <%= coco_icon(:chevron_right, class: "button-toggle") %> <% else %> <%= coco_icon(:chevron_down, class: "button-toggle") %> <% end %> <% end %> </span> <% end %> <% if dropdown? %> <div x-dropdown:content> <div class="button-dropdown"> <%= dropdown %> </div> </div> <% end %> <% end %>
Version data entries
35 entries across 35 versions & 1 rubygems