Sha256: be5c3e99b87b5d381ef7e7496c4c4c81f46e44661c0273454afcda54cd787854

Contents?: true

Size: 1.25 KB

Versions: 25

Compression:

Stored size: 1.25 KB

Contents

<%= render component_tag(x: {data: x_data("imagePicker", {src: src}), ":class": "hasImage && 'has-image'"}) do %>  
  <div class="picker-file-name" x-show="hasImage">
    <label x-text="name"></label>
  </div>
  <div class="picker-uploader" @image-uploader:load="setImage($event.detail.file)" x-ref="uploader">
    <%= render Coco::ImageUploader.new(
      **uploader_args,
      click: false) do %>
      <div class="picker-blank-state" x-show="!$parent.src">
        <% if blank_state_text? %>
          <div class="picker-placeholder-text">
            <%= blank_state_text %>
          </div>
        <% end %>
        <div class="picker-browse-trigger">
          <%= coco_button(theme: :secondary, click: "$parent.openPicker") do %>
            Browse your files
          <% end %>
        </div>
      </div>
      <div x-show="$parent.src" x-cloak>
        <img :src="$parent.src" class="picker-thumbnail">
      </div>
    <% end %>
  </div>
  <div class="picker-actions" x-show="hasImage">
    <%= coco_button(theme: :text_secondary, icon: :repeat, click: "$parent.replaceImage()") do %>
      Replace
    <% end %>

    <%= coco_button(theme: :text_negative, icon: :trash_2, click: "$parent.clearImage(false)") do %>
      Delete
    <% end %>
  </div>
<% end %>

  

Version data entries

25 entries across 25 versions & 1 rubygems

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