Sha256: bf932afbfb68765e7c50633e68f5fb7c772f7eeb7692c0a17d0fe8ab46cc0a79

Contents?: true

Size: 434 Bytes

Versions: 54

Compression:

Stored size: 434 Bytes

Contents

module Coco
  class ModalLightbox < Coco::Component
    include Concerns::AcceptsOptions

    renders_one :image, ->(scroll_top: 0, **kwargs) do
      coco_image(
        x: {"on:load": "imageLoaded"},
        data: {scroll_top: scroll_top.to_i, role: "image"},
        **kwargs
      )
    end

    before_render do
      unless image?
        raise ArgumentError, "An image is required for the lightbox"
      end
    end
  end
end

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
coveragebook_components-0.16.0 app/components/coco/modals/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.15.0 app/components/coco/modals/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.14.0 app/components/coco/modals/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.13.1 app/components/coco/modals/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.13.0 app/components/coco/modals/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.12.2 app/components/coco/shared/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.12.1 app/components/coco/shared/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.12.0 app/components/coco/shared/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.11.0 app/components/coco/shared/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.10.1.beta.2 app/components/coco/shared/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.10.1.beta.1 app/components/coco/shared/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.10.1.beta.0 app/components/coco/shared/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.10.0 app/components/coco/base/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.9.1 app/components/coco/base/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.9.0 app/components/coco/base/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.8.9 app/components/coco/base/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.8.8 app/components/coco/base/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.8.7 app/components/coco/base/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.8.6 app/components/coco/base/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.8.5 app/components/coco/base/modal_lightbox/modal_lightbox.rb