Sha256: d0b9a0269a132665f028fd6b25de7a0cdebbf39316ac830eafa6eb8a9262e670

Contents?: true

Size: 1.16 KB

Versions: 40

Compression:

Stored size: 1.16 KB

Contents

<%= render component_tag(x: {
  data: x_data("appLayoutPickerButton", {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

40 entries across 40 versions & 1 rubygems

Version Path
coveragebook_components-0.12.2 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.12.1 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.12.0 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.11.0 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.10.1.beta.2 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.10.1.beta.1 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.10.1.beta.0 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.10.0 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.9.1 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.9.0 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.8.9 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.8.8 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.8.7 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.8.6 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.8.5 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.8.4 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.8.3 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.8.2 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.8.1 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.8.0 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb