Sha256: 99c94da9b5052e2e499aad750bba4fd133037449b286c39eb0fd2dbe4911c589

Contents?: true

Size: 1.16 KB

Versions: 5

Compression:

Stored size: 1.16 KB

Contents

<%= render component_tag(x: {
  data: x_data("layoutPickerButton", {selected: selected})
}) do %> 
  <div
    @layout-picker:selected="selectedLayout = $event.detail.layout"
    x-effect="$dispatch('layout-picker:change', {layout: selectedLayout})">
    <%= render button do |btn| %>
      <% btn.with_dropdown do %>
        <div x-cloak>
          <div data-role="layout-picker">
            <div class="layout-picker" data-size="<%= size %>" <% @resize.each do |key, size| %>data-size-<%= key %>="<%= size %>" <% end %>>
            
              <% layout_options.each do |options| %>
                <button
                  @click="$dispatch('layout-picker:selected', {layout: '<%= options[:name] %>'})"
                  class="layout-picker-option"
                  :class="{'layout-picker-option-current': typeof selectedLayout !== 'undefined' && selectedLayout === '<%= options[:name] %>'}"
                  aria-label="<%= options[:name] %>">
                  <%= coco_svg(options[:thumbnail]) %>
                </button>
              <% end %>
            </div>
          </div>
        </div>
      <% end %>

      <%= content %>
    <% end %>
  </div>
<% end %>

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
coveragebook_components-0.16.0 app/components/coco/buttons/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.15.0 app/components/coco/buttons/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.14.0 app/components/coco/buttons/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.13.1 app/components/coco/buttons/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.13.0 app/components/coco/buttons/layout_picker_button/layout_picker_button.html.erb