Sha256: c9ed5580337788254f639e160d297eff119201de51ece71c7ed7e1ca90f82a36

Contents?: true

Size: 584 Bytes

Versions: 47

Compression:

Stored size: 584 Bytes

Contents

module Coco
  module App
    module Elements
      class ImagePicker < Coco::Component
        include Concerns::AcceptsOptions
        include Coco::AppHelper

        accepts_option :size, from: [:sm, :md, nil], default: :sm

        renders_one :blank_state_text

        before_render do
          args[:resize]&.each { set_tag_data_attr("size-#{_1}", _2) }
        end

        attr_reader :uploader_args, :src

        def initialize(src: nil, accept: "image/*", **kwargs)
          @src = src
          @uploader_args = {accept: accept}
        end
      end
    end
  end
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.rb
coveragebook_components-0.12.1 app/components/coco/app/elements/image_picker/image_picker.rb
coveragebook_components-0.12.0 app/components/coco/app/elements/image_picker/image_picker.rb
coveragebook_components-0.11.0 app/components/coco/app/elements/image_picker/image_picker.rb
coveragebook_components-0.10.1.beta.2 app/components/coco/app/elements/image_picker/image_picker.rb
coveragebook_components-0.10.1.beta.1 app/components/coco/app/elements/image_picker/image_picker.rb
coveragebook_components-0.10.1.beta.0 app/components/coco/app/elements/image_picker/image_picker.rb
coveragebook_components-0.10.0 app/components/coco/app/elements/image_picker/image_picker.rb
coveragebook_components-0.9.1 app/components/coco/app/elements/image_picker/image_picker.rb
coveragebook_components-0.9.0 app/components/coco/app/elements/image_picker/image_picker.rb
coveragebook_components-0.8.9 app/components/coco/app/elements/image_picker/image_picker.rb
coveragebook_components-0.8.8 app/components/coco/app/elements/image_picker/image_picker.rb
coveragebook_components-0.8.7 app/components/coco/app/elements/image_picker/image_picker.rb
coveragebook_components-0.8.6 app/components/coco/app/elements/image_picker/image_picker.rb
coveragebook_components-0.8.5 app/components/coco/app/elements/image_picker/image_picker.rb
coveragebook_components-0.8.4 app/components/coco/app/elements/image_picker/image_picker.rb
coveragebook_components-0.8.3 app/components/coco/app/elements/image_picker/image_picker.rb
coveragebook_components-0.8.2 app/components/coco/app/elements/image_picker/image_picker.rb
coveragebook_components-0.8.1 app/components/coco/app/elements/image_picker/image_picker.rb
coveragebook_components-0.8.0 app/components/coco/app/elements/image_picker/image_picker.rb