Sha256: 9c0459227c4f743f9f22d1ba28233eccfd863df2427ff872327f6288d63cea71

Contents?: true

Size: 526 Bytes

Versions: 35

Compression:

Stored size: 526 Bytes

Contents

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

    accepts_option :dismissable, from: [true, false], default: true

    renders_one :title

    before_render do
      unless title?
        raise ArgumentError, "A title is required for modal dialogs"
      end
    end

    def initialize(**kwargs)
      title { kwargs[:title] } if kwargs[:title]
    end

    def header?
      title || dismissable?
    end

    def dismissable?
      get_option_value(:dismissable)
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
coveragebook_components-0.13.0 app/components/coco/modals/modal_dialog/modal_dialog.rb
coveragebook_components-0.12.2 app/components/coco/shared/modal_dialog/modal_dialog.rb
coveragebook_components-0.12.1 app/components/coco/shared/modal_dialog/modal_dialog.rb
coveragebook_components-0.12.0 app/components/coco/shared/modal_dialog/modal_dialog.rb
coveragebook_components-0.11.0 app/components/coco/shared/modal_dialog/modal_dialog.rb
coveragebook_components-0.10.1.beta.2 app/components/coco/shared/modal_dialog/modal_dialog.rb
coveragebook_components-0.10.1.beta.1 app/components/coco/shared/modal_dialog/modal_dialog.rb
coveragebook_components-0.10.1.beta.0 app/components/coco/shared/modal_dialog/modal_dialog.rb
coveragebook_components-0.10.0 app/components/coco/base/modal_dialog/modal_dialog.rb
coveragebook_components-0.9.1 app/components/coco/base/modal_dialog/modal_dialog.rb
coveragebook_components-0.9.0 app/components/coco/base/modal_dialog/modal_dialog.rb
coveragebook_components-0.8.9 app/components/coco/base/modal_dialog/modal_dialog.rb
coveragebook_components-0.8.8 app/components/coco/base/modal_dialog/modal_dialog.rb
coveragebook_components-0.8.7 app/components/coco/base/modal_dialog/modal_dialog.rb
coveragebook_components-0.8.6 app/components/coco/base/modal_dialog/modal_dialog.rb
coveragebook_components-0.8.5 app/components/coco/base/modal_dialog/modal_dialog.rb
coveragebook_components-0.8.4 app/components/coco/base/modal_dialog/modal_dialog.rb
coveragebook_components-0.8.3 app/components/coco/base/modal_dialog/modal_dialog.rb
coveragebook_components-0.8.2 app/components/coco/base/modal_dialog/modal_dialog.rb
coveragebook_components-0.8.1 app/components/coco/base/modal_dialog/modal_dialog.rb