Sha256: 219629e7d388b0b19bb6c9b2a21ae634747972c44e4854d8b9472ffc11856438

Contents?: true

Size: 1.25 KB

Versions: 47

Compression:

Stored size: 1.25 KB

Contents

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

47 entries across 47 versions & 1 rubygems

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