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.19.8 app/components/coco/modals/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.19.7 app/components/coco/modals/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.19.6 app/components/coco/modals/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.19.5 app/components/coco/modals/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.19.4 app/components/coco/modals/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.19.3 app/components/coco/modals/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.19.2 app/components/coco/modals/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.19.1 app/components/coco/modals/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.19.0 app/components/coco/modals/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.18.8 app/components/coco/modals/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.18.7 app/components/coco/modals/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.18.0 app/components/coco/modals/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.17.7 app/components/coco/modals/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.17.6 app/components/coco/modals/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.17.5 app/components/coco/modals/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.17.4 app/components/coco/modals/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.17.3 app/components/coco/modals/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.17.2 app/components/coco/modals/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.17.1 app/components/coco/modals/modal_lightbox/modal_lightbox.rb
coveragebook_components-0.17.0 app/components/coco/modals/modal_lightbox/modal_lightbox.rb