Sha256: e6e35020b6f5814297def4df0f07c31642054e7a0cc96cf0d87bfb04d663efac

Contents?: true

Size: 1.3 KB

Versions: 20

Compression:

Stored size: 1.3 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] %>">
                  <% if options[:thumbnail] %>
                    <%= coco_svg(options[:thumbnail]) %>
                  <% else %>
                    <%= options[:icon] %>
                  <% end %>
                </button>
              <% end %>
            </div>
          </div>
        </div>
      <% end %>

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

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
coveragebook_components-0.19.8 app/components/coco/buttons/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.19.7 app/components/coco/buttons/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.19.6 app/components/coco/buttons/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.19.5 app/components/coco/buttons/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.19.4 app/components/coco/buttons/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.19.3 app/components/coco/buttons/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.19.2 app/components/coco/buttons/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.19.1 app/components/coco/buttons/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.19.0 app/components/coco/buttons/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.18.8 app/components/coco/buttons/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.18.7 app/components/coco/buttons/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.18.0 app/components/coco/buttons/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.17.7 app/components/coco/buttons/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.17.6 app/components/coco/buttons/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.17.5 app/components/coco/buttons/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.17.4 app/components/coco/buttons/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.17.3 app/components/coco/buttons/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.17.2 app/components/coco/buttons/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.17.1 app/components/coco/buttons/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.17.0 app/components/coco/buttons/layout_picker_button/layout_picker_button.html.erb