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.8.0.beta.3 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.8.0.beta.2 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.8.0.beta.1 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.7.10 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.7.9 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.7.8 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.7.7 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.7.6 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.7.5 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.7.4 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.7.3 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.7.2 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.7.1 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.7.0 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.6.5 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.6.4 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.6.3 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.6.2 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.6.1 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
coveragebook_components-0.6.0 app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb