Sha256: 6b6db7e4e5f06f8cceb19e9cfb53872651d666dcb7db22db1b50fdd812b9210c

Contents?: true

Size: 1.04 KB

Versions: 102

Compression:

Stored size: 1.04 KB

Contents

# frozen_string_literal: true

module Primer
  module Alpha
    # A client-side mechanism to crop images.
    class ImageCrop < Primer::Component
      # A loading indicator that is shown while the image is loading.
      # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
      renders_one :loading, lambda { |**system_arguments|
        deny_tag_argument(**system_arguments)
        system_arguments[:tag] = :div
        system_arguments[:"data-loading-slot"] = true

        Primer::BaseComponent.new(**system_arguments)
      }

      # @param src [String] The path of the image to crop.
      # @param rounded [Boolean] If the crop mask should be a circle. Defaults to true.
      # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
      def initialize(src:, rounded: true, **system_arguments)
        @system_arguments = deny_tag_argument(**system_arguments)
        @system_arguments[:tag] = "image-crop"
        @system_arguments[:src] = src
        @system_arguments[:rounded] = true if rounded
      end
    end
  end
end

Version data entries

102 entries across 102 versions & 2 rubygems

Version Path
openproject-primer_view_components-0.48.2 app/components/primer/alpha/image_crop.rb
openproject-primer_view_components-0.48.1 app/components/primer/alpha/image_crop.rb
openproject-primer_view_components-0.48.0 app/components/primer/alpha/image_crop.rb
openproject-primer_view_components-0.47.1 app/components/primer/alpha/image_crop.rb
openproject-primer_view_components-0.47.0 app/components/primer/alpha/image_crop.rb
primer_view_components-0.34.0 app/components/primer/alpha/image_crop.rb
openproject-primer_view_components-0.46.1 app/components/primer/alpha/image_crop.rb
openproject-primer_view_components-0.46.0 app/components/primer/alpha/image_crop.rb
openproject-primer_view_components-0.45.0 app/components/primer/alpha/image_crop.rb
openproject-primer_view_components-0.44.3 app/components/primer/alpha/image_crop.rb
openproject-primer_view_components-0.44.2 app/components/primer/alpha/image_crop.rb
openproject-primer_view_components-0.44.1 app/components/primer/alpha/image_crop.rb
primer_view_components-0.33.0 app/components/primer/alpha/image_crop.rb
openproject-primer_view_components-0.44.0 app/components/primer/alpha/image_crop.rb
openproject-primer_view_components-0.43.1 app/components/primer/alpha/image_crop.rb
openproject-primer_view_components-0.43.0 app/components/primer/alpha/image_crop.rb
primer_view_components-0.32.0 app/components/primer/alpha/image_crop.rb
openproject-primer_view_components-0.42.0 app/components/primer/alpha/image_crop.rb
primer_view_components-0.31.0 app/components/primer/alpha/image_crop.rb
openproject-primer_view_components-0.41.1 app/components/primer/alpha/image_crop.rb